about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/freeimage
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-09-11 15:24:55 +0000
committerAlyssa Ross <hi@alyssa.is>2019-09-16 22:14:45 +0000
commit89c4dccbd5f33f71808d4b1baafe619696af1162 (patch)
treefb1b8d3a2f171164a05d404ab2340cfb1a9d3e21 /nixpkgs/pkgs/development/libraries/freeimage
parent8920a0e4d962a919238bab69ddc607d7f3396f70 (diff)
parente19054ab3cd5b7cc9a01d0efc71c8fe310541065 (diff)
downloadnixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar.gz
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar.bz2
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar.lz
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar.xz
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.tar.zst
nixlib-89c4dccbd5f33f71808d4b1baafe619696af1162.zip
Merge commit 'e19054ab3cd5b7cc9a01d0efc71c8fe310541065'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/freeimage')
-rw-r--r--nixpkgs/pkgs/development/libraries/freeimage/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/freeimage/dylib.patch16
2 files changed, 40 insertions, 43 deletions
diff --git a/nixpkgs/pkgs/development/libraries/freeimage/default.nix b/nixpkgs/pkgs/development/libraries/freeimage/default.nix
index b2c66ad346d0..188543bf7bf7 100644
--- a/nixpkgs/pkgs/development/libraries/freeimage/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freeimage/default.nix
@@ -1,65 +1,46 @@
-{ stdenv, fetchurl, unzip, darwin }:
+{ lib, stdenv, fetchurl, unzip, darwin }:
 
 stdenv.mkDerivation {
-  name = "freeimage-3.17.0";
+  name = "freeimage-3.18.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/freeimage/FreeImage3170.zip;
-    sha256 = "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v";
+    url = mirror://sourceforge/freeimage/FreeImage3180.zip;
+    sha256 = "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl";
   };
 
-  patches = let
-    patchURL = https://anonscm.debian.org/cgit/debian-science/packages/freeimage.git/plain/debian/patches;
-  in [
-    (fetchurl {
-      url = patchURL + "/Fix-CVE-2015-0852.patch";
-      sha256 = "1vxdck4i5qi5j6i3cjja0gfy79mmbf0lq2qdrnqdsl4kclbvw2c8";
-    })
-    (fetchurl {
-      url = patchURL + "/Fix-CVE-2016-5684.patch";
-      sha256 = "14ffgqbnwg28r6sjvm3z89zbnnm9ghbc81hdhrzxlyk3vwvd6cw3";
-    })
-    (fetchurl {
-      url = https://raw.githubusercontent.com/buildroot/buildroot/2018.05/package/libfreeimage/0005-Manage-powf64-with-glibc.patch;
-      sha256 = "1lis479ad5cfkhqm044nk4x97wfwm3hry3bvij1w5xkndnlfppc2";
-    })
-  ];
+  patches = lib.optional stdenv.isDarwin ./dylib.patch;
 
-  buildInputs = [ unzip ] ++ stdenv.lib.optional stdenv.isDarwin darwin.cctools;
+  buildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin darwin.cctools;
 
-  prePatch = if stdenv.isDarwin
-             then ''
-    sed -e 's/gcc-4.0/clang/g' \
-        -e 's/g++-4.0/clang++/g' \
-        -e 's/COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden -DNO_LCMS/COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden -DNO_LCMS -D__ANSI__/' \
+  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 /Developer/SDKs/MacOSX10.5.sdk||g' \
-        -e 's|-Wl,-syslibroot /Developer/SDKs/MacOSX10.6.sdk||g' \
-        -e 's|-isysroot /Developer/SDKs/MacOSX10.6.sdk||g' \
-        -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||g' \
-        -e 's| $(STATICLIB)-ppc $(STATICLIB)-i386||g' \
-        -e 's| $(SHAREDLIB)-ppc $(SHAREDLIB)-i386||g' \
+        -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 ''
+  '' else ''
     sed -e s@/usr/@$out/@ \
         -e 's@-o root -g root@@' \
         -e 's@ldconfig@echo not running ldconfig@' \
         -i Makefile.gnu Makefile.fip
-    # Fix gcc 5.1 macro problems
-    # https://chromium.googlesource.com/webm/libwebp/+/eebaf97f5a1cb713d81d311308d8a48c124e5aef%5E!/
-    sed -i -e 's/"\(#[^"]*\)"/" \1 "/g' Source/LibWebP/src/dsp/*
   '';
 
-  postBuild = stdenv.lib.optionalString (!stdenv.isDarwin) "make -f Makefile.fip";
-  preInstall = "mkdir -p $out/include $out/lib";
-  postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) "make -f Makefile.fip install";
+  postBuild = lib.optionalString (!stdenv.isDarwin) ''
+    make -f Makefile.fip
+  '';
+
+  preInstall = ''
+    mkdir -p $out/include $out/lib
+  '';
 
-  NIX_CFLAGS_COMPILE = "-Wno-narrowing";
+  postInstall = lib.optionalString (!stdenv.isDarwin) ''
+    make -f Makefile.fip install
+  '';
 
   enableParallelBuilding = true;
 
@@ -67,7 +48,7 @@ stdenv.mkDerivation {
     description = "Open Source library for accessing popular graphics image file formats";
     homepage = http://freeimage.sourceforge.net/;
     license = "GPL";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/freeimage/dylib.patch b/nixpkgs/pkgs/development/libraries/freeimage/dylib.patch
new file mode 100644
index 000000000000..0d8188aca707
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freeimage/dylib.patch
@@ -0,0 +1,16 @@
+--- a/Makefile.osx
++++ b/Makefile.osx
+@@ -60,1 +60,1 @@
+-FreeImage: $(STATICLIB)
++FreeImage: $(STATICLIB) $(SHAREDLIB)
+@@ -87,7 +87,7 @@
+-$(SHAREDLIB): $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64
+-	$(LIPO) -create $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64 -output $(SHAREDLIB)
++#$(SHAREDLIB): $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64
++#	$(LIPO) -create $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64 -output $(SHAREDLIB)
+ 
+ $(SHAREDLIB)-i386: $(MODULES_I386)
+ 	$(CPP_I386) -arch i386 -dynamiclib $(LIBRARIES_I386) -o $@ $(MODULES_I386)
+ 
+-$(SHAREDLIB)-x86_64: $(MODULES_X86_64)
++$(SHAREDLIB): $(MODULES_X86_64)