3
0
Fork 0
forked from mirrors/nixpkgs

wayland: Fix the cross-compilation with Meson

The build sandbox provides only wayland-scanner and not the library and
the wayland-egl symbols check test must use nm prefixed with the target
triplet.
This commit is contained in:
Michael Weiss 2020-02-04 22:16:04 +01:00
parent c16b065cc9
commit de3f4fe900
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83
2 changed files with 25 additions and 4 deletions

View file

@ -8,7 +8,9 @@
# Require the optional to be enabled until upstream fixes or removes the configure flag
assert expat != null;
stdenv.mkDerivation rec {
let
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
in stdenv.mkDerivation rec {
pname = "wayland";
version = "1.18.0";
@ -21,15 +23,20 @@ stdenv.mkDerivation rec {
mesonFlags = [ "-Ddocumentation=${lib.boolToString withDocumentation}" ];
patches = lib.optional isCross ./fix-wayland-cross-compilation.patch;
postPatch = lib.optionalString withDocumentation ''
patchShebangs doc/doxygen/gen-doxygen.py
'' + lib.optionalString isCross ''
substituteInPlace egl/meson.build --replace \
"find_program('nm').path()" \
"find_program('${stdenv.cc.targetPrefix}nm').path()"
'';
nativeBuildInputs = [
meson pkgconfig ninja
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
# for wayland-scanner during build
wayland
] ++ lib.optionals isCross [
wayland # For wayland-scanner during the build
] ++ lib.optionals withDocumentation [
(graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
doxygen libxslt xmlto python3 docbook_xml_dtd_45

View file

@ -0,0 +1,14 @@
diff --git a/src/meson.build b/src/meson.build
index 3e8c9bf..75241cb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -55,8 +55,7 @@ pkgconfig.generate(
)
if meson.is_cross_build()
- scanner_dep = dependency('wayland-scanner', native: true, version: '>=1.14.0')
- wayland_scanner_for_build = find_program(scanner_dep.get_pkgconfig_variable('wayland_scanner'))
+ wayland_scanner_for_build = find_program('wayland-scanner', native: true, version: '>=1.14.0')
else
wayland_scanner_for_build = wayland_scanner
endif