about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/SDL2
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-19 09:13:54 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-19 09:13:54 +0000
commit220273ccc689041667ab5ff55fe5b1e93689227a (patch)
treed1c95664832920b476ab48ab5dd9ad09ec67d82d /nixpkgs/pkgs/development/libraries/SDL2
parent68bab940e926ec7ae7380947a78c581e6aadcd18 (diff)
parent6e3ee8957637a60f5072e33d78e05c0f65c54366 (diff)
downloadnixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.gz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.bz2
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.lz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.xz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.zst
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.zip
Merge commit '6e3ee8957637a60f5072e33d78e05c0f65c54366'
Conflicts:
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/SDL2')
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch43
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/default.nix115
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch46
3 files changed, 66 insertions, 138 deletions
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch b/nixpkgs/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch
deleted file mode 100644
index 1be600bedb35..000000000000
--- a/nixpkgs/pkgs/development/libraries/SDL2/Fix-build-against-wayland-1.20.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From a31d1f1683ef2e9c063c3fa1db79d111cca99414 Mon Sep 17 00:00:00 2001
-From: David Redondo <kde@david-redondo.de>
-Date: Fri, 10 Dec 2021 16:22:34 +0100
-Subject: [PATCH] Fix build against wayland 1.20
-
-Fixes #5088
-
-(cherry picked from commit e2ade2bfc46d915cd306c63c830b81d800b2575f)
----
- src/video/wayland/SDL_waylanddyn.h | 2 ++
- src/video/wayland/SDL_waylandsym.h | 4 ++++
- 2 files changed, 6 insertions(+)
-
-diff --git a/src/video/wayland/SDL_waylanddyn.h b/src/video/wayland/SDL_waylanddyn.h
-index 485a9c19f..37070e946 100644
---- a/src/video/wayland/SDL_waylanddyn.h
-+++ b/src/video/wayland/SDL_waylanddyn.h
-@@ -81,6 +81,8 @@ void SDL_WAYLAND_UnloadSymbols(void);
- #define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener)
- #define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor)
- #define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned)
-+#define wl_proxy_marshal_flags (*WAYLAND_wl_proxy_marshal_flags)
-+#define wl_proxy_marshal_array_flags (*WAYLAND_wl_proxy_marshal_array_flags)
-
- #define wl_seat_interface (*WAYLAND_wl_seat_interface)
- #define wl_surface_interface (*WAYLAND_wl_surface_interface)
-diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h
-index c4c189d3c..789f49e27 100644
---- a/src/video/wayland/SDL_waylandsym.h
-+++ b/src/video/wayland/SDL_waylandsym.h
-@@ -71,6 +71,10 @@ SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor, (struct wl_prox
- SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_10)
- SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, ...))
-
-+SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_20)
-+SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...))
-+SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version,  uint32_t flags, union wl_argument *args))
-+
- SDL_WAYLAND_INTERFACE(wl_seat_interface)
- SDL_WAYLAND_INTERFACE(wl_surface_interface)
- SDL_WAYLAND_INTERFACE(wl_shm_pool_interface)
---
-2.33.1
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/default.nix b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
index 95022211d2f7..d1086de3718d 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
@@ -1,20 +1,50 @@
-{ lib, stdenv, config, fetchurl, pkg-config
+{ lib
+, stdenv
+, config
+, fetchurl
+, pkg-config
 , libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
-, openglSupport ? libGLSupported, libGL
-, alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsa-lib
+, openglSupport ? libGLSupported
+, libGL
+, alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, alsa-lib
 , x11Support ? !stdenv.targetPlatform.isWindows && !stdenv.hostPlatform.isAndroid
-, libX11, xorgproto, libICE, libXi, libXScrnSaver, libXcursor
-, libXinerama, libXext, libXxf86vm, libXrandr
+, libX11
+, xorgproto
+, libICE
+, libXi
+, libXScrnSaver
+, libXcursor
+, libXinerama
+, libXext
+, libXxf86vm
+, libXrandr
 , waylandSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
-, wayland, wayland-protocols, libxkbcommon
-, dbusSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, dbus
-, udevSupport ? false, udev
-, ibusSupport ? false, ibus
-, fcitxSupport ? false, fcitx
+, wayland
+, wayland-protocols
+, libxkbcommon
+, dbusSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, dbus
+, udevSupport ? false
+, udev
+, ibusSupport ? false
+, ibus
+, fcitxSupport ? false
+, fcitx
+, libdecorSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, libdecor
+, pipewireSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, pipewire # NOTE: must be built with SDL2 without pipewire support
 , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux && !stdenv.hostPlatform.isAndroid
 , libpulseaudio
-, AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
-, audiofile, libiconv
+, AudioUnit
+, Cocoa
+, CoreAudio
+, CoreServices
+, ForceFeedback
+, OpenGL
+, audiofile
+, libiconv
 , withStatic ? false
 }:
 
@@ -25,32 +55,16 @@ with lib;
 
 stdenv.mkDerivation rec {
   pname = "SDL2";
-  version = "2.0.14";
+  version = "2.0.20";
 
   src = fetchurl {
     url = "https://www.libsdl.org/release/${pname}-${version}.tar.gz";
-    sha256 = "1g1jahknv5r4yhh1xq5sf0md20ybdw1zh1i15lry26sq39bmn8fq";
+    sha256 = "sha256-xWq6HXtbDn6Znkp2mMcLY6M5T/lwS19uHFfgwW8E3QY=";
   };
   dontDisableStatic = withStatic;
   outputs = [ "out" "dev" ];
   outputBin = "dev"; # sdl-config
 
-  patches = [
-    ./find-headers.patch
-    # To fix the build with wayland 1.20.0:
-    ./Fix-build-against-wayland-1.20.patch
-  ];
-
-  # Fix with mesa 19.2: https://bugzilla.libsdl.org/show_bug.cgi?id=4797
-  postPatch = ''
-    substituteInPlace include/SDL_opengl_glext.h \
-      --replace "typedef ptrdiff_t GLsizeiptr;" "typedef signed long int khronos_ssize_t; typedef khronos_ssize_t GLsizeiptr;" \
-      --replace "typedef ptrdiff_t GLintptr;" "typedef signed long int khronos_intptr_t; typedef khronos_intptr_t GLintptr;"
-
-    substituteInPlace configure \
-      --replace 'WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`' 'WAYLAND_SCANNER=`pkg-config --variable=wayland_scanner wayland-scanner`'
-  '';
-
   depsBuildBuild = [ pkg-config ];
 
   nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland ];
@@ -63,18 +77,19 @@ stdenv.mkDerivation rec {
     # 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  pulseaudioSupport libpulseaudio
-    ++ optional  udevSupport udev
+  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 ];
 
   buildInputs = [ libiconv ]
     ++ dlopenBuildInputs
-    ++ optional  ibusSupport ibus
-    ++ optional  fcitxSupport fcitx
+    ++ optional ibusSupport ibus
+    ++ optional fcitxSupport fcitx
     ++ optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
 
   enableParallelBuilding = true;
@@ -82,9 +97,9 @@ stdenv.mkDerivation rec {
   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";
+  ++ optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib"
+  ++ optional stdenv.targetPlatform.isWindows "--disable-video-opengles"
+  ++ 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`
@@ -117,15 +132,17 @@ stdenv.mkDerivation rec {
   #
   # You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to
   # list the symbols used in this way.
-  postFixup = let
-    rpath = makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
-  in 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"
-      fi
-    done
-  '';
+  postFixup =
+    let
+      rpath = makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
+    in
+    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"
+        fi
+      done
+    '';
 
   setupHook = ./setup-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch b/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch
deleted file mode 100644
index a2e0c4837031..000000000000
--- a/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -ru3 SDL2-2.0.14/sdl2-config.cmake.in SDL2-2.0.14-new/sdl2-config.cmake.in
---- SDL2-2.0.14/sdl2-config.cmake.in	2020-12-21 18:44:36.000000000 +0100
-+++ SDL2-2.0.14-new/sdl2-config.cmake.in	2021-01-16 23:53:40.721121792 +0100
-@@ -6,7 +6,8 @@
- set(SDL2_PREFIX "@prefix@")
- set(SDL2_EXEC_PREFIX "@prefix@")
- set(SDL2_LIBDIR "@libdir@")
--set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
-+set(SDL2_INCLUDE_DIRS "@includedir@/SDL2" $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)
- 
-@@ -20,14 +21,14 @@
- 
-   add_library(SDL2::SDL2 SHARED IMPORTED)
-   set_target_properties(SDL2::SDL2 PROPERTIES
--    INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
-+    INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
-     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-     IMPORTED_LOCATION "@libdir@/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}"
-     INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
- 
-   add_library(SDL2::SDL2-static STATIC IMPORTED)
-   set_target_properties(SDL2::SDL2-static PROPERTIES
--    INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
-+    INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
-     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-     IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}"
-     INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS_STATIC}")
-diff -ru3 SDL2-2.0.14/sdl2-config.in SDL2-2.0.14-new/sdl2-config.in
---- SDL2-2.0.14/sdl2-config.in	2020-12-21 18:44:36.000000000 +0100
-+++ SDL2-2.0.14-new/sdl2-config.in	2021-01-16 23:57:11.940353171 +0100
-@@ -42,7 +42,11 @@
-       echo @SDL_VERSION@
-       ;;
-     --cflags)
--      echo -I@includedir@/SDL2 @SDL_CFLAGS@
-+      SDL_CFLAGS=""
-+      for i in @includedir@/SDL2 $SDL2_PATH; do
-+        SDL_CFLAGS="$SDL_CFLAGS -I$i"
-+      done
-+      echo $SDL_CFLAGS @SDL_CFLAGS@
-       ;;
- @ENABLE_SHARED_TRUE@    --libs)
- @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@