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
73 lines
1.6 KiB
Nix
73 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
SDL2,
|
|
autoreconfHook,
|
|
fetchurl,
|
|
libjpeg,
|
|
libpng,
|
|
libtiff,
|
|
libwebp,
|
|
pkg-config,
|
|
stdenv,
|
|
zlib,
|
|
# Boolean flags
|
|
enableSTB ? true,
|
|
## Darwin headless will hang when trying to run the SDL test program
|
|
enableSdltest ? (!stdenv.hostPlatform.isDarwin),
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "SDL2_image";
|
|
version = "2.8.8";
|
|
|
|
src = fetchurl {
|
|
url = "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${finalAttrs.version}.tar.gz";
|
|
hash = "sha256-IhO1b9r/IiDQ44yOQgy+GoPIc3QZDLqMcK8hVgl84wo=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
SDL2
|
|
autoreconfHook
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
SDL2
|
|
libtiff
|
|
libwebp
|
|
zlib
|
|
]
|
|
++ lib.optionals (!enableSTB) [
|
|
libjpeg
|
|
libpng
|
|
];
|
|
|
|
configureFlags = [
|
|
# Disable dynamically loaded dependencies
|
|
(lib.enableFeature false "jpg-shared")
|
|
(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 [
|
|
# Don't use native macOS frameworks
|
|
# Caution: do not set this as (!stdenv.hostPlatform.isDarwin) since it would be true
|
|
# outside Darwin - and ImageIO does not exist outside Darwin
|
|
(lib.enableFeature false "imageio")
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = {
|
|
description = "SDL image library";
|
|
homepage = "https://github.com/libsdl-org/SDL_image";
|
|
license = lib.licenses.zlib;
|
|
teams = [ lib.teams.sdl ];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|