diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index 1ce2b1525f0..0112748695e 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/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;