commit 196a9447baa5d26bf7043d98ad0e13c5e649ea9c
Author: Mihai Moldovan <ionic@macports.org>
Date: Fri Nov 22 17:51:29 2019 +0100
emulators/qemu: fix builds using out-of-source builds. Revbump.
This targets mostly older platforms, but also generally changes behavior
to a more correct one.
The qemu build system is buggy when it comes to in-source-builds. Due to
Makefile dependencies, it always tries to reconfigure using a special
generated file at install time and also re-compiles the whole project.
This would normally be just an annoyance, but because not all parameters
are passed through (exported) correctly, the second build diverges from
the correct first one.
It shouldn't come as a surprise that Linux distros seem to use
out-of-source builds for qemu, which nicely works around that problem.
Additionally, older platforms have an mktemp implementation that always
expects a template as its parameter, but the Makefile doesn't prove one
in some cases. Hence, switch to GNU coreutils's on 10.10-, but keep
using mktemp on more recent platforms because it seems to work fine
there.
Fixes: https://trac.macports.org/ticket/59257
diff --git a/emulators/qemu/Portfile b/emulators/qemu/Portfile
index 3f58aa5462d..27beae19a53 100644
a
|
b
|
PortGroup legacysupport 1.0 |
8 | 8 | |
9 | 9 | name qemu |
10 | 10 | version 4.1.0 |
11 | | revision 0 |
| 11 | revision 1 |
12 | 12 | categories emulators |
13 | 13 | license GPL-2+ |
14 | 14 | platforms darwin |
… |
… |
pre-configure { |
106 | 106 | configure.args-append --target-list=${target_list} |
107 | 107 | } |
108 | 108 | |
| 109 | # The qemu build system bugs out when using in-source-tree builds. |
| 110 | # During builds, files are generated in directories such as pc-bios, which are |
| 111 | # prerequites to the config-host.mak file. The latter gets generated during a |
| 112 | # configure run and can (in theory) be used for reconfiguring the package. |
| 113 | # Practically, this reconfiguration fails because it doesn't take special flags |
| 114 | # into account like LDFLAGS and the like, so we have to avoid reconfiguring |
| 115 | # qemu. |
| 116 | # Additionally, just "touch"ing the file doesn't work either, because it is a |
| 117 | # prerequisite of other generated file which will, likewise, be generated twice. |
| 118 | # Using out-of-source builds we can work around this issue in a pretty nice way. |
| 119 | configure.dir "${workpath}/build" |
| 120 | |
| 121 | configure.cmd "${worksrcpath}/configure" |
| 122 | build.dir "${workpath}/build" |
| 123 | |
| 124 | pre-configure { |
| 125 | file mkdir ${configure.dir} |
| 126 | } |
| 127 | |
109 | 128 | # disable silent rules |
110 | 129 | build.args-append V=1 |
111 | 130 | |
… |
… |
platform darwin 8 { |
205 | 224 | build.cmd ${prefix}/bin/gmake |
206 | 225 | } |
207 | 226 | |
| 227 | platform darwin { |
| 228 | if {${os.major} < 15} { |
| 229 | depends_build-append port:coreutils |
| 230 | patchfiles-append patch-Makefile-legacy-mktemp-to-coreutils.diff |
| 231 | } |
| 232 | } |
| 233 | |
208 | 234 | livecheck.type regex |
209 | 235 | livecheck.url [lindex ${master_sites} 0] |
210 | 236 | livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)(?:-\\d+)*\\.tar |
diff --git a/emulators/qemu/files/patch-Makefile-legacy-mktemp-to-coreutils.diff b/emulators/qemu/files/patch-Makefile-legacy-mktemp-to-coreutils.diff
new file mode 100644
index 00000000000..2031f84cbb2
-
|
+
|
|
| 1 | --- a/Makefile 2019-08-15 21:01:42.000000000 +0200 |
| 2 | +++ b/Makefile 2019-11-22 13:38:08.000000000 +0100 |
| 3 | @@ -879,7 +879,7 @@ ifdef INSTALL_BLOBS |
| 4 | endif |
| 5 | ifneq ($(DESCS),) |
| 6 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/firmware" |
| 7 | - set -e; tmpf=$$(mktemp); trap 'rm -f -- "$$tmpf"' EXIT; \ |
| 8 | + set -e; tmpf=$$(gmktemp); trap 'rm -f -- "$$tmpf"' EXIT; \ |
| 9 | for x in $(DESCS); do \ |
| 10 | sed -e 's,@DATADIR@,$(qemu_datadir),' \ |
| 11 | "$(SRC_PATH)/pc-bios/descriptors/$$x" > "$$tmpf"; \ |