qemu: rename VERSION to QEMU_VERSION to avoid name clash

In libc++ starting with LLVM8 there's `<version>` include in `cstddef`:

The following things also align:

* QEMU has a file called `VERSION` in repo root
* QEMU prepends repo root to include path in build
* macOS has a case-insensetive filesystem

All of this combined means that `VERSION` file is included as a header.

Working around this be renaming `VERSION` -> `QEMU_VERSION` to resolve ambiguity.

The problem really only appears on `aarch64-darwin`, since on `x86_64-darwin`
there are no C++ files to compile. The workaround is harmless enough to apply.
wip/yesman
Ivan Babrou 3 years ago
parent bb475b01d2
commit d29e8f0e59
  1. 4
      pkgs/applications/virtualization/qemu/default.nix

@ -108,6 +108,10 @@ stdenv.mkDerivation rec {
# this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang
chmod +x ./scripts/shaderinclude.pl
patchShebangs .
# avoid conflicts with libc++ include for <version>
mv VERSION QEMU_VERSION
substituteInPlace meson.build \
--replace "'VERSION'" "'QEMU_VERSION'"
'' + optionalString stdenv.hostPlatform.isMusl ''
NIX_CFLAGS_COMPILE+=" -D_LINUX_SYSINFO_H"
'';

Loading…
Cancel
Save