2021-01-10 16:18:38 +00:00
|
|
|
{ lib, stdenv, fetchsvn, darwin, libtiff
|
|
|
|
, libpng, zlib, libwebp, libraw, openexr, openjpeg
|
|
|
|
, libjpeg, jxrlib, pkg-config }:
|
2020-05-13 20:17:27 +01:00
|
|
|
|
2009-01-12 21:12:07 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-01-10 16:18:38 +00:00
|
|
|
pname = "freeimage";
|
|
|
|
version = "unstable-2020-07-04";
|
2017-01-21 13:43:22 +00:00
|
|
|
|
2021-01-10 16:18:38 +00:00
|
|
|
src = fetchsvn {
|
|
|
|
url = "svn://svn.code.sf.net/p/freeimage/svn/";
|
|
|
|
rev = "1859";
|
|
|
|
sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6";
|
2009-01-12 21:12:07 +00:00
|
|
|
};
|
2021-01-10 16:18:38 +00:00
|
|
|
sourceRoot = "svn-r1859/FreeImage/trunk";
|
2017-01-21 13:43:22 +00:00
|
|
|
|
2021-01-10 16:18:38 +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 ];
|
2015-01-23 15:08:05 +00:00
|
|
|
|
2019-09-08 15:46:03 +01:00
|
|
|
postBuild = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
make -f Makefile.fip
|
|
|
|
'';
|
|
|
|
|
2021-01-10 16:18:38 +00:00
|
|
|
INCDIR = "${placeholder "out"}/include";
|
|
|
|
INSTALLDIR = "${placeholder "out"}/lib";
|
|
|
|
|
2019-09-08 15:46:03 +01:00
|
|
|
preInstall = ''
|
2021-01-10 16:18:38 +00:00
|
|
|
mkdir -p $INCDIR $INSTALLDIR
|
2019-09-08 15:46:03 +01:00
|
|
|
'';
|
2009-01-12 21:12:07 +00:00
|
|
|
|
2019-09-08 15:46:03 +01:00
|
|
|
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
make -f Makefile.fip install
|
2021-01-10 16:18:38 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
ln -s $out/lib/libfreeimage.3.dylib $out/lib/libfreeimage.dylib
|
2019-09-08 15:46:03 +01:00
|
|
|
'';
|
2017-01-21 13:43:22 +00:00
|
|
|
|
2018-06-03 21:37:40 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-01-12 21:12:07 +00:00
|
|
|
meta = {
|
|
|
|
description = "Open Source library for accessing popular graphics image file formats";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://freeimage.sourceforge.net/";
|
2009-01-12 21:12:07 +00:00
|
|
|
license = "GPL";
|
2021-01-10 16:18:38 +00:00
|
|
|
maintainers = with lib.maintainers; [viric l-as];
|
2019-09-08 15:46:03 +01:00
|
|
|
platforms = with lib.platforms; unix;
|
2009-01-12 21:12:07 +00:00
|
|
|
};
|
|
|
|
}
|