diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
commit | 99fcaeccb89621dd492203ce1f2d551c06f228ed (patch) | |
tree | 41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/SDL2 | |
parent | 59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff) | |
parent | 75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff) | |
download | nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2 nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/nixos/modules/config/console.nix nixpkgs/nixos/modules/services/mail/mailman.nix nixpkgs/nixos/modules/services/mail/public-inbox.nix nixpkgs/nixos/modules/services/mail/rss2email.nix nixpkgs/nixos/modules/services/networking/ssh/sshd.nix nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix nixpkgs/pkgs/applications/networking/irc/weechat/default.nix nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/interpreters/python/default.nix nixpkgs/pkgs/development/node-packages/overrides.nix nixpkgs/pkgs/development/tools/b4/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix nixpkgs/pkgs/servers/mail/public-inbox/default.nix nixpkgs/pkgs/tools/security/pinentry/default.nix nixpkgs/pkgs/tools/text/unoconv/default.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/SDL2')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/SDL2/default.nix | 62 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch | 26 |
2 files changed, 42 insertions, 46 deletions
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/default.nix b/nixpkgs/pkgs/development/libraries/SDL2/default.nix index f73c5746cb71..7fe3fb38a1f7 100644 --- a/nixpkgs/pkgs/development/libraries/SDL2/default.nix +++ b/nixpkgs/pkgs/development/libraries/SDL2/default.nix @@ -23,7 +23,7 @@ , wayland , wayland-protocols , wayland-scanner -, drmSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid +, drmSupport ? false , libdrm , mesa , libxkbcommon @@ -33,8 +33,6 @@ , udev , ibusSupport ? false , ibus -, fcitxSupport ? false -, fcitx , libdecorSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid , libdecor , pipewireSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid @@ -55,17 +53,15 @@ # NOTE: When editing this expression see if the same change applies to # SDL expression too -with lib; - stdenv.mkDerivation rec { pname = "SDL2"; - version = "2.0.22"; + version = "2.26.5"; src = fetchurl { url = "https://www.libsdl.org/release/${pname}-${version}.tar.gz"; - sha256 = "sha256-/ny/MSeILj/HJZp1oMtYViAnLFF0XThSq53YeWBpfy4="; + sha256 = "sha256-rY/qPaG+ZMg8RbHTY6a0uo/WD1veOyPsc4VXCexeq/c="; }; - dontDisableStatic = withStatic; + dontDisableStatic = if withStatic then 1 else 0; outputs = [ "out" "dev" ]; outputBin = "dev"; # sdl-config @@ -88,40 +84,41 @@ stdenv.mkDerivation rec { depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland wayland-scanner ]; - - propagatedBuildInputs = dlopenPropagatedBuildInputs; + nativeBuildInputs = [ pkg-config ] ++ lib.optionals waylandSupport [ wayland wayland-scanner ]; dlopenPropagatedBuildInputs = [ ] # Propagated for #include <GLES/gl.h> in SDL_opengles.h. - ++ optional openglSupport libGL + ++ lib.optional (openglSupport && !stdenv.isDarwin) libGL # Propagated for #include <X11/Xlib.h> and <X11/Xatom.h> in SDL_syswm.h. - ++ optionals x11Support [ libX11 xorgproto ]; - - dlopenBuildInputs = optionals alsaSupport [ alsa-lib audiofile ] - ++ optional dbusSupport dbus - ++ optional libdecorSupport libdecor - ++ optional pipewireSupport pipewire - ++ optional pulseaudioSupport libpulseaudio - ++ optional udevSupport udev - ++ optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] - ++ optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] - ++ optionals drmSupport [ libdrm mesa ]; + ++ lib.optionals x11Support [ libX11 ]; + + propagatedBuildInputs = lib.optionals x11Support [ xorgproto ] + ++ dlopenPropagatedBuildInputs; + + dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ] + ++ lib.optional dbusSupport dbus + ++ lib.optional libdecorSupport libdecor + ++ lib.optional pipewireSupport pipewire + ++ lib.optional pulseaudioSupport libpulseaudio + ++ lib.optional udevSupport udev + ++ lib.optionals waylandSupport [ wayland libxkbcommon ] + ++ lib.optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] + ++ lib.optionals drmSupport [ libdrm mesa ]; buildInputs = [ libiconv ] ++ dlopenBuildInputs - ++ optional ibusSupport ibus - ++ optional fcitxSupport fcitx - ++ optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ]; + ++ lib.optional ibusSupport ibus + ++ lib.optionals waylandSupport [ wayland-protocols ] + ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ]; enableParallelBuilding = true; configureFlags = [ "--disable-oss" - ] ++ optional (!x11Support) "--without-x" - ++ optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib" - ++ optional stdenv.targetPlatform.isWindows "--disable-video-opengles" - ++ optional stdenv.isDarwin "--disable-sdltest"; + ] ++ lib.optional (!x11Support) "--without-x" + ++ lib.optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib" + ++ lib.optional stdenv.targetPlatform.isWindows "--disable-video-opengles" + ++ lib.optional stdenv.isDarwin "--disable-sdltest"; # We remove libtool .la files when static libs are requested, # because they make the builds of downstream libs like `SDL_tff` @@ -156,9 +153,9 @@ stdenv.mkDerivation rec { # list the symbols used in this way. postFixup = let - rpath = makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs); + rpath = lib.makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs); in - optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") '' + lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") '' for lib in $out/lib/*.so* ; do if ! [[ -L "$lib" ]]; then patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib" @@ -173,6 +170,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A cross-platform multimedia library"; homepage = "http://www.libsdl.org/"; + changelog = "https://github.com/libsdl-org/SDL/releases/tag/release-${version}"; license = licenses.zlib; platforms = platforms.all; maintainers = with maintainers; [ cpages ]; diff --git a/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch b/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch index 4792679deb11..8739da91eac1 100644 --- a/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch +++ b/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch @@ -1,22 +1,23 @@ diff --git a/sdl2-config.cmake.in b/sdl2-config.cmake.in -index c570511fa..ca694f595 100644 +index db864aab9..b94e16043 100644 --- a/sdl2-config.cmake.in +++ b/sdl2-config.cmake.in -@@ -7,7 +7,8 @@ set(includedir "@includedir@") - set(SDL2_PREFIX "${prefix}") - set(SDL2_EXEC_PREFIX "${exec_prefix}") - set(SDL2_LIBDIR "${libdir}") --set(SDL2_INCLUDE_DIRS "${includedir}/SDL2") -+set(SDL2_INCLUDE_DIRS "${includedir}/SDL2" $ENV{SDL2_PATH}) +@@ -26,7 +26,9 @@ set_and_check(SDL2_EXEC_PREFIX "${exec_prefix}") + set_and_check(SDL2_BINDIR "${bindir}") + set_and_check(SDL2_INCLUDE_DIR "${includedir}/SDL2") + set_and_check(SDL2_LIBDIR "${libdir}") +-set(SDL2_INCLUDE_DIRS "${includedir};${SDL2_INCLUDE_DIR}") ++ ++set(SDL2_INCLUDE_DIRS "${includedir};${SDL2_INCLUDE_DIR}" $ENV{SDL2_PATH}) +separate_arguments(SDL2_INCLUDE_DIRS) - set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@") - string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES) + set(SDL2_LIBRARIES SDL2::SDL2) + set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static) diff --git a/sdl2-config.in b/sdl2-config.in -index 5a2aed292..7c55f0a28 100644 +index f6eca7668..c0cd94590 100644 --- a/sdl2-config.in +++ b/sdl2-config.in -@@ -42,7 +42,11 @@ while test $# -gt 0; do +@@ -46,7 +46,11 @@ while test $# -gt 0; do echo @SDL_VERSION@ ;; --cflags) @@ -29,6 +30,3 @@ index 5a2aed292..7c55f0a28 100644 ;; @ENABLE_SHARED_TRUE@ --libs) @ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ --- -2.33.1 - |