diff --git a/pkgs/by-name/sd/sdl2-compat/package.nix b/pkgs/by-name/sd/sdl2-compat/package.nix index 3f74992d4195..29a9fa63028f 100644 --- a/pkgs/by-name/sd/sdl2-compat/package.nix +++ b/pkgs/by-name/sd/sdl2-compat/package.nix @@ -44,22 +44,16 @@ stdenv.mkDerivation (finalAttrs: { outputBin = "dev"; + # SDL3 is dlopened at runtime, leave it in runpath + dontPatchELF = true; + cmakeFlags = [ (lib.cmakeBool "SDL2COMPAT_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeFeature "CMAKE_INSTALL_RPATH" (lib.makeLibraryPath [ sdl3 ])) ]; doCheck = testSupport && stdenv.buildPlatform.canExecute stdenv.hostPlatform; - postFixup = - if stdenv.hostPlatform.isDarwin then - '' - install_name_tool -add_rpath ${lib.makeLibraryPath [ sdl3 ]} $out/lib/libSDL2.dylib - '' - else - '' - patchelf --add-rpath ${lib.makeLibraryPath [ sdl3 ]} $out/lib/libSDL2.so - ''; - patches = [ ./find-headers.patch ]; setupHook = ./setup-hook.sh; @@ -95,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: { changelog = "https://github.com/libsdl-org/sdl2-compat/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.zlib; maintainers = with lib.maintainers; [ nadiaholmquist ]; - platforms = lib.platforms.unix; + platforms = lib.platforms.all; pkgConfigModules = [ "sdl2_compat" ]; }; })