Upstream insists on not allowing bindir and other dir options
outside of prefix for some reason:
https://github.com/mesonbuild/meson/issues/2561
We remove the check so multiple outputs can work sanely.
In common distributions, RPATH is only needed for internal libraries so
meson removes everything else. With Nix, the locations of libraries
are not as predictable, therefore we need to keep them in the RPATH. [1]
Previously we have just kept the RPATH produced by the linker, patching
meson not to remove it. This deprived us of potentially replacing it
with install_rpath provided by project so we had to re-add it manually,
and also introduced a vulnerability of keeping build paths in RPATH.
This commit restores the clean-up but modifies it so the items starting
with /nix/store are retained.
This should be relatively safe since the store is immutable, however,
there might be some unwanted retainment of build_rpath [2] if it contains
paths from Nix store.
[1]: https://github.com/NixOS/nixpkgs/issues/31222#issuecomment-365811634
[2]: http://mesonbuild.com/Release-notes-for-0-42-0.html#added-build_rpath-keyword-argument
We are patching g-ir-scanner to produce absolute paths in the GIR
files. When an application uses an internal library placed in a
non-standard path (e.g. $out/lib/gnome-shell), the scanner needs
to be informed. For autotools-based apps, the full path was
obtained from libtool-wrapped files; with Meson, this is no longer
possible – we need to pass the path information in some other way.
This commit channels the --fallback-library-path option added
to g-ir-scanner in aforementioned patch.
* Add setupHook for meson/ninja build
* libhttpseverywhere: Use meson/ninja setupHooks
* jamomacore: Remove superfluous ninja buildInput
* Remove obsolete ninja buildPhases
These are all handled by ninja's setup hook.
* lean2, xcbuild: fix build with ninja setup hook
Ninja is a runtime dependency here. However, cmake can generate Ninja
build files as well to satisfy the setup hook.
* qtwebengine: fix build with ninja setup hook
In configured builds other tools tries to call meson by directly
passing meson tools directly to python. Since they were shell scripts
due wrapping this failed
/usr/bin/env is not available in chroot builds. Invoke the python3
interpreter directly instead of trying to let env do it (which fails).
Fixes this build error:
$ nix-build -A meson
...
/nix/store/HASH-stdenv/setup: ./install_meson.py: /usr/bin/env: bad interpreter: No such file or directory
builder for ‘/nix/store/HASH-meson-0.26.0.drv’ failed with exit code 126