Merge pull request #89036 from Ericson2314/fix-mesa-wayland-cross

mesa wayland: Fix/simplify cross
This commit is contained in:
John Ericson 2020-05-27 16:45:05 -04:00 committed by GitHub
commit cc1af0751f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 26 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, fetchpatch
{ stdenv, lib, fetchurl, fetchpatch, buildPackages
, pkgconfig, intltool, ninja, meson
, file, flex, bison, expat, libdrm, xorg, wayland, wayland-protocols, openssl
, llvmPackages, libffi, libomxil-bellagio, libva-minimal
@ -73,6 +73,12 @@ stdenv.mkDerivation {
})
];
postPatch = ''
substituteInPlace meson.build --replace \
"find_program('pkg-config')" \
"find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')"
'';
outputs = [ "out" "dev" "drivers" "osmesa" ];
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
@ -112,10 +118,14 @@ stdenv.mkDerivation {
++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ]
++ lib.optional withValgrind valgrind-light;
depsBuildBuild = [ pkgconfig ];
nativeBuildInputs = [
pkgconfig meson ninja
intltool bison flex file
python3Packages.python python3Packages.Mako
] ++ lib.optionals (elem "wayland" eglPlatforms) [
wayland # For wayland-scanner during the build
];
propagatedBuildInputs = with xorg; [

View file

@ -23,16 +23,17 @@ in 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()"
'';
depsBuildBuild = [
pkgconfig
];
nativeBuildInputs = [
meson pkgconfig ninja
] ++ lib.optionals isCross [

View file

@ -1,14 +0,0 @@
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

View file

@ -262,7 +262,7 @@ in rec {
else if isx86_32 then "x86"
else if isx86_64 then "x86_64"
else platform.parsed.cpu.family + builtins.toString platform.parsed.cpu.bits;
crossFile = builtins.toFile "cross-file.conf" (''
crossFile = builtins.toFile "cross-file.conf" ''
[properties]
needs_exe_wrapper = true
@ -271,13 +271,7 @@ in rec {
cpu_family = '${cpuFamily stdenv.targetPlatform}'
cpu = '${stdenv.targetPlatform.parsed.cpu.name}'
endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"}
''
# TODO should have target prefix too, issue #86077
+ ''
[binaries]
pkgconfig = 'pkg-config'
'');
'';
in [ "--cross-file=${crossFile}" ] ++ mesonFlags;
} // lib.optionalAttrs (attrs.enableParallelBuilding or false) {
enableParallelChecking = attrs.enableParallelChecking or true;