lol

SDL1: drop; update SDL_{image,mixer,net,ttf} (#274836)

authored by

K900 and committed by
GitHub
bce4d53d 7d4bcd60

+55 -255
-26
pkgs/by-name/sd/SDL1/find-headers.patch
··· 1 - diff --git a/sdl-config.in b/sdl-config.in 2 - index e0fcc0c..bf7928a 100644 3 - --- a/sdl-config.in 4 - +++ b/sdl-config.in 5 - @@ -42,14 +42,18 @@ while test $# -gt 0; do 6 - echo @SDL_VERSION@ 7 - ;; 8 - --cflags) 9 - - echo -I@includedir@/SDL @SDL_CFLAGS@ 10 - + SDL_CFLAGS="" 11 - + for i in @includedir@/SDL $SDL_PATH; do 12 - + SDL_CFLAGS="$SDL_CFLAGS -I$i" 13 - + done 14 - + echo $SDL_CFLAGS @SDL_CFLAGS@ 15 - ;; 16 - @ENABLE_SHARED_TRUE@ --libs) 17 - -@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ 18 - +@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ $SDL_LIB_PATH 19 - @ENABLE_SHARED_TRUE@ ;; 20 - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) 21 - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) 22 - -@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ 23 - +@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ $SDL_LIB_PATH 24 - @ENABLE_STATIC_TRUE@ ;; 25 - *) 26 - echo "${usage}" 1>&2
-156
pkgs/by-name/sd/SDL1/package.nix
··· 1 - { lib 2 - , alsa-lib 3 - , audiofile 4 - , config 5 - , darwin 6 - , fetchpatch 7 - , fetchurl 8 - , libGL 9 - , libGLU 10 - , libICE 11 - , libXext 12 - , libXrandr 13 - , libcap 14 - , libiconv 15 - , libpulseaudio 16 - , pkg-config 17 - , stdenv 18 - # Boolean flags 19 - , alsaSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid 20 - , libGLSupported ? lib.meta.availableOn stdenv.hostPlatform libGL 21 - , openglSupport ? libGLSupported 22 - , pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid && lib.meta.availableOn stdenv.hostPlatform libpulseaudio 23 - , x11Support ? !stdenv.hostPlatform.isCygwin && !stdenv.hostPlatform.isAndroid 24 - }: 25 - 26 - # NOTE: When editing this expression see if the same change applies to 27 - # SDL2 expression too 28 - 29 - let 30 - inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa GLUT; 31 - extraPropagatedBuildInputs = [ ] 32 - ++ lib.optionals x11Support [ libXext libICE libXrandr ] 33 - ++ lib.optionals (openglSupport && stdenv.hostPlatform.isLinux) [ libGL ] 34 - # libGLU doesn’t work with Android's SDL 35 - ++ lib.optionals (openglSupport && stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAndroid)) [ libGLU ] 36 - ++ lib.optionals (openglSupport && stdenv.hostPlatform.isDarwin) [ OpenGL GLUT ] 37 - ++ lib.optional alsaSupport alsa-lib 38 - ++ lib.optional pulseaudioSupport libpulseaudio 39 - ++ lib.optional stdenv.hostPlatform.isDarwin Cocoa; 40 - in 41 - stdenv.mkDerivation (finalAttrs: { 42 - pname = "SDL"; 43 - version = "1.2.15"; 44 - 45 - src = fetchurl { 46 - url = "https://www.libsdl.org/release/SDL-${finalAttrs.version}.tar.gz"; 47 - hash = "sha256-1tMWp5Pl40gVXw3ZO5eXmJM/uYqh7evMEIgp1kdKrQA="; 48 - }; 49 - 50 - outputs = [ "out" "dev" ]; 51 - outputBin = "dev"; # sdl-config 52 - 53 - nativeBuildInputs = [ pkg-config ] 54 - ++ lib.optional stdenv.hostPlatform.isLinux libcap; 55 - 56 - propagatedBuildInputs = [ libiconv ] ++ extraPropagatedBuildInputs; 57 - 58 - buildInputs = 59 - [ ] 60 - ++ lib.optionals (!stdenv.hostPlatform.isMinGW && alsaSupport) [ audiofile ] 61 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ]; 62 - 63 - configureFlags = [ 64 - "--disable-oss" 65 - "--disable-video-x11-xme" 66 - "--enable-rpath" 67 - # Building without this fails on Darwin with 68 - # 69 - # ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32' 70 - # SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) 71 - # 72 - # Please try revert the change that introduced this comment when updating SDL. 73 - ] ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-x11-shared" 74 - ++ lib.optional (!x11Support) "--without-x" 75 - ++ lib.optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib" 76 - ++ lib.optional stdenv.hostPlatform.isMusl "CFLAGS=-DICONV_INBUF_NONCONST"; 77 - 78 - patches = [ 79 - ./find-headers.patch 80 - 81 - # Fix window resizing issues, e.g. for xmonad 82 - # Ticket: http://bugzilla.libsdl.org/show_bug.cgi?id=1430 83 - (fetchpatch { 84 - name = "fix_window_resizing.diff"; 85 - url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fix_window_resizing.diff;att=2;bug=665779"; 86 - hash = "sha256-hj3ykyOKeDh6uPDlvwNHSowQxmR+mfhvCnHvcdhXZfw="; 87 - }) 88 - # Fix drops of keyboard events for SDL_EnableUNICODE 89 - (fetchpatch { 90 - url = "https://github.com/libsdl-org/SDL-1.2/commit/0332e2bb18dc68d6892c3b653b2547afe323854b.patch"; 91 - hash = "sha256-5V6K0oTN56RRi48XLPQsjgLzt0a6GsjajDrda3ZEhTw="; 92 - }) 93 - # Ignore insane joystick axis events 94 - (fetchpatch { 95 - url = "https://github.com/libsdl-org/SDL-1.2/commit/ab99cc82b0a898ad528d46fa128b649a220a94f4.patch"; 96 - hash = "sha256-8CvKHvkmidm4tFCWYhxE059hN3gwOKz6nKs5rvQ4ZKw="; 97 - }) 98 - # https://bugzilla.libsdl.org/show_bug.cgi?id=1769 99 - (fetchpatch { 100 - url = "https://github.com/libsdl-org/SDL-1.2/commit/5d79977ec7a6b58afa6e4817035aaaba186f7e9f.patch"; 101 - hash = "sha256-t+60bC4gLFbslXm1n9nimiFrho2DnxdWdKr4H9Yp/sw="; 102 - }) 103 - # Workaround X11 bug to allow changing gamma 104 - # Ticket: https://bugs.freedesktop.org/show_bug.cgi?id=27222 105 - (fetchpatch { 106 - name = "SDL_SetGamma.patch"; 107 - url = "https://src.fedoraproject.org/rpms/SDL/raw/7a07323e5cec08bea6f390526f86a1ce5341596d/f/SDL-1.2.15-x11-Bypass-SetGammaRamp-when-changing-gamma.patch"; 108 - hash = "sha256-m7ZQ5GnfGlMkKJkrBSB3GrLz8MT6njgI9jROJAbRonQ="; 109 - }) 110 - # Fix a build failure on OS X Mavericks 111 - # Ticket: https://bugzilla.libsdl.org/show_bug.cgi?id=2085 112 - (fetchpatch { 113 - url = "https://github.com/libsdl-org/SDL-1.2/commit/19039324be71738d8990e91b9ba341b2ea068445.patch"; 114 - hash = "sha256-DCWZo0LzHJoWUr/5vL5pKIEmmz3pvr4TO6Ip8WykfDI="; 115 - }) 116 - (fetchpatch { 117 - url = "https://github.com/libsdl-org/SDL-1.2/commit/7933032ad4d57c24f2230db29f67eb7d21bb5654.patch"; 118 - hash = "sha256-Knq+ceL6y/zKcfJayC2gy+DKnoa8DLslBNl3laMzwa8="; 119 - }) 120 - (fetchpatch { 121 - name = "CVE-2022-34568.patch"; 122 - url = "https://github.com/libsdl-org/SDL-1.2/commit/d7e00208738a0bc6af302723fe64908ac35b777b.patch"; 123 - hash = "sha256-fuxXsqZW94/C8CKu9LakppCU4zHupj66O2MngQ4BO9o="; 124 - }) 125 - ]; 126 - 127 - enableParallelBuilding = true; 128 - 129 - postInstall = '' 130 - moveToOutput share/aclocal "$dev" 131 - ''; 132 - 133 - # See the same place in the expression for SDL2 134 - postFixup = let 135 - rpath = lib.makeLibraryPath extraPropagatedBuildInputs; 136 - in '' 137 - for lib in $out/lib/*.so* ; do 138 - if [[ -L "$lib" ]]; then 139 - patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib" 140 - fi 141 - done 142 - ''; 143 - 144 - setupHook = ./setup-hook.sh; 145 - 146 - passthru = { inherit openglSupport; }; 147 - 148 - meta = { 149 - homepage = "http://www.libsdl.org/"; 150 - description = "Cross-platform multimedia library"; 151 - license = lib.licenses.lgpl21; 152 - mainProgram = "sdl-config"; 153 - maintainers = lib.teams.sdl.members ++ (with lib.maintainers; [ lovek323 ]); 154 - platforms = lib.platforms.unix; 155 - }; 156 - })
-16
pkgs/by-name/sd/SDL1/setup-hook.sh
··· 1 - addSDLPath () { 2 - if [ -e "$1/include/SDL" ]; then 3 - export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL" 4 - # NB this doesn’t work with split dev packages because different packages 5 - # will contain "include/SDL/" and "lib/" directories. 6 - # 7 - # However the SDL_LIB_PATH is consumed by SDL itself and serves to locate 8 - # libraries like SDL_mixer, SDL_image, etc which are not split-package 9 - # so the check above will only trigger on them. 10 - if [ -e "$1/lib" ]; then 11 - export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib" 12 - fi 13 - fi 14 - } 15 - 16 - addEnvHooks "$hostOffset" addSDLPath
-16
pkgs/by-name/sd/SDL_image/clang16-webp-errors.patch
··· 1 - diff -ur a/IMG_webp.c b/IMG_webp.c 2 - --- a/IMG_webp.c 2012-01-20 20:51:33.000000000 -0500 3 - +++ b/IMG_webp.c 2024-07-24 20:48:58.697398200 -0400 4 - @@ -47,9 +47,9 @@ 5 - static struct { 6 - int loaded; 7 - void *handle; 8 - - int/*VP8StatuCode*/ (*webp_get_features_internal) (const uint8_t *data, uint32_t data_size, WebPBitstreamFeatures* const features, int decoder_abi_version); 9 - - uint8_t* (*webp_decode_rgb_into) (const uint8_t* data, uint32_t data_size, uint8_t* output_buffer, int output_buffer_size, int output_stride); 10 - - uint8_t* (*webp_decode_rgba_into) (const uint8_t* data, uint32_t data_size, uint8_t* output_buffer, int output_buffer_size, int output_stride); 11 - + VP8StatusCode (*webp_get_features_internal) (const uint8_t *data, size_t data_size, WebPBitstreamFeatures* const features, int decoder_abi_version); 12 - + uint8_t* (*webp_decode_rgb_into) (const uint8_t* data, size_t data_size, uint8_t* output_buffer, size_t output_buffer_size, int output_stride); 13 - + uint8_t* (*webp_decode_rgba_into) (const uint8_t* data, size_t data_size, uint8_t* output_buffer, size_t output_buffer_size, int output_stride); 14 - } lib; 15 - 16 - #ifdef LOAD_WEBP_DYNAMIC
+14 -18
pkgs/by-name/sd/SDL_image/package.nix
··· 1 1 { 2 2 lib, 3 3 SDL, 4 - fetchpatch, 5 - fetchurl, 4 + fetchFromGitHub, 6 5 giflib, 7 6 libXpm, 8 7 libjpeg, ··· 11 10 libwebp, 12 11 pkg-config, 13 12 stdenv, 13 + unstableGitUpdater, 14 14 }: 15 15 16 16 stdenv.mkDerivation (finalAttrs: { 17 17 pname = "SDL_image"; 18 - version = "1.2.12"; 18 + version = "1.2.12-unstable-2025-02-13"; 19 19 20 - src = fetchurl { 21 - url = "https://www.libsdl.org/projects/SDL_image/release/SDL_image-${finalAttrs.version}.tar.gz"; 22 - hash = "sha256-C5ByKYRWEATehIR3RNVmgJ27na9zKp5QO5GhtahOVpk="; 20 + src = fetchFromGitHub { 21 + owner = "libsdl-org"; 22 + repo = "SDL_image"; 23 + rev = "74e8d577216e3c3a969e67b68b2e4769fcbf8fdd"; 24 + hash = "sha256-WSNH7Pw/tL5rgPQtOjxRGp2UlYSJJmXS2YQS+fAkXSc="; 23 25 }; 24 - 25 - patches = [ 26 - # Fixed security vulnerability in XCF image loader 27 - (fetchpatch { 28 - name = "CVE-2017-2887"; 29 - url = "https://github.com/libsdl-org/SDL_image/commit/e7723676825cd2b2ffef3316ec1879d7726618f2.patch"; 30 - includes = [ "IMG_xcf.c" ]; 31 - hash = "sha256-Z0nyEtE1LNGsGsN9SFG8ZyPDdunmvg81tUnEkrJQk5w="; 32 - }) 33 - # Fixes incompatible function pointer type errors with clang 16 34 - ./clang16-webp-errors.patch 35 - ]; 36 26 37 27 configureFlags = [ 38 28 # Disable dynamic loading or else dlopen will fail because of no proper ··· 69 59 ]; 70 60 71 61 strictDeps = true; 62 + 63 + passthru.updateScript = unstableGitUpdater { 64 + tagFormat = "release-1.*"; 65 + tagPrefix = "release-"; 66 + branch = "SDL-1.2"; 67 + }; 72 68 73 69 meta = { 74 70 homepage = "http://www.libsdl.org/projects/SDL_image/";
+9
pkgs/by-name/sd/SDL_mixer/package.nix
··· 10 10 pkg-config, 11 11 smpeg, 12 12 stdenv, 13 + # passthru.tests 14 + onscripter-en, 13 15 # Boolean flags 14 16 enableNativeMidi ? false, 15 17 enableSdltest ? (!stdenv.hostPlatform.isDarwin), ··· 20 22 pname = "SDL_mixer"; 21 23 version = "1.2.12"; 22 24 25 + # word of caution: while there is a somewhat maintained SDL-1.2 branch on 26 + # https://github.com/libsdl-org/SDL_mixer, it switches from smpeg to mpg123 which 27 + # breaks autoconf in a bunch of packages, it's better to cherry-pick patches as needed 23 28 src = fetchurl { 24 29 url = "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-${finalAttrs.version}.tar.gz"; 25 30 hash = "sha256-FkQwgnmpdXmQSeSCavLPx4fK0quxGqFFYuQCUh+GmSo="; ··· 101 106 ]; 102 107 103 108 strictDeps = true; 109 + 110 + passthru.tests = { 111 + inherit onscripter-en; 112 + }; 104 113 105 114 meta = { 106 115 description = "SDL multi-channel audio mixer library";
+14 -5
pkgs/by-name/sd/SDL_net/package.nix
··· 1 1 { 2 2 lib, 3 3 SDL, 4 - fetchurl, 4 + fetchFromGitHub, 5 5 pkg-config, 6 6 stdenv, 7 + unstableGitUpdater, 7 8 # Boolean flags 8 9 enableSdltest ? (!stdenv.hostPlatform.isDarwin), 9 10 }: 10 11 11 12 stdenv.mkDerivation (finalAttrs: { 12 13 pname = "SDL_net"; 13 - version = "1.2.8"; 14 + version = "1.2.8-unstable-2024-04-23"; 14 15 15 - src = fetchurl { 16 - url = "http://www.libsdl.org/projects/SDL_net/release/SDL_net-${finalAttrs.version}.tar.gz"; 17 - hash = "sha256-X0p6i7iE95PCeKw/NxO+QZgMXu3M7P8CYEETR3FPrLQ="; 16 + src = fetchFromGitHub { 17 + owner = "libsdl-org"; 18 + repo = "SDL_net"; 19 + rev = "0043be2e559f8d562d04bf62d6e3f4162ed8edad"; 20 + hash = "sha256-/W1Mq6hzJNNwpcx+VUT4DRGP3bE06GGMbYDGHBc4XlQ="; 18 21 }; 19 22 20 23 nativeBuildInputs = [ ··· 31 34 ]; 32 35 33 36 strictDeps = true; 37 + 38 + passthru.updateScript = unstableGitUpdater { 39 + tagFormat = "release-1.*"; 40 + tagPrefix = "release-"; 41 + branch = "SDL-1.2"; 42 + }; 34 43 35 44 meta = { 36 45 homepage = "https://github.com/libsdl-org/SDL_net";
+17 -18
pkgs/by-name/sd/SDL_ttf/package.nix
··· 1 1 { 2 2 lib, 3 3 SDL, 4 - fetchpatch, 5 - fetchurl, 4 + fetchFromGitHub, 6 5 freetype, 7 6 stdenv, 7 + unstableGitUpdater, 8 8 # Boolean flags 9 9 enableSdltest ? (!stdenv.hostPlatform.isDarwin), 10 10 }: 11 11 12 12 stdenv.mkDerivation (finalAttrs: { 13 13 pname = "SDL_ttf"; 14 - version = "2.0.11"; 14 + version = "2.0.11.1-unstable-2024-04-23"; 15 15 16 - src = fetchurl { 17 - url = "https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-${finalAttrs.version}.tar.gz"; 18 - hash = "sha256-ckzYlez02jGaPvFkiStyB4vZJjKl2BIREmHN4kjrzbc="; 16 + src = fetchFromGitHub { 17 + owner = "libsdl-org"; 18 + repo = "SDL_ttf"; 19 + rev = "3c4233732b94ce08d5f6a868e597af39e13f8b23"; 20 + hash = "sha256-FX6Ko4CaOSCSKdpWVsJhTZXlWk1cnjbfVfMDiGG2+TU="; 19 21 }; 20 22 21 - patches = [ 22 - # Bug #830: TTF_RenderGlyph_Shaded is broken 23 - (fetchpatch { 24 - url = "https://bugzilla-attachments.libsdl.org/attachments/830/renderglyph_shaded.patch.txt"; 25 - hash = "sha256-TZzlZe7gCRA8wZDHQZsqESAOGbLpJzIoB0HD8L6z3zE="; 26 - }) 27 - ]; 28 - 29 - patchFlags = [ "-p0" ]; 30 - 31 23 buildInputs = [ 32 24 SDL 33 25 freetype ··· 35 27 36 28 # pass in correct *-config for cross builds 37 29 env.SDL_CONFIG = lib.getExe' (lib.getDev SDL) "sdl-config"; 38 - env.FREETYPE_CONFIG = lib.getExe' freetype.dev "freetype-config"; 30 + env.FT2_CONFIG = lib.getExe' freetype.dev "freetype-config"; 39 31 40 32 configureFlags = [ 41 33 (lib.enableFeature enableSdltest "sdltest") ··· 43 35 44 36 strictDeps = true; 45 37 38 + passthru.updateScript = unstableGitUpdater { 39 + tagFormat = "release-2.0.11"; 40 + tagPrefix = "release-"; 41 + branch = "SDL-1.2"; 42 + }; 43 + 46 44 meta = { 47 45 homepage = "https://github.com/libsdl-org/SDL_ttf"; 48 46 description = "SDL TrueType library"; ··· 50 48 maintainers = lib.teams.sdl.members ++ (with lib.maintainers; [ ]); 51 49 inherit (SDL.meta) platforms; 52 50 knownVulnerabilities = [ 53 - "CVE-2022-27470" 51 + # CVE applies to SDL2 https://github.com/NixOS/nixpkgs/pull/274836#issuecomment-2708627901 52 + # "CVE-2022-27470" 54 53 ]; 55 54 }; 56 55 })
+1
pkgs/top-level/aliases.nix
··· 1393 1393 ### S ### 1394 1394 1395 1395 SDL_classic = SDL1; # Added 2024-09-03 1396 + SDL1 = throw "'SDL1' has been removed as development ended long ago with SDL 2.0 replacing it, use SDL_compat instead"; # Added 2025-03-27 1396 1397 SDL_gpu = throw "'SDL_gpu' has been removed due to lack of upstream maintenance and known users"; # Added 2025-03-15 1397 1398 s2n = throw "'s2n' has been renamed to/replaced by 's2n-tls'"; # Converted to throw 2024-10-17 1398 1399 sandboxfs = throw "'sandboxfs' has been removed due to being unmaintained, consider using linux namespaces for sandboxing instead"; # Added 2024-06-06