2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, SDL2, libpng, libjpeg, libtiff, giflib, libwebp, libXpm, zlib, Foundation
|
2024-01-13 08:15:51 +00:00
|
|
|
, version ? "2.8.2"
|
|
|
|
, hash ? "sha256-j0hrv7z4Rk3VjJ5dkzlKsCVc5otRxalmqRgkSCCnbdw="
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "SDL2_image";
|
2023-02-09 11:40:11 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.libsdl.org/projects/SDL_image/release/${pname}-${version}.tar.gz";
|
2023-02-09 11:40:11 +00:00
|
|
|
inherit hash;
|
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 ];
|
|
|
|
};
|
|
|
|
}
|