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