2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, SDL2, libpng, libjpeg, libtiff, giflib, libwebp, libXpm, zlib, Foundation
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "SDL2_image";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-25 14:12:00 +00:00
|
|
|
url = "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${finalAttrs.version}.tar.gz";
|
|
|
|
hash = "sha256-j0hrv7z4Rk3VjJ5dkzlKsCVc5otRxalmqRgkSCCnbdw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ SDL2 libpng libjpeg libtiff giflib libwebp libXpm zlib ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Foundation;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
configureFlags = [
|
|
|
|
# Disable dynamically loaded dependencies
|
|
|
|
"--disable-jpg-shared"
|
|
|
|
"--disable-png-shared"
|
|
|
|
"--disable-tif-shared"
|
|
|
|
"--disable-webp-shared"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# Darwin headless will hang when trying to run the SDL test program
|
|
|
|
"--disable-sdltest"
|
|
|
|
# Don't use native macOS frameworks
|
|
|
|
"--disable-imageio"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "SDL image library";
|
|
|
|
homepage = "http://www.libsdl.org/projects/SDL_image/";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.zlib;
|
|
|
|
maintainers = with maintainers; [ cpages ];
|
|
|
|
};
|
2024-01-25 14:12:00 +00:00
|
|
|
})
|