From cf42601f92c400b81c0db4b0c932075290811cc7 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Wed, 20 Feb 2013 09:18:26 +0000 Subject: [PATCH 01/23] Coreutils update and Illumos compatibility fixes. - GNU Coreutils 8.21 - Add is64Bit checks to stdenv for Solaris. - Fix OpenSSL Illumos build. --- pkgs/development/libraries/openssl/default.nix | 4 +++- pkgs/stdenv/generic/default.nix | 6 ++++-- pkgs/tools/misc/coreutils/default.nix | 12 ++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 640b99df547..55beb8bbc53 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -53,7 +53,9 @@ stdenv.mkDerivation { # On x86_64-darwin, "./config" misdetects the system as # "darwin-i386-cc". So specify the system type explicitly. configureScript = - if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc" else "./config"; + if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc" + else if stdenv.system == "x86_64-solaris" then "./Configure solaris64-x86_64-gcc" + else "./config"; configureFlags = "shared --libdir=lib --openssldir=etc/ssl" + stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"; diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 6f5e5d34582..843bf580b6a 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -114,11 +114,13 @@ let isx86_64 = result.system == "x86_64-linux" || result.system == "x86_64-darwin" || result.system == "x86_64-freebsd" - || result.system == "x86_64-openbsd"; + || result.system == "x86_64-openbsd" + || result.system == "x86_64-solaris"; is64bit = result.system == "x86_64-linux" || result.system == "x86_64-darwin" || result.system == "x86_64-freebsd" - || result.system == "x86_64-openbsd"; + || result.system == "x86_64-openbsd" + || result.system == "x86_64-solaris"; isMips = result.system == "mips-linux" || result.system == "mips64el-linux"; isArm = result.system == "armv5tel-linux" diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 9fd1d86ff82..733c4218d83 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -6,12 +6,12 @@ assert aclSupport -> acl != null; assert selinuxSupport -> libselinux != null && libsepol != null; -stdenv.mkDerivation rec { - name = "coreutils-8.20"; +stdenv.mkDerivation (rec { + name = "coreutils-8.21"; src = fetchurl { url = "mirror://gnu/coreutils/${name}.tar.xz"; - sha256 = "1cly97xdy3v4nbbx631k43smqw0nnpn651kkprs0yyl2cj3pkjyv"; + sha256 = "064f512185iysqqcvhnhaf3bfmzrvcgs7n405qsyp99zmfyl9amd"; }; nativeBuildInputs = [ perl ]; @@ -67,4 +67,8 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.ludo ]; }; } - + # May have some issues with root compilation because the bootstrap tool + # cannot be used as a login shell for now. +// stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux" || stdenv.isSunOS) { + FORCE_UNSAFE_CONFIGURE = 1; +}) From bcaea92a1217f6adb79bdb400f2bfffef97955ed Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Wed, 20 Feb 2013 09:20:07 +0000 Subject: [PATCH 02/23] Attempt at getting GCC 4.7 compiled on Illumos... No success yet :-( --- .../development/compilers/gcc/4.7/default.nix | 19 ++++++++++++++----- pkgs/development/libraries/cloog/default.nix | 4 ++-- .../development/libraries/gettext/default.nix | 2 ++ pkgs/development/libraries/isl/default.nix | 4 ++-- pkgs/development/libraries/mpc/default.nix | 4 ++-- pkgs/development/libraries/mpfr/default.nix | 6 +++--- pkgs/development/libraries/ppl/default.nix | 8 +++++--- pkgs/stdenv/default.nix | 1 + pkgs/stdenv/native/default.nix | 1 + pkgs/tools/archivers/cpio/default.nix | 4 ++-- pkgs/tools/misc/coreutils/default.nix | 1 + pkgs/top-level/all-packages.nix | 4 ++-- 12 files changed, 37 insertions(+), 21 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix index 62a86751a71..6e8e5d86cc5 100644 --- a/pkgs/development/compilers/gcc/4.7/default.nix +++ b/pkgs/development/compilers/gcc/4.7/default.nix @@ -279,19 +279,25 @@ stdenv.mkDerivation ({ configureFlagsArray = stdenv.lib.optionals (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic) - [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ]; + [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ]; # 'iant' at #go-nuts@freenode, gccgo maintainer, said that # they have a bug in 4.7.1 if adding "--disable-static" dontDisableStatic = langGo; configureFlags = " + ${if stdenv.isSunOS then + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + + # On Illumos/Solaris GNU as is preferred + " --with-gnu-as --with-gnu-ld " + else ""} + --enable-lto ${if enableMultilib then "" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else ""} - ${if ppl != null then "--with-ppl=${ppl}" else ""} + ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} + ${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""} ${if cloog != null then - "--with-cloog=${cloog} --enable-cloog-backend=isl" + "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" else ""} ${if langJava then "--with-ecj-jar=${javaEcj} " + @@ -406,7 +412,9 @@ stdenv.mkDerivation ({ # Needed for the cross compilation to work AR = "ar"; LD = "ld"; - CC = "gcc"; + # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" + else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find # the library headers and binaries, regarless of the language being @@ -496,6 +504,7 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } + # Strip kills static libs of other archs (hence cross != null) // optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; } ) diff --git a/pkgs/development/libraries/cloog/default.nix b/pkgs/development/libraries/cloog/default.nix index ab5737b20ed..c3878ef4b78 100644 --- a/pkgs/development/libraries/cloog/default.nix +++ b/pkgs/development/libraries/cloog/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, gmp, isl }: stdenv.mkDerivation rec { - name = "cloog-0.16.3"; + name = "cloog-0.18.0"; src = fetchurl { url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${name}.tar.gz"; - sha256 = "0lzbsszfzsr0jfwkccfbsvx913d2yc45dqwa472plmxkhbwykmc9"; + sha256 = "1c4aa8dde7886be9cbe0f9069c334843b21028f61d344a2d685f88cb1dcf2228"; }; buildInputs = [ gmp ]; diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 5468c9f2336..113093a8067 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation (rec { patches = [ ./no-gets.patch ]; + LDFLAGS = if stdenv.isSunOS then "-lsec -lavl" else ""; + configureFlags = [ "--disable-csharp" ] ++ (stdenv.lib.optionals stdenv.isCygwin [ # We have a static libiconv, so we can only build the static lib. diff --git a/pkgs/development/libraries/isl/default.nix b/pkgs/development/libraries/isl/default.nix index aaec37eae8f..9097df78de3 100644 --- a/pkgs/development/libraries/isl/default.nix +++ b/pkgs/development/libraries/isl/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchurl, gmp }: stdenv.mkDerivation rec { - name = "isl-0.07"; # CLooG 0.16.3 fails to build with ISL 0.08. + name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08. src = fetchurl { urls = [ "http://www.kotnet.org/~skimo/isl/${name}.tar.bz2" "ftp://ftp.linux.student.kuleuven.be/pub/people/skimo/isl/${name}.tar.bz2" ]; - sha256 = "0kpxmvhrwwdygqqafqzjf9xiksq7paac2x24g9jhr3f9ajj3zkyx"; + sha256 = "095f4b54c88ca13a80d2b025d9c551f89ea7ba6f6201d701960bfe5c1466a98d"; }; buildInputs = [ gmp ]; diff --git a/pkgs/development/libraries/mpc/default.nix b/pkgs/development/libraries/mpc/default.nix index 3824e3d3755..586658556db 100644 --- a/pkgs/development/libraries/mpc/default.nix +++ b/pkgs/development/libraries/mpc/default.nix @@ -1,11 +1,11 @@ { fetchurl, stdenv, gmp, mpfr }: stdenv.mkDerivation rec { - name = "mpc-0.9"; + name = "mpc-1.0.1"; src = fetchurl { url = "http://www.multiprecision.org/mpc/download/${name}.tar.gz"; - sha1 = "229722d553030734d49731844abfef7617b64f1a"; + sha256 = "ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff"; }; buildInputs = [ gmp mpfr ]; diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index faa2e1b1a71..802fd93f8cf 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, gmp}: stdenv.mkDerivation (rec { - name = "mpfr-3.1.0"; + name = "mpfr-3.1.1"; src = fetchurl { url = "mirror://gnu/mpfr/${name}.tar.bz2"; - sha256 = "105nx8qqx5x8f4rlplr2wk4cyv61iw5j3jgi2k21rpb8s6xbp9vl"; + sha256 = "1zfmmk4p26b67qpmh787p3dfxa71yd9mi02c4q45yf687pqw6rkv"; }; buildInputs = [ gmp ]; @@ -39,7 +39,7 @@ stdenv.mkDerivation (rec { // -(stdenv.lib.optionalAttrs stdenv.isFreeBSD { +(stdenv.lib.optionalAttrs (stdenv.isSunOS or stdenv.isFreeBSD) { /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite: http://hydra.bordeaux.inria.fr/build/34862 diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix index b24b4e06cb9..0e1948b2fd0 100644 --- a/pkgs/development/libraries/ppl/default.nix +++ b/pkgs/development/libraries/ppl/default.nix @@ -1,13 +1,13 @@ { fetchurl, stdenv, gmpxx, perl, gnum4 }: -let version = "0.11.2"; in +let version = "1.0"; in stdenv.mkDerivation rec { name = "ppl-${version}"; src = fetchurl { url = "http://bugseng.com/products/ppl/download/ftp/releases/${version}/ppl-${version}.tar.bz2"; - sha256 = "1sxviip4yk6gp453pid5scy1ba66dzdpr02i1416yk7lkv0x3yz3"; + sha256 = "c169e962b8a0f7b7bcde5c5e0e2235248f1d78b155dfad684591d1a57e330b54"; }; nativeBuildInputs = [ perl gnum4 ]; @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { configureFlags = "--disable-watchdog"; + patches = [ ./upstream-based.patch ]; + # Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz # x86_64 box. Nevertheless, being a dependency of GCC, it probably ought # to be tested. @@ -40,7 +42,7 @@ stdenv.mkDerivation rec { version of the simplex algorithm. ''; - homepage = http://www.cs.unipr.it/ppl/; + homepage = http://bugseng.com/products/ppl/; license = "GPLv3+"; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index ca90b46192e..a2723f5575c 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -62,5 +62,6 @@ rec { if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if stdenvType == "i686-mingw" then stdenvMinGW else if stdenvType == "x86_64-darwin" then stdenvNix else + if stdenvType == "x86_64-solaris" then stdenvNix else stdenvNative; } diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 524b2a53337..f303e47fd5d 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -9,6 +9,7 @@ rec { path = (if system == "i686-solaris" then [ "/usr/gnu" ] else []) ++ (if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++ + (if system == "x86_64-solaris" then [ "/opt/local/gnu" ] else []) ++ ["/" "/usr" "/usr/local"]; prehookBase = '' diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix index 1700f03d7bd..525a64f9b82 100644 --- a/pkgs/tools/archivers/cpio/default.nix +++ b/pkgs/tools/archivers/cpio/default.nix @@ -4,8 +4,8 @@ stdenv.mkDerivation { name = "cpio-2.9"; src = fetchurl { - url = mirror://gnu/cpio/cpio-2.9.tar.bz2; - sha256 = "01s7f9hg8kgpis96j99hgkiqgdy53pm7qi7bhm3fzx58jfk5z6mv"; + url = mirror://gnu/cpio/cpio-2.11.tar.bz2; + sha256 = "bb820bfd96e74fc6ce43104f06fe733178517e7f5d1cdee553773e8eff7d5bbd"; }; patches = [ diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 733c4218d83..69892cbfd73 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -49,6 +49,7 @@ stdenv.mkDerivation (rec { enableParallelBuilding = true; + LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lmp -lmd -lnsl -lsocket -lresolv"; NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol"; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d9d534c412..22436952061 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1938,7 +1938,7 @@ let gambit = callPackage ../development/compilers/gambit { }; - gcc = gcc46; + gcc = gcc47; gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 { inherit fetchurl stdenv noSysDirs; @@ -3761,7 +3761,7 @@ let # The GHC bootstrap binaries link against libgmp.so.3, which is in GMP 4.x. gmp4 = callPackage ../development/libraries/gmp/4.3.2.nix { }; - gmp5 = callPackage ../development/libraries/gmp/5.0.5.nix { }; + gmp5 = callPackage ../development/libraries/gmp/5.1.1.nix { }; gmp51 = callPackage ../development/libraries/gmp/5.1.1.nix { }; From 15e865ac09c93093c9cada2f247b14dba084c71a Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Sat, 23 Feb 2013 13:59:59 +0000 Subject: [PATCH 03/23] GCC 4.7.2 + updated libraries compiles on Illumos/SmartOS! - Add solaris native ld support to GCC build wrapper - Add solaris ld wrapper that fixes -L argument order --- pkgs/build-support/gcc-wrapper/builder.sh | 21 +++++++++- pkgs/build-support/gcc-wrapper/default.nix | 1 + .../gcc-wrapper/ld-solaris-wrapper.sh | 40 ++++++++++++++++++ pkgs/development/compilers/gcc/4.7/builder.sh | 5 ++- .../development/compilers/gcc/4.7/default.nix | 25 ++++++++--- .../development/libraries/gettext/default.nix | 2 +- pkgs/development/libraries/mpfr/default.nix | 24 +++++------ .../libraries/ppl/upstream-based.patch | 42 +++++++++++++++++++ pkgs/stdenv/nix/default.nix | 1 + pkgs/tools/misc/coreutils/default.nix | 4 +- 10 files changed, 141 insertions(+), 24 deletions(-) create mode 100644 pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh create mode 100644 pkgs/development/libraries/ppl/upstream-based.patch diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index ed7ad0a50b7..e7c3400e9f7 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -66,13 +66,23 @@ else echo "$gccCFlags" > $out/nix-support/gcc-cflags gccPath="$gcc/bin" - ldPath="$binutils/bin" + # On Illumos/Solaris we might prefer native ld + if test -n "$nativePrefix"; then + ldPath="$nativePrefix/bin" + else + ldPath="$binutils/bin" + fi; fi doSubstitute() { local src=$1 local dst=$2 + local ld="$ldPath/ld" + if $ld -V 2>&1 |grep Solaris; then + # Use Solaris specific linker wrapper + ld="$out/bin/ld-solaris" + fi # Can't use substitute() here, because replace may not have been # built yet (in the bootstrap). sed \ @@ -85,7 +95,7 @@ doSubstitute() { -e "s^@binutils@^$binutils^g" \ -e "s^@coreutils@^$coreutils^g" \ -e "s^@libc@^$libc^g" \ - -e "s^@ld@^$ldPath/ld^g" \ + -e "s^@ld@^$ld^g" \ < "$src" > "$dst" } @@ -174,6 +184,13 @@ ln -s $ldPath/as $out/bin/as doSubstitute "$ldWrapper" "$out/bin/ld" chmod +x "$out/bin/ld" +# Copy solaris ld wrapper if needed +if $ldPath/ld -V 2>&1 |grep Solaris; then + # Use Solaris specific linker wrapper + sed -e "s^@ld@^$ldPath/ld^g" < "$ldSolarisWrapper" > "$out/bin/ld-solaris" + chmod +x "$out/bin/ld-solaris" +fi + # Emit a setup hook. Also store the path to the original GCC and # Glibc. diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index 87617621e64..aa4f6a3944e 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -36,6 +36,7 @@ stdenv.mkDerivation { gnatWrapper = ./gnat-wrapper.sh; gnatlinkWrapper = ./gnatlink-wrapper.sh; ldWrapper = ./ld-wrapper.sh; + ldSolarisWrapper = ./ld-solaris-wrapper.sh; utils = ./utils.sh; addFlags = ./add-flags; diff --git a/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh b/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh new file mode 100644 index 00000000000..5a7b92b5ad7 --- /dev/null +++ b/pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e +set -u + +# I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( +# Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 +# but still no success. +cmd="@ld@ -z ignore" + +args=("$@"); + +# This loop makes sure all -L arguments are before -l arguments, or ld may complain it cannot find a library. +# GNU binutils does not have this problem: +# http://stackoverflow.com/questions/5817269/does-the-order-of-l-and-l-options-in-the-gnu-linker-matter +i=0; +while [[ $i -lt $# ]]; do + case "${args[$i]}" in + -L) cmd="$cmd ${args[$i]} ${args[($i+1)]}"; i=($i+1); ;; + -L*) cmd="$cmd ${args[$i]}" ;; + *) ;; + esac + i=($i+1); +done + +i=0; +while [[ $i -lt $# ]]; do + case "${args[$i]}" in + -L) i=($i+1); ;; + -L*) ;; + *) cmd="$cmd ${args[$i]}" ;; + esac + i=($i+1); +done + +# Trace: +set -x +exec $cmd + +exit 0 diff --git a/pkgs/development/compilers/gcc/4.7/builder.sh b/pkgs/development/compilers/gcc/4.7/builder.sh index 37400fba5bf..dc6fdd93561 100644 --- a/pkgs/development/compilers/gcc/4.7/builder.sh +++ b/pkgs/development/compilers/gcc/4.7/builder.sh @@ -155,7 +155,7 @@ if test -n "$targetConfig"; then dontStrip=1 fi - +providedPreConfigure="$preConfigure"; preConfigure() { if test -n "$newlibSrc"; then tar xvf "$newlibSrc" -C .. @@ -188,6 +188,9 @@ preConfigure() { configureFlags="$configureFlags --with-build-sysroot=`pwd`/.." fi + # Eval the preConfigure script from nix expression. + eval $providedPreConfigure; + env; # Perform the build in a different directory. mkdir ../build cd ../build diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix index 6e8e5d86cc5..d97f8aaf5c6 100644 --- a/pkgs/development/compilers/gcc/4.7/default.nix +++ b/pkgs/development/compilers/gcc/4.7/default.nix @@ -277,19 +277,34 @@ stdenv.mkDerivation ({ ++ (optional stdenv.isDarwin gnused) ; - configureFlagsArray = stdenv.lib.optionals - (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic) - [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ]; + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; + + preConfigure = '' + configureFlagsArray=( + ${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic) + "'--with-host-libstdcxx=-lstdc++ -lgcc_s'"} + ${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS) + "\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\" + \"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""} + ); + ${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) + '' + export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g` + export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET" + export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" + export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" + ''} + ''; # 'iant' at #go-nuts@freenode, gccgo maintainer, said that # they have a bug in 4.7.1 if adding "--disable-static" - dontDisableStatic = langGo; + dontDisableStatic = langGo || staticCompiler; configureFlags = " ${if stdenv.isSunOS then " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + # On Illumos/Solaris GNU as is preferred - " --with-gnu-as --with-gnu-ld " + " --with-gnu-as --without-gnu-ld " else ""} --enable-lto ${if enableMultilib then "" else "--disable-multilib"} diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 113093a8067..e88308bb2e9 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation (rec { patches = [ ./no-gets.patch ]; - LDFLAGS = if stdenv.isSunOS then "-lsec -lavl" else ""; + LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else ""; configureFlags = [ "--disable-csharp" ] ++ (stdenv.lib.optionals stdenv.isCygwin diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index 802fd93f8cf..6fbb6253ee5 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, gmp}: -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "mpfr-3.1.1"; src = fetchurl { @@ -35,16 +35,14 @@ stdenv.mkDerivation (rec { maintainers = [ stdenv.lib.maintainers.ludo ]; platforms = stdenv.lib.platforms.all; }; + + configureFlags = + /* Work around a FreeBSD bug that otherwise leads to segfaults in + the test suite: + http://hydra.bordeaux.inria.fr/build/34862 + http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html + http://www.freebsd.org/cgi/query-pr.cgi?pr=161344 + */ + stdenv.lib.optional (stdenv.isSunOS or stdenv.isFreeBSD) "--disable-thread-safe" ++ + stdenv.lib.optional stdenv.is64bit "--with-pic"; } - -// - -(stdenv.lib.optionalAttrs (stdenv.isSunOS or stdenv.isFreeBSD) { - /* Work around a FreeBSD bug that otherwise leads to segfaults in - the test suite: - http://hydra.bordeaux.inria.fr/build/34862 - http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html - http://www.freebsd.org/cgi/query-pr.cgi?pr=161344 - */ - configureFlags = [ "--disable-thread-safe" ]; - })) diff --git a/pkgs/development/libraries/ppl/upstream-based.patch b/pkgs/development/libraries/ppl/upstream-based.patch new file mode 100644 index 00000000000..551050f67bf --- /dev/null +++ b/pkgs/development/libraries/ppl/upstream-based.patch @@ -0,0 +1,42 @@ +https://bugs.gentoo.org/show_bug.cgi?id=447928 +--- ppl-1.0/src/p_std_bits.cc.org 2012-12-30 00:37:03.033948083 +0100 ++++ ppl-1.0/src/mp_std_bits.cc 2012-12-30 00:44:12.893019313 +0100 +@@ -25,6 +25,9 @@ + #include "ppl-config.h" + #include "mp_std_bits.defs.hh" + ++#if __GNU_MP_VERSION < 5 \ ++ || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1) ++ + const bool std::numeric_limits::is_specialized; + const int std::numeric_limits::digits; + const int std::numeric_limits::digits10; +@@ -70,3 +73,6 @@ + const bool std::numeric_limits::traps; + const bool std::numeric_limits::tininess_before; + const std::float_round_style std::numeric_limits::round_style; ++ ++#endif // __GNU_MP_VERSION < 5 ++ // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1) +--- ppl-1.0/src/mp_std_bits.defs.hh.org 2012-12-30 00:37:03.037948187 +0100 ++++ ppl-1.0/src/mp_std_bits.defs.hh 2012-12-30 00:42:32.002424189 +0100 +@@ -38,6 +38,9 @@ + #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) + void swap(mpq_class& x, mpq_class& y); + ++#if __GNU_MP_VERSION < 5 \ ++ || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1) ++ + namespace std { + + #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +@@ -164,6 +167,9 @@ + + } // namespace std + ++#endif // __GNU_MP_VERSION < 5 ++ // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1) ++ + #include "mp_std_bits.inlines.hh" + + #endif // !defined(PPL_mp_std_bits_defs_hh) diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index d0f7d60f101..b16c51f7580 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -23,6 +23,7 @@ import ../generic rec { gcc = import ../../build-support/gcc-wrapper { nativeTools = false; + nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; nativeLibc = true; inherit stdenv; binutils = diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 69892cbfd73..1ed3fc928f0 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -49,8 +49,8 @@ stdenv.mkDerivation (rec { enableParallelBuilding = true; - LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lmp -lmd -lnsl -lsocket -lresolv"; - NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol"; + NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol" + + stdenv.lib.optionalString stdenv.isSunOS "-lmp -lmd -lnsl -lsocket -lresolv -luutil -lnvpair -lidmap -lavl -lsec"; meta = { homepage = http://www.gnu.org/software/coreutils/; From 867ea1f8fe74e50be63ecc0ade7d5cfe685e47a3 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 09:06:20 +0000 Subject: [PATCH 04/23] Update to PCRE 8.32 with JIT enabled --- pkgs/development/libraries/pcre/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index e59c249348a..69ed4c85313 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }: stdenv.mkDerivation rec { - name = "pcre-8.31"; + name = "pcre-8.32"; src = fetchurl { url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2"; - sha256 = "5778a02535473c7ee7838ea598c19f451e63cf5eec0bf0307a688301c9078c3c"; + sha256 = "a913fb9bd058ef380a2d91847c3c23fcf98e92dc3b47cd08a53c021c5cde0f55"; }; # The compiler on Darwin crashes with an internal error while building the @@ -13,6 +13,7 @@ stdenv.mkDerivation rec { # problem. In case we ever update the Darwin GCC version, the exception for # that platform ought to be removed. configureFlags = '' + --enable-jit ${if unicodeSupport then "--enable-unicode-properties" else ""} ${if !cplusplusSupport then "--disable-cpp" else ""} '' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0"; From c019cdb7615ebc89e5a84e5b1fb873139b356b42 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 09:08:00 +0000 Subject: [PATCH 05/23] Update CPIO to 2.11 --- pkgs/tools/archivers/cpio/default.nix | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix index 525a64f9b82..919484fa915 100644 --- a/pkgs/tools/archivers/cpio/default.nix +++ b/pkgs/tools/archivers/cpio/default.nix @@ -1,22 +1,13 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "cpio-2.9"; + name = "cpio-2.11"; src = fetchurl { url = mirror://gnu/cpio/cpio-2.11.tar.bz2; sha256 = "bb820bfd96e74fc6ce43104f06fe733178517e7f5d1cdee553773e8eff7d5bbd"; }; - patches = [ - # Make it compile on GCC 4.3. - (fetchurl { - name = "cpio-2.9-gnu-inline.patch"; - url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/app-arch/cpio/files/cpio-2.9-gnu-inline.patch?rev=1.1"; - sha256 = "1167hrq64h9lh3qhgasm2rivfzkkgx6fik92b017qfa0q61ff8c3"; - }) - ]; - meta = { homepage = http://www.gnu.org/software/cpio/; description = "A program to create or extract from cpio archives"; From fcce211c8ee3e65344b7af52a97f2f2bfceca41e Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 09:19:11 +0000 Subject: [PATCH 06/23] Fix GZip build on Illumos --- pkgs/tools/compression/gzip/default.nix | 4 ++++ .../compression/gzip/skip-some-tests.patch | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/tools/compression/gzip/skip-some-tests.patch diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index d15b26f48b6..c1e86b5d2f6 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -8,6 +8,10 @@ stdenv.mkDerivation rec { sha256 = "0wx1nqk709kx75cwp2axachnbxryp4gyl06qxn5nl95184w0mhls"; }; + doCheck = true; + + patches = [ ./skip-some-tests.patch ]; + meta = { homepage = http://www.gnu.org/software/gzip/; description = "Gzip, the GNU zip compression program"; diff --git a/pkgs/tools/compression/gzip/skip-some-tests.patch b/pkgs/tools/compression/gzip/skip-some-tests.patch new file mode 100644 index 00000000000..ebcda684ef7 --- /dev/null +++ b/pkgs/tools/compression/gzip/skip-some-tests.patch @@ -0,0 +1,21 @@ +Skip tests requiring Perl and less (more). +Also zgrep-signal skipping fails with weird Bad file number error on illumos. +--- gzip-1.5/tests/Makefile.in.orig 2013-02-23 15:15:08.017048868 +0000 ++++ gzip-1.5/tests/Makefile.in 2013-02-23 15:15:32.756197039 +0000 +@@ -1421,7 +1421,6 @@ + trailing-nul \ + zdiff \ + zgrep-f \ +- zgrep-signal \ + znew-k + + EXTRA_DIST = \ +@@ -1441,8 +1440,6 @@ + zfgrep \ + zforce \ + zgrep \ +- zless \ +- zmore \ + znew + + TESTS_ENVIRONMENT = \ From 82240c899adc77ac6cdddf9f1dafc4eedcf60cd4 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 09:23:16 +0000 Subject: [PATCH 07/23] Fix GMP build on Illumos. - Use smaller xz sources instead of bz2 sources. --- pkgs/development/libraries/gmp/5.1.1.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gmp/5.1.1.nix b/pkgs/development/libraries/gmp/5.1.1.nix index 0261f833962..d9c67274f25 100644 --- a/pkgs/development/libraries/gmp/5.1.1.nix +++ b/pkgs/development/libraries/gmp/5.1.1.nix @@ -4,8 +4,8 @@ stdenv.mkDerivation rec { name = "gmp-5.1.1"; src = fetchurl { - urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ]; - sha256 = "1bdgf04k2i12pfivxgjq68iarz3ngix9hpzbmkgijrdk92gpgm50"; + urls = [ "mirror://gnu/gmp/${name}.tar.xz" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.xz" ]; + sha256 = "1hili06lcf0clg5qfvz7knm6pmj6ab54yhsvskp1mdny5xw4vmjb"; }; nativeBuildInputs = [ m4 ]; @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { # (x86), except on Solaris where some tests crash with "Memory fault". # See , for instance. (stdenv.lib.optional (!stdenv.isSunOS) "--enable-fat") - ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]); + ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]) + ++ (if stdenv.is64bit then [ "--with-pic" ] else []); doCheck = true; From c041dbb1d2ca5d52dd837564a4b73d48c52175a7 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Wed, 27 Feb 2013 18:15:57 +0100 Subject: [PATCH 08/23] Fix libxslt build on Illumos. --- .../development/libraries/libxslt/default.nix | 6 +- .../libraries/libxslt/patch-ah.patch | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/libxslt/patch-ah.patch diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix index d3b7769754e..56acc841c60 100644 --- a/pkgs/development/libraries/libxslt/default.nix +++ b/pkgs/development/libraries/libxslt/default.nix @@ -1,15 +1,17 @@ { stdenv, fetchurl, libxml2 }: stdenv.mkDerivation rec { - name = "libxslt-1.1.27"; + name = "libxslt-1.1.28"; src = fetchurl { url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz"; - sha256 = "09ky3vhlaahvsb0q9gp6h3as53pfj70gincirachjqzj46jdka5n"; + sha256 = "5fc7151a57b89c03d7b825df5a0fae0a8d5f05674c0e7cf2937ecec4d54a028c"; }; buildInputs = [ libxml2 ]; + patches = stdenv.lib.optionals stdenv.isSunOS [ ./patch-ah.patch ]; + postInstall = '' mkdir -p $out/nix-support ln -s ${libxml2}/nix-support/setup-hook $out/nix-support/ diff --git a/pkgs/development/libraries/libxslt/patch-ah.patch b/pkgs/development/libraries/libxslt/patch-ah.patch new file mode 100644 index 00000000000..ea75b01178e --- /dev/null +++ b/pkgs/development/libraries/libxslt/patch-ah.patch @@ -0,0 +1,69 @@ +$NetBSD: patch-ah,v 1.3 2012/11/27 12:17:51 adam Exp $ + +Fix syms file for stricter solaris ld + +--- libxslt-1.1.28/libxslt/libxslt.syms.orig 2012-11-27 12:04:43.000000000 +0000 ++++ libxslt-1.1.28/libxslt/libxslt.syms +@@ -107,7 +107,7 @@ LIBXML2_1.0.11 { + xsltFreeCompMatchList; + xsltFreeTemplateHashes; + xsltGetTemplate; +- xsltMatchPattern; ++# xsltMatchPattern; + xsltTestCompMatchList; + + # preproc +@@ -407,7 +407,7 @@ LIBXML2_1.1.18 { + global: + + # xsltInternals +- xsltConstNamespaceNameXSLT; # variable ++# xsltConstNamespaceNameXSLT; # variable + xsltExtensionInstructionResultFinalize; + xsltExtensionInstructionResultRegister; + xsltInitCtxtKey; +@@ -416,24 +416,24 @@ LIBXML2_1.1.18 { + xsltInit; + + # xsltInternals +- xsltParseAnyXSLTElem; +- xsltParseSequenceConstructor; +- xsltPointerListAddSize; +- xsltPointerListClear; +- xsltPointerListCreate; +- xsltPointerListFree; ++# xsltParseAnyXSLTElem; ++# xsltParseSequenceConstructor; ++# xsltPointerListAddSize; ++# xsltPointerListClear; ++# xsltPointerListCreate; ++# xsltPointerListFree; + xsltRegisterLocalRVT; + xsltReleaseRVT; +- xsltRestoreDocumentNamespaces; ++# xsltRestoreDocumentNamespaces; + + # extensions +- xsltStyleStylesheetLevelGetExtData; ++# xsltStyleStylesheetLevelGetExtData; + + # xsltInternals + # xsltTransStorageAdd; removed in 1.1.28 + # xsltTransStorageRemove; removed in 1.1.28 + xsltUninit; +- xsltXSLTAttrMarker; # variable ++# xsltXSLTAttrMarker; # variable + } LIBXML2_1.1.9; + + LIBXML2_1.1.20 { +@@ -476,6 +476,10 @@ LIBXML2_1.1.26 { + + # transform + xsltProcessOneNode; ++ ++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local") ++ local: ++ *; + } LIBXML2_1.1.25; + + LIBXML2_1.1.27 { From 8ae2a89cabb83428d5217ac8623b70935317c1b1 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 12:03:23 +0000 Subject: [PATCH 09/23] Update glib and dbus - and make them compile on Illumos. --- pkgs/development/libraries/dbus/default.nix | 4 ++-- pkgs/development/libraries/glib/2.34.x.nix | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index 5716ac6648a..fa06a5269d3 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }: let - version = "1.6.4"; + version = "1.6.8"; src = fetchurl { url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz"; - sha256 = "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz"; + sha256 = "fc1370ef38abeeb13f55c905ec002e60705fb0bfde3b8d21c8d6eb8056c11bac"; }; patches = [ ./ignore-missing-includedirs.patch ]; diff --git a/pkgs/development/libraries/glib/2.34.x.nix b/pkgs/development/libraries/glib/2.34.x.nix index 69ed44aecca..e11e3bcb317 100644 --- a/pkgs/development/libraries/glib/2.34.x.nix +++ b/pkgs/development/libraries/glib/2.34.x.nix @@ -12,11 +12,11 @@ # $out/bin/gtester-report' to postInstall if this is solved stdenv.mkDerivation (rec { - name = "glib-2.34.0"; + name = "glib-2.34.3"; src = fetchurl { url = "mirror://gnome/sources/glib/2.34/${name}.tar.xz"; - sha256 = "f69b112f8848be35139d9099b62bc81649241f78f6a775516f0d4c9b47f65144"; + sha256 = "855fcbf87cb93065b488358e351774d8a39177281023bae58c286f41612658a7"; }; # configure script looks for d-bus but it is only needed for tests @@ -26,7 +26,11 @@ stdenv.mkDerivation (rec { propagatedBuildInputs = [ pcre zlib libffi ]; - configureFlags = "--with-pcre=system --disable-fam"; + configureFlags = "--with-pcre=system --disable-fam" + + (stdenv.lib.optionalString (libiconvOrNull != null) " --with-libiconv=gnu") + + (stdenv.lib.optionalString stdenv.isSunOS " --disable-modular-tests"); + + CPPFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-DBSD_COMP"; enableParallelBuilding = true; From 029864b08dd6b57d0cab1ecb35b2a78673ab192c Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Tue, 26 Feb 2013 12:05:27 +0000 Subject: [PATCH 10/23] Update disnix. --- pkgs/tools/package-management/disnix/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/disnix/default.nix b/pkgs/tools/package-management/disnix/default.nix index 9c17b9b78f7..42e55b35fc0 100644 --- a/pkgs/tools/package-management/disnix/default.nix +++ b/pkgs/tools/package-management/disnix/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, dbus_glib, libxml2, libxslt, getopt, nixUnstable, gettext, libiconv }: stdenv.mkDerivation { - name = "disnix-0.3pre32254"; + name = "disnix-0.3pre34664"; src = fetchurl { - url = http://hydra.nixos.org/build/2368541/download/4/disnix-0.3pre32254.tar.gz; - sha256 = "1jznx4mb6vwpzzpbk4c16j73hjgng7v1nraq8yya7f7m1s2gyhcw"; + url = http://hydra.nixos.org/build/4072223/download/4/disnix-0.3pre34664.tar.gz; + sha256 = "4e20a73c17061428ea66abd6004aaaa71b273ac88fca8e569a2262ae1f246c52"; }; buildInputs = [ pkgconfig dbus_glib libxml2 libxslt getopt nixUnstable ] From a611683b44f8fe53950f21bd9a813281e07754e5 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 13:37:32 +0000 Subject: [PATCH 11/23] Illumos: Fix dbus group policy checking only looking at user's primary group. D-Bus simply gives up when getgrouplist is not available. Added a dirty patch with getgrouplist.c from OpenBSD: https://github.com/duosecurity/duo_unix/blob/master/compat/getgrouplist.c --- pkgs/development/libraries/dbus/default.nix | 4 +- .../dbus/implement-getgrouplist.patch | 108 ++++++++++++++++++ 2 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/dbus/implement-getgrouplist.patch diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index fa06a5269d3..7510801cd79 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -8,9 +8,9 @@ let sha256 = "fc1370ef38abeeb13f55c905ec002e60705fb0bfde3b8d21c8d6eb8056c11bac"; }; - patches = [ ./ignore-missing-includedirs.patch ]; + patches = [ ./ignore-missing-includedirs.patch ./implement-getgrouplist.patch ]; - configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp"; + configureFlags = "--enable-embedded-tests --localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp"; in rec { diff --git a/pkgs/development/libraries/dbus/implement-getgrouplist.patch b/pkgs/development/libraries/dbus/implement-getgrouplist.patch new file mode 100644 index 00000000000..e3a4a25cb72 --- /dev/null +++ b/pkgs/development/libraries/dbus/implement-getgrouplist.patch @@ -0,0 +1,108 @@ +Compatibility patch for Illumos/Solaris and possibly other platforms. +Implements getgrouplist when not provided by OS. +Without it, only the user's primary group is used in authentication! +--- 1970-01-01 00:00:00.000000000 +0000 ++++ dbus-1.6.8/dbus/getgrouplist.c 2013-02-28 13:10:51.081792722 +0000 +@@ -0,0 +1,89 @@ ++/* $OpenBSD: getgrouplist.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */ ++/* ++ * Copyright (c) 1991, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */ ++ ++/* ++ * get credential ++ */ ++#include ++#include ++#include ++#include ++ ++int ++getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) ++{ ++ struct group *grp; ++ int i, ngroups; ++ int ret, maxgroups; ++ int bail; ++ ++ ret = 0; ++ ngroups = 0; ++ maxgroups = *grpcnt; ++ ++ /* ++ * install primary group ++ */ ++ if (ngroups >= maxgroups) { ++ *grpcnt = ngroups; ++ return (-1); ++ } ++ groups[ngroups++] = agroup; ++ ++ /* ++ * Scan the group file to find additional groups. ++ */ ++ setgrent(); ++ while ((grp = getgrent())) { ++ if (grp->gr_gid == agroup) ++ continue; ++ for (bail = 0, i = 0; bail == 0 && i < ngroups; i++) ++ if (groups[i] == grp->gr_gid) ++ bail = 1; ++ if (bail) ++ continue; ++ for (i = 0; grp->gr_mem[i]; i++) { ++ if (!strcmp(grp->gr_mem[i], uname)) { ++ if (ngroups >= maxgroups) { ++ ret = -1; ++ goto out; ++ } ++ groups[ngroups++] = grp->gr_gid; ++ break; ++ } ++ } ++ } ++out: ++ endgrent(); ++ *grpcnt = ngroups; ++ return (ret); ++} +--- dbus-1.6.8/dbus/dbus-sysdeps-unix.c.orig 2013-02-28 13:08:52.171215237 +0000 ++++ dbus-1.6.8/dbus/dbus-sysdeps-unix.c 2013-02-28 13:13:52.224615146 +0000 +@@ -21,6 +21,10 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ ++#ifndef HAVE_GETGROUPLIST ++#include "getgrouplist.c" ++#define HAVE_GETGROUPLIST ++#endif + + #include + From cbfc76d5caa73dff89a3388fe2ed18b3214face3 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 14:52:14 +0000 Subject: [PATCH 12/23] Add SmartOS native GCC path. --- pkgs/stdenv/native/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index f303e47fd5d..715bc02758b 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -113,7 +113,7 @@ rec { name = "gcc-native"; nativeTools = true; nativeLibc = true; - nativePrefix = if system == "i686-solaris" then "/usr/gnu" else "/usr"; + nativePrefix = if system == "i686-solaris" then "/usr/gnu" else if system == "x86_64-solaris" then "/opt/local/gcc47" else "/usr"; stdenv = stdenvBoot0; }; From 9baf9e98d191de0fc39678a0b1bc051ee48d6fa6 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 15:53:47 +0100 Subject: [PATCH 13/23] Fix Perl builds on Illumos. --- pkgs/development/interpreters/perl/5.14/default.nix | 3 ++- .../interpreters/perl/5.14/ld-shared.patch | 11 +++++++++++ pkgs/development/interpreters/perl/5.16/default.nix | 1 + .../interpreters/perl/5.16/ld-shared.patch | 11 +++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/perl/5.14/ld-shared.patch create mode 100644 pkgs/development/interpreters/perl/5.16/ld-shared.patch diff --git a/pkgs/development/interpreters/perl/5.14/default.nix b/pkgs/development/interpreters/perl/5.14/default.nix index ac19900bcfc..70a030e0308 100644 --- a/pkgs/development/interpreters/perl/5.14/default.nix +++ b/pkgs/development/interpreters/perl/5.14/default.nix @@ -17,7 +17,8 @@ stdenv.mkDerivation rec { patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch - ] + ] + ++ stdenv.lib.optional stdenv.isSunOS ./ld-shared.patch ++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch; # Build a thread-safe Perl with a dynamic libperls.o. We need the diff --git a/pkgs/development/interpreters/perl/5.14/ld-shared.patch b/pkgs/development/interpreters/perl/5.14/ld-shared.patch new file mode 100644 index 00000000000..b1834ff7a1f --- /dev/null +++ b/pkgs/development/interpreters/perl/5.14/ld-shared.patch @@ -0,0 +1,11 @@ +--- perl-5.14.2/hints/solaris_2.sh.orig 2013-02-14 19:29:49.453988140 +0000 ++++ perl-5.14.2/hints/solaris_2.sh 2013-02-14 19:30:31.681631019 +0000 +@@ -568,7 +568,7 @@ + # ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" + # fi + ldflags="$ldflags -m64" +- lddlflags="$lddlflags -G -m64" ++ lddlflags="$lddlflags -shared -m64" + ;; + *) + getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index 288de63b4ae..153da2c9d05 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -18,6 +18,7 @@ stdenv.mkDerivation rec { [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch ] + ++ stdenv.lib.optional stdenv.isSunOS ./ld-shared.patch ++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch; # Build a thread-safe Perl with a dynamic libperls.o. We need the diff --git a/pkgs/development/interpreters/perl/5.16/ld-shared.patch b/pkgs/development/interpreters/perl/5.16/ld-shared.patch new file mode 100644 index 00000000000..be45230c8a7 --- /dev/null +++ b/pkgs/development/interpreters/perl/5.16/ld-shared.patch @@ -0,0 +1,11 @@ +--- perl-5.16.2/hints/solaris_2.sh.orig 2013-02-14 19:29:49.453988140 +0000 ++++ perl-5.16.2/hints/solaris_2.sh 2013-02-14 19:30:31.681631019 +0000 +@@ -568,7 +568,7 @@ + # ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" + # fi + ldflags="$ldflags -m64" +- lddlflags="$lddlflags -G -m64" ++ lddlflags="$lddlflags -shared -m64" + ;; + *) + getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" From 99a14f378c7fb6f24b2ce98d834c1394bb176bc4 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:20:03 +0100 Subject: [PATCH 14/23] Fix ncurses build on Illumos. --- .../development/libraries/ncurses/default.nix | 4 +- pkgs/development/libraries/ncurses/patch-ac | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/ncurses/patch-ac diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 569d7fe2a32..378abb81295 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -8,7 +8,7 @@ let , but this is left as an exercise to the reader. So disable them for now. */ - cxx = stdenv.system != "i686-solaris"; + cxx = !stdenv.isSunOS; in stdenv.mkDerivation (rec { name = "ncurses-5.9"; @@ -23,6 +23,8 @@ stdenv.mkDerivation (rec { ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"} ''; + patches = [ ./patch-ac ]; + selfNativeBuildInput = true; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/ncurses/patch-ac b/pkgs/development/libraries/ncurses/patch-ac new file mode 100644 index 00000000000..73578f8a367 --- /dev/null +++ b/pkgs/development/libraries/ncurses/patch-ac @@ -0,0 +1,40 @@ +$NetBSD: patch-ac,v 1.18 2011/11/01 14:47:46 hans Exp $ + +--- ncurses-5.9/configure.orig 2011-02-21 01:40:36.000000000 +0000 ++++ ncurses-5.9/configure +@@ -7096,6 +7096,13 @@ sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; + solaris2.1[0-9]) #(vi ++ case "$GCC_VERSION" in ++ 4.[67].*) ++ cf_XOPEN_SOURCE=600 ++ cf_add_cflags=-std=c99 ++ CPPFLAGS="$CPPFLAGS -std=c99" ++ ;; ++ esac + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; + solaris2.[1-9]) #(vi +@@ -9640,12 +9647,7 @@ case ".$MANPAGE_RENAMES" in #(vi + .no) #(vi + ;; + .|.yes) +- # Debian 'man' program? +- if test -f /etc/debian_version ; then +- MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames +- else + MANPAGE_RENAMES=no +- fi + ;; + esac + +@@ -18449,7 +18444,7 @@ echo "${ECHO_T}$LIB_SUBSETS" >&6 + + ### Construct the list of include-directories to be generated + +-CPPFLAGS="$CPPFLAGS -I. -I../include" ++CPPFLAGS="-I. -I../include $CPPFLAGS" + if test "$srcdir" != "."; then + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" + fi From fe3a8b6859302393c77ee6626f4a65a0a3831eca Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:28:14 +0100 Subject: [PATCH 15/23] gnutar root build: Nix on Illumos doesn't support build users yet. --- pkgs/tools/archivers/gnutar/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix index 51d5d35fe80..828d0677bb8 100644 --- a/pkgs/tools/archivers/gnutar/default.nix +++ b/pkgs/tools/archivers/gnutar/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { # May have some issues with root compilation because the bootstrap tool # cannot be used as a login shell for now. - FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux") "1"; + FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1"; meta = { homepage = http://www.gnu.org/software/tar/; From 5dcc019dc0fa88caa071b457c77f1d1ccbfaa380 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:35:01 +0100 Subject: [PATCH 16/23] Update bison to 2.7 --- pkgs/development/tools/parsing/bison/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/parsing/bison/default.nix b/pkgs/development/tools/parsing/bison/default.nix index b397a22443a..4e4539059a6 100644 --- a/pkgs/development/tools/parsing/bison/default.nix +++ b/pkgs/development/tools/parsing/bison/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, m4, perl }: stdenv.mkDerivation rec { - name = "bison-2.6.5"; + name = "bison-2.7"; src = fetchurl { url = "mirror://gnu/bison/${name}.tar.xz"; - sha256 = "8640d5b51aad462db6863711f333a9159836853e0b1e79fdef708c6efb5cd52b"; + sha256 = "1zd77ilmpv5mi3kr55jrj6ncqlcnyhpianhrwzak2q28cv2cbn23"; }; nativeBuildInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl; From ecba7e947eb8cc1500dd1a91b544567d595a37e2 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:38:43 +0100 Subject: [PATCH 17/23] Update Git to 1.8.1.3 and fix build on Illumos. --- .../version-management/git-and-tools/git/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 87fa119252c..62880424b59 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -10,7 +10,7 @@ let - version = "1.8.1"; + version = "1.8.1.3"; svn = subversionClient.override { perlBindings = true; }; @@ -21,7 +21,7 @@ stdenv.mkDerivation { src = fetchurl { url = "http://git-core.googlecode.com/files/git-${version}.tar.gz"; - sha1 = "wfj2pbqf9l56014dm330wb13qgcwx3dc"; + sha256 = "1waz35cwgcwhgmgzmc4s00yd2vivhy77p49crgqsl0nqpxyj8lrp"; }; patches = [ ./docbook2texi.patch ]; @@ -32,7 +32,8 @@ stdenv.mkDerivation { ++ stdenv.lib.optionals guiSupport [tcl tk]; makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} " - + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1"); + + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1") + + (if stdenv.isSunOS then " INSTALL=install NO_INET_NTOP= NO_INET_PTON=" else ""); # FIXME: "make check" requires Sparse; the Makefile must be tweaked # so that `SPARSE_FLAGS' corresponds to the current architecture... From 5436ca4d87dda0687435147b5657bd0540b9f668 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:42:03 +0100 Subject: [PATCH 18/23] Update gettext to 0.18.2 --- pkgs/development/libraries/gettext/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index e88308bb2e9..074c1b9c49f 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, libiconv }: stdenv.mkDerivation (rec { - name = "gettext-0.18.1.1"; + name = "gettext-0.18.2"; src = fetchurl { url = "mirror://gnu/gettext/${name}.tar.gz"; - sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k"; + sha256 = "516a6370b3b3f46e2fc5a5e222ff5ecd76f3089bc956a7587a6e4f89de17714c"; }; patches = [ ./no-gets.patch ]; From e33b77d84d1c4dabc18a439e39c9f084e7c566fb Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:49:46 +0100 Subject: [PATCH 19/23] Fix gnugrep build on Illumos. --- pkgs/tools/text/gnugrep/default.nix | 2 ++ pkgs/tools/text/gnugrep/test-localeconv.patch | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/tools/text/gnugrep/test-localeconv.patch diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 98a737339d2..fde9123adf2 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation { buildInputs = [ pcre ] ++ stdenv.lib.optional (libiconv != null) libiconv; + patches = [ ./test-localeconv.patch ]; + NIX_LDFLAGS = stdenv.lib.optionalString (libiconv != null) "-L${libiconv}/lib -liconv"; doCheck = !stdenv.isDarwin; diff --git a/pkgs/tools/text/gnugrep/test-localeconv.patch b/pkgs/tools/text/gnugrep/test-localeconv.patch new file mode 100644 index 00000000000..f5efaf22221 --- /dev/null +++ b/pkgs/tools/text/gnugrep/test-localeconv.patch @@ -0,0 +1,18 @@ +--- grep-2.14/gnulib-tests/test-localeconv.c.orig 2013-02-15 18:41:50.213433059 +0000 ++++ grep-2.14/gnulib-tests/test-localeconv.c 2013-02-15 18:50:33.964751303 +0000 +@@ -37,13 +37,13 @@ + + ASSERT (STREQ (l->decimal_point, ".")); + ASSERT (STREQ (l->thousands_sep, "")); +-#if !defined __FreeBSD__ ++#if !(defined __FreeBSD__ || defined __sun) + ASSERT (STREQ (l->grouping, "")); + #endif + + ASSERT (STREQ (l->mon_decimal_point, "")); + ASSERT (STREQ (l->mon_thousands_sep, "")); +-#if !defined __FreeBSD__ ++#if !(defined __FreeBSD__ || defined __sun) + ASSERT (STREQ (l->mon_grouping, "")); + #endif + ASSERT (STREQ (l->positive_sign, "")); From ef85e97b518ffbf5913f5ba1e44cce8337b2a886 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:50:58 +0100 Subject: [PATCH 20/23] Update gnused to 4.2.2 --- pkgs/tools/text/gnused/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index 66fcb3d1929..65a1c131de1 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "gnused-4.2.1"; + name = "gnused-4.2.2"; src = fetchurl { - url = mirror://gnu/sed/sed-4.2.1.tar.gz; - sha256 = "0q1hzjvr6pzhaagidg7pj76k1fzz5nl15np7p72w9zcpw0f58ww7"; + url = mirror://gnu/sed/sed-4.2.2.tar.gz; + sha256 = "f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7"; }; meta = { From 66798d7aaf79fdb4eca7c1f04f092544b4afa4a6 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 17:03:42 +0100 Subject: [PATCH 21/23] gettext: Remove old patch. Enable xz compression. --- .../development/libraries/gettext/default.nix | 8 ++-- .../libraries/gettext/no-gets.patch | 42 ------------------- 2 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 pkgs/development/libraries/gettext/no-gets.patch diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 074c1b9c49f..c9596d66ee2 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, libiconv }: +{ stdenv, fetchurl, libiconv, xz }: stdenv.mkDerivation (rec { name = "gettext-0.18.2"; @@ -8,11 +8,9 @@ stdenv.mkDerivation (rec { sha256 = "516a6370b3b3f46e2fc5a5e222ff5ecd76f3089bc956a7587a6e4f89de17714c"; }; - patches = [ ./no-gets.patch ]; - LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else ""; - configureFlags = [ "--disable-csharp" ] + configureFlags = [ "--disable-csharp" "--with-xz" ] ++ (stdenv.lib.optionals stdenv.isCygwin [ # We have a static libiconv, so we can only build the static lib. "--disable-shared" "--enable-static" @@ -32,7 +30,7 @@ stdenv.mkDerivation (rec { fi ''; - buildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv; + buildInputs = [ xz ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/gettext/no-gets.patch b/pkgs/development/libraries/gettext/no-gets.patch deleted file mode 100644 index 9daa48eae64..00000000000 --- a/pkgs/development/libraries/gettext/no-gets.patch +++ /dev/null @@ -1,42 +0,0 @@ -hack until gzip pulls a newer gnulib version - -From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Thu, 29 Mar 2012 13:30:41 -0600 -Subject: [PATCH] stdio: don't assume gets any more - -Gnulib intentionally does not have a gets module, and now that C11 -and glibc have dropped it, we should be more proactive about warning -any user on a platform that still has a declaration of this dangerous -interface. - ---- a/gettext-tools/libgettextpo/stdio.in.h -+++ b/gettext-tools/libgettextpo/stdio.in.h -@@ -125,7 +125,6 @@ - so any use of gets warrants an unconditional warning. Assume it is - always declared, since it is required by C89. */ - #undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); - - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ ---- a/gettext-tools/gnulib-lib/stdio.in.h -+++ b/gettext-tools/gnulib-lib/stdio.in.h -@@ -125,7 +125,6 @@ - so any use of gets warrants an unconditional warning. Assume it is - always declared, since it is required by C89. */ - #undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); - - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ ---- a/gettext-runtime/gnulib-lib/stdio.in.h -+++ b/gettext-runtime/gnulib-lib/stdio.in.h -@@ -125,7 +125,6 @@ - so any use of gets warrants an unconditional warning. Assume it is - always declared, since it is required by C89. */ - #undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); - - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ From 58e6277d77088629b72b2bf9a02f46edb4208c36 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 18:53:50 +0000 Subject: [PATCH 22/23] Allow GNU Patch tests to run with non-bash shell. Fix gnused url. --- pkgs/tools/text/gnupatch/bashishms.patch | 67 ++++++++++++++++++++++++ pkgs/tools/text/gnupatch/default.nix | 5 +- pkgs/tools/text/gnused/default.nix | 2 +- 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 pkgs/tools/text/gnupatch/bashishms.patch diff --git a/pkgs/tools/text/gnupatch/bashishms.patch b/pkgs/tools/text/gnupatch/bashishms.patch new file mode 100644 index 00000000000..1a2cfbd8e4a --- /dev/null +++ b/pkgs/tools/text/gnupatch/bashishms.patch @@ -0,0 +1,67 @@ +http://lists.gnu.org/archive/html/bug-patch/2012-11/msg00001.html +Tested on Illumos, where ksh is /bin/sh. + +--- patch-2.7.1/tests/test-lib.sh ++++ patch-2.7.1/tests/test-lib.sh +@@ -118,7 +118,7 @@ + } + + if test -z "`echo -n`"; then +- if eval 'test -n "${BASH_LINENO[0]}" 2>/dev/null'; then ++ if (eval 'test -n "${BASH_LINENO[0]}"') 2>/dev/null; then + eval ' + _start_test() { + echo -n "[${BASH_LINENO[2]}] $* -- " + +--- patch-2.7.1/tests/crlf-handling ++++ patch-2.7.1/tests/crlf-handling +@@ -14,7 +14,7 @@ + use_tmpdir + + lf2crlf() { +- while read l; do echo -e "$l\r"; done ++ while read l; do printf "%s\r\n" "$l"; done + } + + echo 1 > a + +--- patch-2.7.1/tests/merge ++++ patch-2.7.1/tests/merge +@@ -32,18 +32,20 @@ + shift + done > a.sed + echo "$body" | sed -f a.sed > b +- shift +- while test $# -gt 0 ; do +- echo "$1" ++ if test $# -gt 0 ; then + shift +- done > b.sed ++ while test $# -gt 0 ; do ++ echo "$1" ++ shift ++ done ++ fi > b.sed + echo "$body" | sed -f b.sed > c + rm -f a.sed b.sed + output=`diff -u a b | patch $ARGS -f c` + status=$? + echo "$output" | sed -e '/^$/d' -e '/^patching file c$/d' + cat c +- test $status == 0 || echo "Status: $status" ++ test $status = 0 || echo "Status: $status" + } + + x() { + +--- patch-2.7.1/tests/read-only-files ++++ patch-2.7.1/tests/read-only-files +@@ -16,7 +16,7 @@ + + : > read-only + chmod a-w read-only +-if : 2> /dev/null > read-only; then ++if (: > read-only) 2> /dev/null; then + echo "Files with read-only permissions are writable" \ + "(probably running as superuser)" >&2 + exit 77 diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix index c8c336ad202..83430a87105 100644 --- a/pkgs/tools/text/gnupatch/default.nix +++ b/pkgs/tools/text/gnupatch/default.nix @@ -14,8 +14,9 @@ stdenv.mkDerivation rec { configureFlags = [ "ac_cv_func_strnlen_working=yes" ]; }; - # Tests fail on FreeBSD due to a Bashism in the tests. - doCheck = !stdenv.isFreeBSD; + patches = [ ./bashishms.patch ]; + + doCheck = true; meta = { description = "GNU Patch, a program to apply differences to files"; diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index 65a1c131de1..d16ce1e0a29 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation { name = "gnused-4.2.2"; src = fetchurl { - url = mirror://gnu/sed/sed-4.2.2.tar.gz; + url = mirror://gnu/sed/sed-4.2.2.tar.bz2; sha256 = "f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7"; }; From 242b4d23a71b9d2193d590da31448c26b15ba534 Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Thu, 28 Feb 2013 16:45:36 +0100 Subject: [PATCH 23/23] Update less to version 451 --- pkgs/tools/misc/less/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/less/default.nix b/pkgs/tools/misc/less/default.nix index b22e7521764..d038abbfc81 100644 --- a/pkgs/tools/misc/less/default.nix +++ b/pkgs/tools/misc/less/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl, ncurses}: stdenv.mkDerivation { - name = "less-436"; + name = "less-451"; src = fetchurl { - url = http://www.greenwoodsoftware.com/less/less-436.tar.gz; - sha256 = "1lilcx6qrfr2dqahv7r10j9h2v86w5sb7m8wrx2sza9ifkq6z8ap"; + url = http://www.greenwoodsoftware.com/less/less-451.tar.gz; + sha256 = "9fe8287c647afeafb4149c5dedaeacfd20971ed7c26c7553794bb750536b5f57"; }; buildInputs = [ncurses];