2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchsvn, darwin, libtiff
|
|
|
|
, libpng, zlib, libwebp, libraw, openexr, openjpeg
|
|
|
|
, libjpeg, jxrlib, pkg-config }:
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "freeimage";
|
|
|
|
version = "unstable-2020-07-04";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
src = fetchsvn {
|
|
|
|
url = "svn://svn.code.sf.net/p/freeimage/svn/";
|
|
|
|
rev = "1859";
|
|
|
|
sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
sourceRoot = "svn-r1859/FreeImage/trunk";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# Ensure that the bundled libraries are not used at all
|
|
|
|
prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
|
|
|
|
patches = [ ./unbundle.diff ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ] ++ lib.optional stdenv.isDarwin darwin.cctools;
|
|
|
|
buildInputs = [ libtiff libtiff.dev_private libpng zlib libwebp libraw openexr openjpeg libjpeg libjpeg.dev_private jxrlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postBuild = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
make -f Makefile.fip
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
INCDIR = "${placeholder "out"}/include";
|
|
|
|
INSTALLDIR = "${placeholder "out"}/lib";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preInstall = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
mkdir -p $INCDIR $INSTALLDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
make -f Makefile.fip install
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
ln -s $out/lib/libfreeimage.3.dylib $out/lib/libfreeimage.dylib
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Open Source library for accessing popular graphics image file formats";
|
|
|
|
homepage = "http://freeimage.sourceforge.net/";
|
|
|
|
license = "GPL";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with lib.maintainers; [viric l-as];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with lib.platforms; unix;
|
|
|
|
};
|
|
|
|
}
|