SDL2_image: add option to build without STB backend

This commit is contained in:
Marcin Serwin
2025-04-20 17:21:07 +02:00
parent e98c99a4f5
commit 3e2fd0eb8a
+16 -10
View File
@@ -14,6 +14,7 @@
stdenv,
zlib,
# Boolean flags
enableSTB ? true,
## Darwin headless will hang when trying to run the SDL test program
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
}:
@@ -36,16 +37,20 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
];
buildInputs = [
SDL2
giflib
libXpm
libjpeg
libpng
libtiff
libwebp
zlib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];
buildInputs =
[
SDL2
giflib
libXpm
libtiff
libwebp
zlib
]
++ lib.optionals (!enableSTB) [
libjpeg
libpng
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];
configureFlags =
[
@@ -54,6 +59,7 @@ stdenv.mkDerivation (finalAttrs: {
(lib.enableFeature false "png-shared")
(lib.enableFeature false "tif-shared")
(lib.enableFeature false "webp-shared")
(lib.enableFeature enableSTB "stb-image")
(lib.enableFeature enableSdltest "sdltest")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [