nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl
2, pkg-config
3, SDL2, libpng, libjpeg, libtiff, giflib, libwebp, libXpm, zlib, Foundation
4, version ? "2.6.3"
5, hash ? "sha256-kxyb5b8dfI+um33BV4KLfu6HTiPH8ktEun7/a0g2MSw="
6}:
7
8let
9 pname = "SDL2_image";
10in
11
12stdenv.mkDerivation {
13 inherit pname version;
14
15 src = fetchurl {
16 url = "https://www.libsdl.org/projects/SDL_image/release/${pname}-${version}.tar.gz";
17 inherit hash;
18 };
19
20 nativeBuildInputs = [ pkg-config ];
21
22 buildInputs = [ SDL2 libpng libjpeg libtiff giflib libwebp libXpm zlib ]
23 ++ lib.optional stdenv.isDarwin Foundation;
24
25 configureFlags = [
26 # Disable dynamically loaded dependencies
27 "--disable-jpg-shared"
28 "--disable-png-shared"
29 "--disable-tif-shared"
30 "--disable-webp-shared"
31 ] ++ lib.optionals stdenv.isDarwin [
32 # Darwin headless will hang when trying to run the SDL test program
33 "--disable-sdltest"
34 # Don't use native macOS frameworks
35 "--disable-imageio"
36 ];
37
38 enableParallelBuilding = true;
39
40 meta = with lib; {
41 description = "SDL image library";
42 homepage = "http://www.libsdl.org/projects/SDL_image/";
43 platforms = platforms.unix;
44 license = licenses.zlib;
45 maintainers = with maintainers; [ cpages ];
46 };
47}