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

This commit is contained in:
K900
2025-03-27 09:17:06 +03:00
committed by GitHub
9 changed files with 55 additions and 255 deletions
-26
View File
@@ -1,26 +0,0 @@
diff --git a/sdl-config.in b/sdl-config.in
index e0fcc0c..bf7928a 100644
--- a/sdl-config.in
+++ b/sdl-config.in
@@ -42,14 +42,18 @@ while test $# -gt 0; do
echo @SDL_VERSION@
;;
--cflags)
- echo -I@includedir@/SDL @SDL_CFLAGS@
+ SDL_CFLAGS=""
+ for i in @includedir@/SDL $SDL_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@
+@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ $SDL_LIB_PATH
@ENABLE_SHARED_TRUE@ ;;
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
-@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
+@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ $SDL_LIB_PATH
@ENABLE_STATIC_TRUE@ ;;
*)
echo "${usage}" 1>&2
-156
View File
@@ -1,156 +0,0 @@
{ lib
, alsa-lib
, audiofile
, config
, darwin
, fetchpatch
, fetchurl
, libGL
, libGLU
, libICE
, libXext
, libXrandr
, libcap
, libiconv
, libpulseaudio
, pkg-config
, stdenv
# Boolean flags
, alsaSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid
, libGLSupported ? lib.meta.availableOn stdenv.hostPlatform libGL
, openglSupport ? libGLSupported
, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid && lib.meta.availableOn stdenv.hostPlatform libpulseaudio
, x11Support ? !stdenv.hostPlatform.isCygwin && !stdenv.hostPlatform.isAndroid
}:
# NOTE: When editing this expression see if the same change applies to
# SDL2 expression too
let
inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa GLUT;
extraPropagatedBuildInputs = [ ]
++ lib.optionals x11Support [ libXext libICE libXrandr ]
++ lib.optionals (openglSupport && stdenv.hostPlatform.isLinux) [ libGL ]
# libGLU doesnt work with Android's SDL
++ lib.optionals (openglSupport && stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAndroid)) [ libGLU ]
++ lib.optionals (openglSupport && stdenv.hostPlatform.isDarwin) [ OpenGL GLUT ]
++ lib.optional alsaSupport alsa-lib
++ lib.optional pulseaudioSupport libpulseaudio
++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
in
stdenv.mkDerivation (finalAttrs: {
pname = "SDL";
version = "1.2.15";
src = fetchurl {
url = "https://www.libsdl.org/release/SDL-${finalAttrs.version}.tar.gz";
hash = "sha256-1tMWp5Pl40gVXw3ZO5eXmJM/uYqh7evMEIgp1kdKrQA=";
};
outputs = [ "out" "dev" ];
outputBin = "dev"; # sdl-config
nativeBuildInputs = [ pkg-config ]
++ lib.optional stdenv.hostPlatform.isLinux libcap;
propagatedBuildInputs = [ libiconv ] ++ extraPropagatedBuildInputs;
buildInputs =
[ ]
++ lib.optionals (!stdenv.hostPlatform.isMinGW && alsaSupport) [ audiofile ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
configureFlags = [
"--disable-oss"
"--disable-video-x11-xme"
"--enable-rpath"
# Building without this fails on Darwin with
#
# ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32'
# SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
#
# Please try revert the change that introduced this comment when updating SDL.
] ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-x11-shared"
++ lib.optional (!x11Support) "--without-x"
++ lib.optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib"
++ lib.optional stdenv.hostPlatform.isMusl "CFLAGS=-DICONV_INBUF_NONCONST";
patches = [
./find-headers.patch
# Fix window resizing issues, e.g. for xmonad
# Ticket: http://bugzilla.libsdl.org/show_bug.cgi?id=1430
(fetchpatch {
name = "fix_window_resizing.diff";
url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fix_window_resizing.diff;att=2;bug=665779";
hash = "sha256-hj3ykyOKeDh6uPDlvwNHSowQxmR+mfhvCnHvcdhXZfw=";
})
# Fix drops of keyboard events for SDL_EnableUNICODE
(fetchpatch {
url = "https://github.com/libsdl-org/SDL-1.2/commit/0332e2bb18dc68d6892c3b653b2547afe323854b.patch";
hash = "sha256-5V6K0oTN56RRi48XLPQsjgLzt0a6GsjajDrda3ZEhTw=";
})
# Ignore insane joystick axis events
(fetchpatch {
url = "https://github.com/libsdl-org/SDL-1.2/commit/ab99cc82b0a898ad528d46fa128b649a220a94f4.patch";
hash = "sha256-8CvKHvkmidm4tFCWYhxE059hN3gwOKz6nKs5rvQ4ZKw=";
})
# https://bugzilla.libsdl.org/show_bug.cgi?id=1769
(fetchpatch {
url = "https://github.com/libsdl-org/SDL-1.2/commit/5d79977ec7a6b58afa6e4817035aaaba186f7e9f.patch";
hash = "sha256-t+60bC4gLFbslXm1n9nimiFrho2DnxdWdKr4H9Yp/sw=";
})
# Workaround X11 bug to allow changing gamma
# Ticket: https://bugs.freedesktop.org/show_bug.cgi?id=27222
(fetchpatch {
name = "SDL_SetGamma.patch";
url = "https://src.fedoraproject.org/rpms/SDL/raw/7a07323e5cec08bea6f390526f86a1ce5341596d/f/SDL-1.2.15-x11-Bypass-SetGammaRamp-when-changing-gamma.patch";
hash = "sha256-m7ZQ5GnfGlMkKJkrBSB3GrLz8MT6njgI9jROJAbRonQ=";
})
# Fix a build failure on OS X Mavericks
# Ticket: https://bugzilla.libsdl.org/show_bug.cgi?id=2085
(fetchpatch {
url = "https://github.com/libsdl-org/SDL-1.2/commit/19039324be71738d8990e91b9ba341b2ea068445.patch";
hash = "sha256-DCWZo0LzHJoWUr/5vL5pKIEmmz3pvr4TO6Ip8WykfDI=";
})
(fetchpatch {
url = "https://github.com/libsdl-org/SDL-1.2/commit/7933032ad4d57c24f2230db29f67eb7d21bb5654.patch";
hash = "sha256-Knq+ceL6y/zKcfJayC2gy+DKnoa8DLslBNl3laMzwa8=";
})
(fetchpatch {
name = "CVE-2022-34568.patch";
url = "https://github.com/libsdl-org/SDL-1.2/commit/d7e00208738a0bc6af302723fe64908ac35b777b.patch";
hash = "sha256-fuxXsqZW94/C8CKu9LakppCU4zHupj66O2MngQ4BO9o=";
})
];
enableParallelBuilding = true;
postInstall = ''
moveToOutput share/aclocal "$dev"
'';
# See the same place in the expression for SDL2
postFixup = let
rpath = lib.makeLibraryPath extraPropagatedBuildInputs;
in ''
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;
passthru = { inherit openglSupport; };
meta = {
homepage = "http://www.libsdl.org/";
description = "Cross-platform multimedia library";
license = lib.licenses.lgpl21;
mainProgram = "sdl-config";
maintainers = lib.teams.sdl.members ++ (with lib.maintainers; [ lovek323 ]);
platforms = lib.platforms.unix;
};
})
-16
View File
@@ -1,16 +0,0 @@
addSDLPath () {
if [ -e "$1/include/SDL" ]; then
export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL"
# NB this doesnt work with split dev packages because different packages
# will contain "include/SDL/" and "lib/" directories.
#
# However the SDL_LIB_PATH is consumed by SDL itself and serves to locate
# libraries like SDL_mixer, SDL_image, etc which are not split-package
# so the check above will only trigger on them.
if [ -e "$1/lib" ]; then
export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib"
fi
fi
}
addEnvHooks "$hostOffset" addSDLPath
@@ -1,16 +0,0 @@
diff -ur a/IMG_webp.c b/IMG_webp.c
--- a/IMG_webp.c 2012-01-20 20:51:33.000000000 -0500
+++ b/IMG_webp.c 2024-07-24 20:48:58.697398200 -0400
@@ -47,9 +47,9 @@
static struct {
int loaded;
void *handle;
- int/*VP8StatuCode*/ (*webp_get_features_internal) (const uint8_t *data, uint32_t data_size, WebPBitstreamFeatures* const features, int decoder_abi_version);
- 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);
- 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);
+ VP8StatusCode (*webp_get_features_internal) (const uint8_t *data, size_t data_size, WebPBitstreamFeatures* const features, int decoder_abi_version);
+ 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);
+ 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);
} lib;
#ifdef LOAD_WEBP_DYNAMIC
+14 -18
View File
@@ -1,8 +1,7 @@
{
lib,
SDL,
fetchpatch,
fetchurl,
fetchFromGitHub,
giflib,
libXpm,
libjpeg,
@@ -11,29 +10,20 @@
libwebp,
pkg-config,
stdenv,
unstableGitUpdater,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "SDL_image";
version = "1.2.12";
version = "1.2.12-unstable-2025-02-13";
src = fetchurl {
url = "https://www.libsdl.org/projects/SDL_image/release/SDL_image-${finalAttrs.version}.tar.gz";
hash = "sha256-C5ByKYRWEATehIR3RNVmgJ27na9zKp5QO5GhtahOVpk=";
src = fetchFromGitHub {
owner = "libsdl-org";
repo = "SDL_image";
rev = "74e8d577216e3c3a969e67b68b2e4769fcbf8fdd";
hash = "sha256-WSNH7Pw/tL5rgPQtOjxRGp2UlYSJJmXS2YQS+fAkXSc=";
};
patches = [
# Fixed security vulnerability in XCF image loader
(fetchpatch {
name = "CVE-2017-2887";
url = "https://github.com/libsdl-org/SDL_image/commit/e7723676825cd2b2ffef3316ec1879d7726618f2.patch";
includes = [ "IMG_xcf.c" ];
hash = "sha256-Z0nyEtE1LNGsGsN9SFG8ZyPDdunmvg81tUnEkrJQk5w=";
})
# Fixes incompatible function pointer type errors with clang 16
./clang16-webp-errors.patch
];
configureFlags = [
# Disable dynamic loading or else dlopen will fail because of no proper
# rpath
@@ -70,6 +60,12 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
passthru.updateScript = unstableGitUpdater {
tagFormat = "release-1.*";
tagPrefix = "release-";
branch = "SDL-1.2";
};
meta = {
homepage = "http://www.libsdl.org/projects/SDL_image/";
description = "SDL image library";
+9
View File
@@ -10,6 +10,8 @@
pkg-config,
smpeg,
stdenv,
# passthru.tests
onscripter-en,
# Boolean flags
enableNativeMidi ? false,
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
@@ -20,6 +22,9 @@ stdenv.mkDerivation (finalAttrs: {
pname = "SDL_mixer";
version = "1.2.12";
# word of caution: while there is a somewhat maintained SDL-1.2 branch on
# https://github.com/libsdl-org/SDL_mixer, it switches from smpeg to mpg123 which
# breaks autoconf in a bunch of packages, it's better to cherry-pick patches as needed
src = fetchurl {
url = "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-${finalAttrs.version}.tar.gz";
hash = "sha256-FkQwgnmpdXmQSeSCavLPx4fK0quxGqFFYuQCUh+GmSo=";
@@ -102,6 +107,10 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
passthru.tests = {
inherit onscripter-en;
};
meta = {
description = "SDL multi-channel audio mixer library";
homepage = "http://www.libsdl.org/projects/SDL_mixer/";
+14 -5
View File
@@ -1,20 +1,23 @@
{
lib,
SDL,
fetchurl,
fetchFromGitHub,
pkg-config,
stdenv,
unstableGitUpdater,
# Boolean flags
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
}:
stdenv.mkDerivation (finalAttrs: {
pname = "SDL_net";
version = "1.2.8";
version = "1.2.8-unstable-2024-04-23";
src = fetchurl {
url = "http://www.libsdl.org/projects/SDL_net/release/SDL_net-${finalAttrs.version}.tar.gz";
hash = "sha256-X0p6i7iE95PCeKw/NxO+QZgMXu3M7P8CYEETR3FPrLQ=";
src = fetchFromGitHub {
owner = "libsdl-org";
repo = "SDL_net";
rev = "0043be2e559f8d562d04bf62d6e3f4162ed8edad";
hash = "sha256-/W1Mq6hzJNNwpcx+VUT4DRGP3bE06GGMbYDGHBc4XlQ=";
};
nativeBuildInputs = [
@@ -32,6 +35,12 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
passthru.updateScript = unstableGitUpdater {
tagFormat = "release-1.*";
tagPrefix = "release-";
branch = "SDL-1.2";
};
meta = {
homepage = "https://github.com/libsdl-org/SDL_net";
description = "SDL networking library";
+17 -18
View File
@@ -1,33 +1,25 @@
{
lib,
SDL,
fetchpatch,
fetchurl,
fetchFromGitHub,
freetype,
stdenv,
unstableGitUpdater,
# Boolean flags
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
}:
stdenv.mkDerivation (finalAttrs: {
pname = "SDL_ttf";
version = "2.0.11";
version = "2.0.11.1-unstable-2024-04-23";
src = fetchurl {
url = "https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-${finalAttrs.version}.tar.gz";
hash = "sha256-ckzYlez02jGaPvFkiStyB4vZJjKl2BIREmHN4kjrzbc=";
src = fetchFromGitHub {
owner = "libsdl-org";
repo = "SDL_ttf";
rev = "3c4233732b94ce08d5f6a868e597af39e13f8b23";
hash = "sha256-FX6Ko4CaOSCSKdpWVsJhTZXlWk1cnjbfVfMDiGG2+TU=";
};
patches = [
# Bug #830: TTF_RenderGlyph_Shaded is broken
(fetchpatch {
url = "https://bugzilla-attachments.libsdl.org/attachments/830/renderglyph_shaded.patch.txt";
hash = "sha256-TZzlZe7gCRA8wZDHQZsqESAOGbLpJzIoB0HD8L6z3zE=";
})
];
patchFlags = [ "-p0" ];
buildInputs = [
SDL
freetype
@@ -35,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
# pass in correct *-config for cross builds
env.SDL_CONFIG = lib.getExe' (lib.getDev SDL) "sdl-config";
env.FREETYPE_CONFIG = lib.getExe' freetype.dev "freetype-config";
env.FT2_CONFIG = lib.getExe' freetype.dev "freetype-config";
configureFlags = [
(lib.enableFeature enableSdltest "sdltest")
@@ -43,6 +35,12 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
passthru.updateScript = unstableGitUpdater {
tagFormat = "release-2.0.11";
tagPrefix = "release-";
branch = "SDL-1.2";
};
meta = {
homepage = "https://github.com/libsdl-org/SDL_ttf";
description = "SDL TrueType library";
@@ -50,7 +48,8 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = lib.teams.sdl.members ++ (with lib.maintainers; [ ]);
inherit (SDL.meta) platforms;
knownVulnerabilities = [
"CVE-2022-27470"
# CVE applies to SDL2 https://github.com/NixOS/nixpkgs/pull/274836#issuecomment-2708627901
# "CVE-2022-27470"
];
};
})
+1
View File
@@ -1393,6 +1393,7 @@ mapAliases {
### S ###
SDL_classic = SDL1; # Added 2024-09-03
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
SDL_gpu = throw "'SDL_gpu' has been removed due to lack of upstream maintenance and known users"; # Added 2025-03-15
s2n = throw "'s2n' has been renamed to/replaced by 's2n-tls'"; # Converted to throw 2024-10-17
sandboxfs = throw "'sandboxfs' has been removed due to being unmaintained, consider using linux namespaces for sandboxing instead"; # Added 2024-06-06