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:
parent
c16b065cc9
commit
de3f4fe900
|
@ -8,7 +8,9 @@
|
||||||
# Require the optional to be enabled until upstream fixes or removes the configure flag
|
# Require the optional to be enabled until upstream fixes or removes the configure flag
|
||||||
assert expat != null;
|
assert expat != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "wayland";
|
pname = "wayland";
|
||||||
version = "1.18.0";
|
version = "1.18.0";
|
||||||
|
|
||||||
|
@ -21,15 +23,20 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
mesonFlags = [ "-Ddocumentation=${lib.boolToString withDocumentation}" ];
|
mesonFlags = [ "-Ddocumentation=${lib.boolToString withDocumentation}" ];
|
||||||
|
|
||||||
|
patches = lib.optional isCross ./fix-wayland-cross-compilation.patch;
|
||||||
|
|
||||||
postPatch = lib.optionalString withDocumentation ''
|
postPatch = lib.optionalString withDocumentation ''
|
||||||
patchShebangs doc/doxygen/gen-doxygen.py
|
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 = [
|
nativeBuildInputs = [
|
||||||
meson pkgconfig ninja
|
meson pkgconfig ninja
|
||||||
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
] ++ lib.optionals isCross [
|
||||||
# for wayland-scanner during build
|
wayland # For wayland-scanner during the build
|
||||||
wayland
|
|
||||||
] ++ lib.optionals withDocumentation [
|
] ++ lib.optionals withDocumentation [
|
||||||
(graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
|
(graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
|
||||||
doxygen libxslt xmlto python3 docbook_xml_dtd_45
|
doxygen libxslt xmlto python3 docbook_xml_dtd_45
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue