diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-02-16 18:32:21 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-02-16 18:32:21 +0000 |
commit | 9becdcc5df71b47a5da84ad670e9a7eae9e0c65a (patch) | |
tree | 2ddf0335eb393f89501e3753b50c3f7ab0552d12 /nixpkgs/pkgs/development/libraries/freeimage/default.nix | |
parent | 49f2a77ac9abc88c253f68952eda26557fc3b555 (diff) | |
parent | ff96a0fa5635770390b184ae74debea75c3fd534 (diff) | |
download | nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.gz nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.bz2 nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.lz nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.xz nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.zst nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.zip |
nixpkgs: merge nixos-unstable
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/freeimage/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/freeimage/default.nix | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/nixpkgs/pkgs/development/libraries/freeimage/default.nix b/nixpkgs/pkgs/development/libraries/freeimage/default.nix index c31f858850c9..5714131416d6 100644 --- a/nixpkgs/pkgs/development/libraries/freeimage/default.nix +++ b/nixpkgs/pkgs/development/libraries/freeimage/default.nix @@ -1,48 +1,40 @@ -{ lib, stdenv, fetchurl, unzip, darwin }: - -# TODO: consider unvendoring various dependencies (libpng, libjpeg, -# libwebp, zlib, ...) +{ lib, stdenv, fetchsvn, darwin, libtiff +, libpng, zlib, libwebp, libraw, openexr, openjpeg +, libjpeg, jxrlib, pkg-config }: stdenv.mkDerivation { - name = "freeimage-3.18.0"; + pname = "freeimage"; + version = "unstable-2020-07-04"; - src = fetchurl { - url = "mirror://sourceforge/freeimage/FreeImage3180.zip"; - sha256 = "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"; + src = fetchsvn { + url = "svn://svn.code.sf.net/p/freeimage/svn/"; + rev = "1859"; + sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6"; }; + sourceRoot = "svn-r1859/FreeImage/trunk"; - patches = lib.optional stdenv.isDarwin ./dylib.patch; - - buildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin darwin.cctools; - - prePatch = if stdenv.isDarwin then '' - sed -e 's/$(shell xcrun -find clang)/clang/g' \ - -e 's/$(shell xcrun -find clang++)/clang++/g' \ - -e "s|PREFIX = /usr/local|PREFIX = $out|" \ - -e 's|-Wl,-syslibroot $(MACOSX_SYSROOT)||g' \ - -e 's|-isysroot $(MACOSX_SYSROOT)||g' \ - -e 's| install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)||' \ - -e 's| -m 644 -o root -g wheel||g' \ - -i ./Makefile.osx - # Fix LibJXR performance timers - sed 's|^SRCS = \(.*\)$|SRCS = \1 Source/LibJXR/image/sys/perfTimerANSI.c|' -i ./Makefile.srcs - '' else '' - sed -e s@/usr/@$out/@ \ - -e 's@-o root -g root@@' \ - -e 's@ldconfig@echo not running ldconfig@' \ - -i Makefile.gnu Makefile.fip - ''; + # 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 ]; postBuild = lib.optionalString (!stdenv.isDarwin) '' make -f Makefile.fip ''; + INCDIR = "${placeholder "out"}/include"; + INSTALLDIR = "${placeholder "out"}/lib"; + preInstall = '' - mkdir -p $out/include $out/lib + mkdir -p $INCDIR $INSTALLDIR ''; 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 ''; enableParallelBuilding = true; @@ -51,9 +43,7 @@ stdenv.mkDerivation { description = "Open Source library for accessing popular graphics image file formats"; homepage = "http://freeimage.sourceforge.net/"; license = "GPL"; - maintainers = with lib.maintainers; [viric]; + maintainers = with lib.maintainers; [viric l-as]; platforms = with lib.platforms; unix; - # see https://github.com/NixOS/nixpkgs/issues/77653 - broken = stdenv.isAarch64; }; } |