diff --git a/pkgs/development/libraries/libjpeg/builder.sh b/pkgs/development/libraries/libjpeg/builder.sh index f166dc66e26b..1b006f4e0c0d 100644 --- a/pkgs/development/libraries/libjpeg/builder.sh +++ b/pkgs/development/libraries/libjpeg/builder.sh @@ -2,6 +2,15 @@ source $stdenv/setup configureFlags="--enable-shared" +preConfigure=preConfigure +preConfigure() { + # Workarounds for the ancient libtool shipped by libjpeg. + ln -s $libtool/bin/libtool . + cp $libtool/share/libtool/config.guess . + cp $libtool/share/libtool/config.sub . +} + +preInstall=preInstall preInstall() { mkdir $out mkdir $out/bin @@ -10,6 +19,12 @@ preInstall() { mkdir $out/man mkdir $out/man/man1 } -preInstall=preInstall + +patchPhase=patchPhase +patchPhase() { + for i in $patches; do + patch < $i + done +} genericBuild \ No newline at end of file diff --git a/pkgs/development/libraries/libjpeg/default.nix b/pkgs/development/libraries/libjpeg/default.nix index 64256e3f1923..94ade3160a4d 100644 --- a/pkgs/development/libraries/libjpeg/default.nix +++ b/pkgs/development/libraries/libjpeg/default.nix @@ -1,8 +1,23 @@ -{stdenv, fetchurl}: stdenv.mkDerivation { +{stdenv, fetchurl, libtool}: + +stdenv.mkDerivation { name = "libjpeg-6b"; builder = ./builder.sh; src = fetchurl { url = http://nix.cs.uu.nl/dist/tarballs/jpegsrc.v6b.tar.gz; md5 = "dbd5f3b47ed13132f04c685d608a7547"; }; + inherit libtool; + + # Required for building of dynamic libraries on Darwin. + patches = [ + (fetchurl { + url = http://darwinports.org/darwinports/dports/graphics/jpeg/files/patch-ltconfig; + md5 = "e6725fa4a09aa1de4ca75343fd0f61d5"; + }) + (fetchurl { + url = http://darwinports.org/darwinports/dports/graphics/jpeg/files/patch-ltmain.sh; + md5 = "489986ad8e7a93aef036766b25f321d5"; + }) + ]; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f34b414a8f47..0899648c124f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1113,7 +1113,7 @@ rec { }; libjpeg = (import ../development/libraries/libjpeg) { - inherit fetchurl stdenv; + inherit fetchurl stdenv libtool; }; libtiff = (import ../development/libraries/libtiff) {