From 8ce347392b447282291cbb3c377d856b8707ffa0 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sun, 2 Mar 2025 23:56:44 +0100 Subject: [PATCH] sdl2-compat: specify as compatible with all platforms The SDL library has backends for many platforms, not just unix ones, however, it's currently restricted by its dependencies. --- pkgs/by-name/sd/sdl2-compat/package.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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" ]; }; })