nixpkgs-suyu/pkgs/development/libraries/freeimage/default.nix

50 lines
1.5 KiB
Nix
Raw Normal View History

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