push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
diff --git a/sdl-config.in b/sdl-config.in
index ce332b3..359d574 100755
--- a/sdl-config.in
+++ b/sdl-config.in
@@ -50,14 +50,18 @@ while test $# -gt 0; do
echo @PROJECT_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_LIBS@ @SDL_STATIC_LIBS@
+@ENABLE_STATIC_TRUE@ echo -L${libdir} @SDL_LIBS@ @SDL_STATIC_LIBS@ $SDL_LIB_PATH
@ENABLE_STATIC_TRUE@ ;;
*)
echo "${usage}" 1>&2

View File

@@ -0,0 +1,123 @@
{
lib,
sdl2-compat,
cmake,
darwin,
fetchFromGitHub,
libGLU,
libiconv,
libX11,
mesa,
pkg-config,
pkg-config-unwrapped,
stdenv,
testers,
dosbox,
SDL_image,
SDL_ttf,
SDL_mixer,
SDL_sound,
# Boolean flags
libGLSupported ? lib.elem stdenv.hostPlatform.system mesa.meta.platforms,
openglSupport ? libGLSupported,
}:
let
inherit (darwin) autoSignDarwinBinariesHook;
in
stdenv.mkDerivation (finalAttrs: {
pname = "SDL_compat";
version = "1.2.68";
src = fetchFromGitHub {
owner = "libsdl-org";
repo = "sdl12-compat";
rev = "release-" + finalAttrs.version;
hash = "sha256-f2dl3L7/qoYNl4sjik1npcW/W09zsEumiV9jHuKnUmM=";
};
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
autoSignDarwinBinariesHook
];
# re-export PKG_CHECK_MODULES m4 macro used by sdl.m4
propagatedNativeBuildInputs = [ pkg-config-unwrapped ];
buildInputs = [
libX11
sdl2-compat
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
]
++ lib.optionals openglSupport [ libGLU ];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail 'set(CMAKE_SKIP_RPATH TRUE)' 'set(CMAKE_SKIP_RPATH FALSE)'
'';
dontPatchELF = true; # don't strip rpath
cmakeFlags =
let
rpath = lib.makeLibraryPath [ sdl2-compat ];
in
[
(lib.cmakeFeature "CMAKE_INSTALL_RPATH" rpath)
(lib.cmakeFeature "CMAKE_BUILD_RPATH" rpath)
(lib.cmakeBool "SDL12TESTS" finalAttrs.finalPackage.doCheck)
];
enableParallelBuilding = true;
# Darwin fails with "Critical error: required built-in appearance SystemAppearance not found"
doCheck = !stdenv.hostPlatform.isDarwin;
checkPhase = ''
runHook preCheck
./testver
runHook postCheck
'';
postInstall = ''
# allow as a drop in replacement for SDL
# Can be removed after treewide switch from pkg-config to pkgconf
ln -s $out/lib/pkgconfig/sdl12_compat.pc $out/lib/pkgconfig/sdl.pc
'';
# The setup hook scans paths of buildInputs to find SDL related packages and
# adds their include and library paths to environment variables. The sdl-config
# is patched to use these variables to produce correct flags for compiler.
patches = [ ./find-headers.patch ];
setupHook = ./setup-hook.sh;
passthru.tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
inherit
SDL_image
SDL_ttf
SDL_mixer
SDL_sound
dosbox
;
};
meta = {
homepage = "https://www.libsdl.org/";
description = "Cross-platform multimedia library - build SDL 1.2 applications against 2.0";
license = lib.licenses.zlib;
mainProgram = "sdl-config";
maintainers = with lib.maintainers; [ peterhoeg ];
teams = [ lib.teams.sdl ];
platforms = lib.platforms.all;
pkgConfigModules = [
"sdl"
"sdl12_compat"
];
};
})

View File

@@ -0,0 +1,16 @@
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