1 { lib, stdenv, fetchsvn, darwin, libtiff
2 , libpng, zlib, libwebp, libraw, openexr, openjpeg
3 , libjpeg, jxrlib, pkg-config }:
7 version = "unstable-2020-07-04";
10 url = "svn://svn.code.sf.net/p/freeimage/svn/";
12 sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6";
14 sourceRoot = "svn-r1859/FreeImage/trunk";
16 # Ensure that the bundled libraries are not used at all
17 prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
18 patches = [ ./unbundle.diff ];
20 nativeBuildInputs = [ pkg-config ] ++ lib.optional stdenv.isDarwin darwin.cctools;
21 buildInputs = [ libtiff libtiff.dev_private libpng zlib libwebp libraw openexr openjpeg libjpeg libjpeg.dev_private jxrlib ];
23 postBuild = lib.optionalString (!stdenv.isDarwin) ''
27 INCDIR = "${placeholder "out"}/include";
28 INSTALLDIR = "${placeholder "out"}/lib";
31 mkdir -p $INCDIR $INSTALLDIR
34 postInstall = lib.optionalString (!stdenv.isDarwin) ''
35 make -f Makefile.fip install
36 '' + lib.optionalString stdenv.isDarwin ''
37 ln -s $out/lib/libfreeimage.3.dylib $out/lib/libfreeimage.dylib
40 enableParallelBuilding = true;
43 description = "Open Source library for accessing popular graphics image file formats";
44 homepage = "http://freeimage.sourceforge.net/";
46 maintainers = with lib.maintainers; [viric l-as];
47 platforms = with lib.platforms; unix;