diff options
author | Anthony Cowley <acowley@gmail.com> | 2016-11-02 21:16:12 -0400 |
---|---|---|
committer | Anthony Cowley <acowley@gmail.com> | 2016-11-03 12:18:14 -0400 |
commit | 7850a6b0ecc62470a0bc911d27928607604a5c6e (patch) | |
tree | 5f53bcb2567e36e74c9150c221f565bcf6dbcf52 /pkgs/development/libraries | |
parent | f7e2675ed509bdd4da45c9d8bd19c5976111b16d (diff) | |
download | nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar.gz nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar.bz2 nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar.lz nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar.xz nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.tar.zst nixlib-7850a6b0ecc62470a0bc911d27928607604a5c6e.zip |
freeimage: darwin compatibility
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/freeimage/default.nix | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/pkgs/development/libraries/freeimage/default.nix b/pkgs/development/libraries/freeimage/default.nix index 2a75f7693e15..42105c7022c2 100644 --- a/pkgs/development/libraries/freeimage/default.nix +++ b/pkgs/development/libraries/freeimage/default.nix @@ -1,31 +1,48 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, darwin}: stdenv.mkDerivation { name = "freeimage-3.17.0"; src = fetchurl { url = mirror://sourceforge/freeimage/FreeImage3170.zip; sha256 = "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"; }; - buildInputs = [ unzip ]; - prePatch = '' - sed -e s@/usr/@$out/@ \ + buildInputs = [ unzip ] ++ stdenv.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__/' \ + -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| 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 - - # Fix gcc 5.1 macro problems - # https://chromium.googlesource.com/webm/libwebp/+/eebaf97f5a1cb713d81d311308d8a48c124e5aef%5E!/ - sed -i -e 's/"\(#[^"]*\)"/" \1 "/g' Source/LibWebP/src/dsp/* + # 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 = "make -f Makefile.fip"; + postBuild = stdenv.lib.optionalString (!stdenv.isDarwin) "make -f Makefile.fip"; preInstall = "mkdir -p $out/include $out/lib"; - postInstall = "make -f Makefile.fip install"; + postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) "make -f Makefile.fip install"; meta = { 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; linux; + platforms = with stdenv.lib.platforms; unix; }; } |