SDL_compat: init at 1.2.52

This commit is contained in:
Peter Hoeg 2022-05-10 13:06:36 +08:00
parent 5d60882a1e
commit 73a4c001d4
2 changed files with 57 additions and 1 deletions

View File

@ -0,0 +1,52 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, SDL2
, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
, openglSupport ? libGLSupported
, libGL
, libGLU
}:
let
inherit (lib) optionals makeLibraryPath;
in
stdenv.mkDerivation rec {
pname = "SDL_compat";
version = "1.2.52";
src = fetchFromGitHub {
owner = "libsdl-org";
repo = "sdl12-compat";
rev = "release-" + version;
hash = "sha256-PDGlMI8q74JaqMQ5oX9Zt5CEr7frFQWECbuwq5g25eg=";
};
nativeBuildInputs = [ cmake pkg-config ];
propagatedBuildInputs = [ SDL2 ]
++ optionals openglSupport [ libGL libGLU ];
enableParallelBuilding = true;
setupHook = ../SDL/setup-hook.sh;
postFixup = ''
for lib in $out/lib/*.so* ; do
if [[ -L "$lib" ]]; then
patchelf --set-rpath "$(patchelf --print-rpath $lib):${makeLibraryPath propagatedBuildInputs}" "$lib"
fi
done
'';
meta = with lib; {
description = "A cross-platform multimedia library - build SDL 1.2 applications against 2.0";
homepage = "https://www.libsdl.org/";
license = licenses.zlib;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.all;
};
}

View File

@ -20436,13 +20436,17 @@ with pkgs;
autoreconfHook = buildPackages.autoreconfHook269;
};
SDL = callPackage ../development/libraries/SDL ({
SDL_classic = callPackage ../development/libraries/SDL ({
inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa GLUT;
} // lib.optionalAttrs stdenv.hostPlatform.isAndroid {
# libGLU doesnt work with Androids SDL
libGLU = null;
});
SDL_compat = callPackage ../development/libraries/SDL_compat { };
SDL = SDL_classic;
SDL_audiolib = callPackage ../development/libraries/SDL_audiolib { };
SDL_sixel = callPackage ../development/libraries/SDL_sixel { };