Merge pull request #171705 from Mindavi/sdl2/cross

SDL2: fix cross-compilation
main
Rick van Schijndel 2 years ago committed by GitHub
commit 55c4a726fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      pkgs/development/libraries/SDL2/default.nix

@ -22,6 +22,7 @@
, waylandSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
, wayland
, wayland-protocols
, wayland-scanner
, drmSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
, libdrm
, mesa
@ -76,9 +77,18 @@ stdenv.mkDerivation rec {
./find-headers.patch
];
postPatch = ''
# Fix running wayland-scanner for the build platform when cross-compiling.
# See comment here: https://github.com/libsdl-org/SDL/issues/4860#issuecomment-1119003545
substituteInPlace configure \
--replace '$(WAYLAND_SCANNER)' 'wayland-scanner'
'';
strictDeps = true;
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland ];
nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland wayland-scanner ];
propagatedBuildInputs = dlopenPropagatedBuildInputs;

Loading…
Cancel
Save