linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / freeimage / default.nix
blob5714131416d6b3c7389eb7da27a7f040655c8f4e
1 { lib, stdenv, fetchsvn, darwin, libtiff
2 , libpng, zlib, libwebp, libraw, openexr, openjpeg
3 , libjpeg, jxrlib, pkg-config }:
5 stdenv.mkDerivation {
6   pname = "freeimage";
7   version = "unstable-2020-07-04";
9   src = fetchsvn {
10     url = "svn://svn.code.sf.net/p/freeimage/svn/";
11     rev = "1859";
12     sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6";
13   };
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) ''
24     make -f Makefile.fip
25   '';
27   INCDIR = "${placeholder "out"}/include";
28   INSTALLDIR = "${placeholder "out"}/lib";
30   preInstall = ''
31     mkdir -p $INCDIR $INSTALLDIR
32   '';
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
38   '';
40   enableParallelBuilding = true;
42   meta = {
43     description = "Open Source library for accessing popular graphics image file formats";
44     homepage = "http://freeimage.sourceforge.net/";
45     license = "GPL";
46     maintainers = with lib.maintainers; [viric l-as];
47     platforms = with lib.platforms; unix;
48   };