Merge #11067: SmartOS updates

I amended some commits slightly.

+103 -48
+3 -2
lib/platforms.nix
··· 8 8 openbsd = ["i686-openbsd" "x86_64-openbsd"]; 9 9 netbsd = ["i686-netbsd" "x86_64-netbsd"]; 10 10 cygwin = ["i686-cygwin" "x86_64-cygwin"]; 11 - unix = linux ++ darwin ++ freebsd ++ openbsd; 12 - all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd; 11 + illumos = ["x86_64-solaris"]; 12 + unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; 13 + all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; 13 14 none = []; 14 15 allBut = platforms: lists.filter (x: !(builtins.elem x platforms)) all; 15 16 mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux"];
+2
pkgs/applications/networking/browsers/w3m/default.nix
··· 19 19 sha256 = "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579"; 20 20 }; 21 21 22 + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lsocket -lnsl"; 23 + 22 24 patches = [ ./glibc214.patch ] 23 25 # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that 24 26 # alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
+1 -1
pkgs/build-support/cc-wrapper/default.nix
··· 145 145 + optionalString (stdenv.isSunOS && nativePrefix != "") '' 146 146 # Solaris needs an additional ld wrapper. 147 147 ldPath="${nativePrefix}/bin" 148 - ld="$out/bin/ld-solaris" 148 + exec="$ldPath/ld" 149 149 wrap ld-solaris ${./ld-solaris-wrapper.sh} 150 150 '') 151 151
+1 -1
pkgs/build-support/cc-wrapper/ld-solaris-wrapper.sh
··· 6 6 # I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( 7 7 # Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 8 8 # but still no success. 9 - cmd="@prog@ -z ignore" 9 + cmd="@ld@ -z ignore" 10 10 11 11 args=("$@"); 12 12
+1 -1
pkgs/build-support/fetchgit/builder.sh
··· 6 6 7 7 header "exporting $url (rev $rev) into $out" 8 8 9 - $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ 9 + $SHELL $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ 10 10 ${leaveDotGit:+--leave-dotGit} \ 11 11 ${deepClone:+--deepClone} \ 12 12 ${fetchSubmodules:+--fetch-submodules} \
+2
pkgs/build-support/gcc-wrapper-old/utils.sh
··· 14 14 # the temporary build directory). 15 15 if test "${p:0:1}" != "/"; then return 1; fi 16 16 17 + @extraPathTests@ 18 + 17 19 # Otherwise, the path should refer to the store or some temporary 18 20 # directory (including the build directory). 19 21 test \
+2 -2
pkgs/build-support/setup-hooks/patch-shebangs.sh
··· 19 19 local newInterpreterLine 20 20 21 21 find "$dir" -type f -perm -0100 | while read f; do 22 - if [ "$(head -1 "$f" | head -c +2)" != '#!' ]; then 22 + if [ "$(head -1 "$f" | head -c+2)" != '#!' ]; then 23 23 # missing shebang => not a script 24 24 continue 25 25 fi 26 26 27 - oldInterpreterLine=$(head -1 "$f" | tail -c +3) 27 + oldInterpreterLine=$(head -1 "$f" | tail -c+3) 28 28 read -r oldPath arg0 args <<< "$oldInterpreterLine" 29 29 30 30 if $(echo "$oldPath" | grep -q "/bin/env$"); then
+1 -1
pkgs/development/compilers/gcc/4.8/default.nix
··· 294 294 ++ (optional stdenv.isDarwin gnused) 295 295 ; 296 296 297 - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; 298 297 299 298 preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) '' 300 299 export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g` ··· 519 518 platforms = 520 519 stdenv.lib.platforms.linux ++ 521 520 stdenv.lib.platforms.freebsd ++ 521 + stdenv.lib.platforms.illumos ++ 522 522 optionals (langAda == false) stdenv.lib.platforms.darwin; 523 523 }; 524 524 }
+2 -2
pkgs/development/compilers/gcc/4.9/default.nix
··· 293 293 ++ (optional stdenv.isDarwin gnused) 294 294 ; 295 295 296 - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; 297 - 298 296 preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) '' 297 + sed -i -e "s/-lrt//g" libstdc++-v3/configure 299 298 export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g` 300 299 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET" 301 300 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" ··· 518 517 platforms = 519 518 stdenv.lib.platforms.linux ++ 520 519 stdenv.lib.platforms.freebsd ++ 520 + stdenv.lib.platforms.illumos ++ 521 521 optionals (langAda == false) stdenv.lib.platforms.darwin; 522 522 }; 523 523 }
+1
pkgs/development/compilers/sbcl/bootstrap.nix
··· 23 23 sha256 = "0sp5445rbvms6qvzhld0kwwvydw51vq5iaf4kdqsf2d9jvaz3yx5"; 24 24 }; 25 25 armv6l-linux = armv7l-linux; 26 + x86_64-solaris = x86_64-linux; 26 27 }; 27 28 cfg = options.${stdenv.system}; 28 29 in
+1
pkgs/development/interpreters/perl/5.20/default.nix
··· 66 66 "-Dlocincpth=${libc}/include" 67 67 "-Dloclibpth=${libc}/lib" 68 68 ] 69 + ++ optional stdenv.isSunOS "-Dcc=gcc" 69 70 ++ optional enableThreading "-Dusethreads"; 70 71 71 72 configureScript = "${stdenv.shell} ./Configure";
+23 -10
pkgs/development/interpreters/perl/5.20/ld-shared.patch
··· 1 - --- perl-5.16.2/hints/solaris_2.sh.orig 2013-02-14 19:29:49.453988140 +0000 2 - +++ perl-5.16.2/hints/solaris_2.sh 2013-02-14 19:30:31.681631019 +0000 3 - @@ -568,7 +568,7 @@ 4 - # ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" 5 - # fi 6 - ldflags="$ldflags -m64" 7 - - lddlflags="$lddlflags -G -m64" 8 - + lddlflags="$lddlflags -shared -m64" 1 + $NetBSD: patch-hints_solaris__2.sh,v 1.2 2015/10/27 09:10:44 jperkin Exp $ 2 + 3 + Redo PR pkg/44999. 4 + 5 + --- perl-5.20.2/hints/solaris_2.sh.orig 2015-05-13 20:19:29.000000000 +0000 6 + +++ perl-5.20.2/hints/solaris_2.sh 7 + @@ -585,7 +585,7 @@ EOM 8 + fi 9 + fi 10 + case "${cc:-cc} -v 2>/dev/null" in 11 + - *gcc*) 12 + + *gcc*|clang*) 13 + echo 'int main() { return 0; }' > try.c 14 + case "`${cc:-cc} $ccflags -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in 15 + *"m64 is not supported"*) 16 + @@ -622,7 +622,7 @@ EOM 17 + # use that with Solaris 11 and later, but keep 18 + # the old behavior for older Solaris versions. 19 + case "$osvers" in 20 + - 2.?|2.10) lddlflags="$lddlflags -G -m64" ;; 21 + + 2.?|2.10) lddlflags="$lddlflags -shared -m64" ;; 22 + *) lddlflags="$lddlflags -shared -m64" ;; 23 + esac 9 24 ;; 10 - *) 11 - getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
+1
pkgs/development/interpreters/perl/5.22/default.nix
··· 51 51 "-Dlocincpth=${libc}/include" 52 52 "-Dloclibpth=${libc}/lib" 53 53 ] 54 + ++ optional stdenv.isSunOS "-Dcc=gcc" 54 55 ++ optional enableThreading "-Dusethreads"; 55 56 56 57 configureScript = "${stdenv.shell} ./Configure";
+23 -10
pkgs/development/interpreters/perl/5.22/ld-shared.patch
··· 1 - --- perl-5.16.2/hints/solaris_2.sh.orig 2013-02-14 19:29:49.453988140 +0000 2 - +++ perl-5.16.2/hints/solaris_2.sh 2013-02-14 19:30:31.681631019 +0000 3 - @@ -568,7 +568,7 @@ 4 - # ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" 5 - # fi 6 - ldflags="$ldflags -m64" 7 - - lddlflags="$lddlflags -G -m64" 8 - + lddlflags="$lddlflags -shared -m64" 1 + $NetBSD: patch-hints_solaris__2.sh,v 1.2 2015/10/27 09:10:44 jperkin Exp $ 2 + 3 + Redo PR pkg/44999. 4 + 5 + --- perl-5.22.0/hints/solaris_2.sh.orig 2015-05-13 20:19:29.000000000 +0000 6 + +++ perl-5.22.0/hints/solaris_2.sh 7 + @@ -585,7 +585,7 @@ EOM 8 + fi 9 + fi 10 + case "${cc:-cc} -v 2>/dev/null" in 11 + - *gcc*) 12 + + *gcc*|clang*) 13 + echo 'int main() { return 0; }' > try.c 14 + case "`${cc:-cc} $ccflags -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in 15 + *"m64 is not supported"*) 16 + @@ -622,7 +622,7 @@ EOM 17 + # use that with Solaris 11 and later, but keep 18 + # the old behavior for older Solaris versions. 19 + case "$osvers" in 20 + - 2.?|2.10) lddlflags="$lddlflags -G -m64" ;; 21 + + 2.?|2.10) lddlflags="$lddlflags -shared -m64" ;; 22 + *) lddlflags="$lddlflags -shared -m64" ;; 23 + esac 9 24 ;; 10 - *) 11 - getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
+1 -1
pkgs/development/libraries/dbus/default.nix
··· 93 93 preBuild = makeInternalLib; 94 94 buildInputs = buildInputsX ++ systemdOrEmpty ++ [ libs ]; 95 95 NIX_CFLAGS_LINK = 96 - stdenv.lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed " 96 + stdenv.lib.optionalString (!stdenv.isDarwin && !stdenv.isSunOS) "-Wl,--as-needed " 97 97 + "-ldbus-1"; 98 98 99 99 # don't provide another dbus-1.pc (with incorrect include and link dirs),
+1 -1
pkgs/development/libraries/glib/default.nix
··· 65 65 66 66 configureFlags = 67 67 optional stdenv.isDarwin "--disable-compile-warnings" 68 - ++ optional stdenv.isSunOS "--disable-modular-tests"; 68 + ++ optional stdenv.isSunOS ["--disable-modular-tests" "--with-libiconv"]; 69 69 70 70 NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl" 71 71 + optionalString stdenv.isSunOS " -DBSD_COMP";
+2
pkgs/development/libraries/libelf/default.nix
··· 15 15 nativeBuildInputs = [ glibc ]; 16 16 }; 17 17 18 + buildInputs = [ gettext ]; 19 + 18 20 meta = { 19 21 description = "ELF object file access library"; 20 22
+1
pkgs/development/libraries/mpfr/default.nix
··· 14 14 propagatedBuildInputs = [ gmp ]; 15 15 16 16 configureFlags = 17 + stdenv.lib.optional stdenv.isSunOS "--disable-thread-safe" ++ 17 18 stdenv.lib.optional stdenv.is64bit "--with-pic"; 18 19 19 20 doCheck = true;
+9
pkgs/development/libraries/ncurses/default.nix
··· 27 27 "--enable-symlinks" 28 28 ] ++ lib.optional unicode "--enable-widec"; 29 29 30 + # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: 31 + CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; 32 + 30 33 buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm; 31 34 32 35 preConfigure = '' 33 36 configureFlagsArray+=("--includedir=$out/include") 34 37 export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" 35 38 mkdir -p "$PKG_CONFIG_LIBDIR" 39 + '' 40 + + lib.optionalString stdenv.isSunOS '' 41 + sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' \ 42 + -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \ 43 + configure 44 + CFLAGS=-D_XOPEN_SOURCE_EXTENDED 36 45 '' + lib.optionalString stdenv.isCygwin '' 37 46 sed -i -e 's,LIB_SUFFIX="t,LIB_SUFFIX=",' configure 38 47 '';
+2
pkgs/development/tools/documentation/doxygen/default.nix
··· 20 20 buildInputs = 21 21 [ perl python flex bison ] 22 22 ++ stdenv.lib.optional (qt4 != null) qt4 23 + ++ stdenv.lib.optional stdenv.isSunOS libiconv 23 24 ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices libiconv ]; 24 25 25 26 prefixKey = "--prefix "; 26 27 27 28 configureFlags = 28 29 [ "--dot dot" ] 30 + ++ stdenv.lib.optional stdenv.isSunOS "--install install" 29 31 ++ stdenv.lib.optional (qt4 != null) "--with-doxywizard"; 30 32 31 33 preConfigure =
+3 -2
pkgs/development/tools/misc/pkgconfig/default.nix
··· 10 10 sha256 = "0sq09a39wj4cxf8l2jvkq067g08ywfma4v6nhprnf351s82pfl68"; 11 11 }; 12 12 13 - buildInputs = stdenv.lib.optional (stdenv.isCygwin || stdenv.isDarwin) libiconv; 13 + buildInputs = stdenv.lib.optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv; 14 14 15 - configureFlags = [ "--with-internal-glib" ]; 15 + configureFlags = [ "--with-internal-glib" ] 16 + ++ stdenv.lib.optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]; 16 17 17 18 patches = (if vanilla then [] else [ 18 19 # Process Requires.private properly, see
+5 -2
pkgs/development/tools/misc/texinfo/6.0.nix
··· 1 - { stdenv, fetchurl, ncurses, perl, xz, interactive ? false }: 1 + { stdenv, fetchurl, ncurses, perl, xz, libiconv, gawk, interactive ? false }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "texinfo-6.0"; ··· 9 9 }; 10 10 11 11 buildInputs = [ perl xz ] 12 + ++ stdenv.lib.optionals stdenv.isSunOS [ libiconv gawk ] 12 13 ++ stdenv.lib.optional interactive ncurses; 13 14 15 + configureFlags = stdenv.lib.optionalString stdenv.isSunOS "AWK=${gawk}/bin/awk"; 16 + 14 17 preInstall = '' 15 18 installFlags="TEXMF=$out/texmf-dist"; 16 19 installTargets="install install-tex"; 17 20 ''; 18 21 19 - doCheck = !stdenv.isDarwin && !interactive; 22 + doCheck = !stdenv.isDarwin && !interactive && !stdenv.isSunOS/*flaky*/; 20 23 21 24 meta = { 22 25 homepage = "http://www.gnu.org/software/texinfo/";
+2 -2
pkgs/development/tools/parsing/bison/3.x.nix
··· 1 - { stdenv, fetchurl, m4, perl }: 1 + { stdenv, fetchurl, m4, perl, help2man }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "bison-3.0.4"; ··· 8 8 sha256 = "b67fd2daae7a64b5ba862c66c07c1addb9e6b1b05c5f2049392cfd8a2172952e"; 9 9 }; 10 10 11 - nativeBuildInputs = [ m4 perl ]; 11 + nativeBuildInputs = [ m4 perl ] ++ stdenv.lib.optional stdenv.isSunOS help2man; 12 12 propagatedBuildInputs = [ m4 ]; 13 13 14 14 meta = {
+3 -3
pkgs/tools/misc/coreutils/default.nix
··· 36 36 touch -r src/stat.c src/tail.c 37 37 ''; 38 38 39 + configureFlags = optionalString stdenv.isSunOS "ac_cv_func_inotify_init=no"; 40 + 39 41 nativeBuildInputs = [ perl ]; 40 42 buildInputs = [ gmp ] 41 43 ++ optional aclSupport acl ··· 80 82 enableParallelBuilding = false; 81 83 82 84 NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; 85 + FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1"; 83 86 84 87 makeFlags = optionalString stdenv.isDarwin "CFLAGS=-D_FORTIFY_SOURCE=0"; 85 88 ··· 103 106 }; 104 107 in 105 108 self 106 - // stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux" || stdenv.isSunOS) { 107 - FORCE_UNSAFE_CONFIGURE = 1; 108 - }
+1 -1
pkgs/tools/misc/less/default.nix
··· 18 18 meta = { 19 19 homepage = http://www.greenwoodsoftware.com/less/; 20 20 description = "A more advanced file pager than ‘more’"; 21 - platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 21 + platforms = stdenv.lib.platforms.unix; 22 22 maintainers = [ stdenv.lib.maintainers.eelco ]; 23 23 }; 24 24 }
+1
pkgs/tools/networking/curl/default.nix
··· 47 47 ''; 48 48 49 49 configureFlags = [ 50 + "--disable-manual" 50 51 ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" ) 51 52 ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" ) 52 53 ( if ldapSupport then "--enable-ldap" else "--disable-ldap" )
+3 -3
pkgs/tools/networking/haproxy/default.nix
··· 1 - { stdenv, pkgs, fetchurl, openssl }: 1 + { stdenv, pkgs, fetchurl, openssl, zlib }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 majorVersion = "1.5"; ··· 10 10 sha256 = "16cg1jmy2d8mq2ypwifsvhbyp4pyrj0zm0r818sx0r4hchwdsrcm"; 11 11 }; 12 12 13 - buildInputs = [ openssl ]; 13 + buildInputs = [ openssl zlib ]; 14 14 15 15 # TODO: make it work on darwin/bsd as well 16 16 preConfigure = '' 17 - export makeFlags="TARGET=linux2628 PREFIX=$out USE_OPENSSL=yes" 17 + export makeFlags="TARGET=${if stdenv.isSunOS then "solaris" else "linux2628"} PREFIX=$out USE_OPENSSL=yes USE_ZLIB=yes" 18 18 ''; 19 19 20 20 meta = {
+1
pkgs/tools/text/gawk/default.nix
··· 12 12 doCheck = !( 13 13 stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1 14 14 || stdenv.isDarwin # XXX: `locale' segfaults 15 + || stdenv.isSunOS # XXX: `_backsmalls1' fails, locale stuff? 15 16 ); 16 17 17 18 buildInputs = stdenv.lib.optional (stdenv.system != "x86_64-cygwin") libsigsegv
+1 -1
pkgs/tools/text/gnugrep/default.nix
··· 15 15 buildInputs = [ pcre libiconv ]; 16 16 17 17 # cygwin: FAIL: multibyte-white-space 18 - doCheck = !stdenv.isDarwin && !stdenv.isCygwin; 18 + doCheck = !stdenv.isDarwin && !stdenv.isSunOS && !stdenv.isCygwin; 19 19 20 20 # On Mac OS X, force use of mkdir -p, since Grep's fallback 21 21 # (./install-sh) is broken.
+2 -1
pkgs/top-level/all-packages.nix
··· 16 16 # outside of the store. Thus, GCC, GFortran, & co. must always look for 17 17 # files in standard system directories (/usr/include, etc.) 18 18 noSysDirs ? (system != "x86_64-freebsd" && system != "i686-freebsd" 19 + && system != "x86_64-solaris" 19 20 && system != "x86_64-kfreebsd-gnu") 20 21 21 22 # More flags for the bootstrapping of stdenv. ··· 3905 3906 inherit noSysDirs; 3906 3907 3907 3908 # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion 3908 - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); 3909 + profiledCompiler = with stdenv; (!isSunOS && !isDarwin && (isi686 || isx86_64)); 3909 3910 3910 3911 # When building `gcc.crossDrv' (a "Canadian cross", with host == target 3911 3912 # and host != build), `cross' must be null but the cross-libc must still
+1 -1
pkgs/top-level/perl-packages.nix
··· 6501 6501 meta = { 6502 6502 description = "The World-Wide Web library for Perl"; 6503 6503 license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; 6504 - platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 6504 + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin ++ stdenv.lib.platforms.illumos; 6505 6505 }; 6506 6506 }; 6507 6507