From 9c4d2b4f3debf28c00fc5a98256b54d65d680fd7 Mon Sep 17 00:00:00 2001 From: gnidorah Date: Wed, 8 Nov 2017 09:26:31 +0300 Subject: [PATCH 01/69] gtk3: 3.22.24 -> 3.22.26 --- pkgs/development/libraries/gtk+/3.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 1d0930d8d03c..fe6d37ec692c 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -13,7 +13,7 @@ with stdenv.lib; let ver_maj = "3.22"; - ver_min = "24"; + ver_min = "26"; version = "${ver_maj}.${ver_min}"; in stdenv.mkDerivation rec { @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz"; - sha256 = "cbb16e4cfc928ab8f5f22f7290616f95f6ebc8c97cc724a2007b07ced833592b"; + sha256 = "61eef0d320e541976e2dfe445729f12b5ade53050ee9de6184235cb60cd4b967"; }; outputs = [ "out" "dev" ]; From bd04a0ff0a59d2f77ecfe196ad63e82e9d1e300f Mon Sep 17 00:00:00 2001 From: Patrick Callahan Date: Tue, 11 Jul 2017 07:54:40 -0700 Subject: [PATCH 02/69] groff: split out perl dependencies --- pkgs/tools/text/groff/default.nix | 45 ++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 2f37f6394bac..b11f3cb4b8cd 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -5,14 +5,15 @@ }: stdenv.mkDerivation rec { - name = "groff-1.22.3"; + name = "groff-${version}"; + version = "1.22.3"; src = fetchurl { url = "mirror://gnu/groff/${name}.tar.gz"; sha256 = "1998v2kcs288d3y7kfxpvl369nqi06zbbvjzafyvyl3pr7bajj1s"; }; - outputs = [ "out" "man" "doc" "info" ]; + outputs = [ "out" "man" "doc" "info" "perl" ]; enableParallelBuilding = false; @@ -30,8 +31,7 @@ stdenv.mkDerivation rec { --replace "@PNMTOPS_NOSETPAGE@" "${netpbm}/bin/pnmtops -nosetpage" ''; - buildInputs = [ ghostscript psutils netpbm ]; - nativeBuildInputs = [ perl ]; + buildInputs = [ ghostscript psutils netpbm perl ]; # Builds running without a chroot environment may detect the presence # of /usr/X11 in the host system, leading to an impure build of the @@ -62,6 +62,41 @@ stdenv.mkDerivation rec { for f in 'man.local' 'mdoc.local'; do cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f" done + + moveToOutput bin/gropdf $perl + moveToOutput bin/pdfmom $perl + moveToOutput bin/roff2text $perl + moveToOutput bin/roff2pdf $perl + moveToOutput bin/roff2ps $perl + moveToOutput bin/roff2dvi $perl + moveToOutput bin/roff2ps $perl + moveToOutput bin/roff2html $perl + moveToOutput bin/glilypond $perl + moveToOutput bin/mmroff $perl + moveToOutput bin/roff2x $perl + moveToOutput bin/afmtodit $perl + moveToOutput bin/gperl $perl + moveToOutput bin/chem $perl + moveToOutput share/groff/${version}/font/devpdf $perl + + # idk if this is needed, but Fedora does it + moveToOutput share/groff/${version}/tmac/pdf.tmac $perl + + moveToOutput bin/gpinyin $perl + moveToOutput lib/groff/gpinyin $perl + substituteInPlace $perl/bin/gpinyin \ + --replace $out/lib/groff/gpinyin $perl/lib/groff/gpinyin + + moveToOutput bin/groffer $perl + moveToOutput lib/groff/groffer $perl + substituteInPlace $perl/bin/groffer \ + --replace $out/lib/groff/groffer $perl/lib/groff/groffer + + moveToOutput bin/grog $perl + moveToOutput lib/groff/grog $perl + substituteInPlace $perl/bin/grog \ + --replace $out/lib/groff/grog $perl/lib/groff/grog + ''; meta = with stdenv.lib; { @@ -82,5 +117,7 @@ stdenv.mkDerivation rec { version gxditview of the X11 xditview previewer, and an implementation of the -mm macros. ''; + + outputsToInstall = [ "out" "perl" ]; }; } From 29c0591dc1bf690d798f3625daaa0714291093a5 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 11 Nov 2017 13:10:01 +0300 Subject: [PATCH 03/69] makeWrapper: quote values properly This uses Bash ${foo@Q} feature to quote values properly, which allows us to handle values containing spaces, dollars etc. Thanks orivej for the idea! --- pkgs/build-support/setup-hooks/make-wrapper.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index f9d435df655b..01410828d39d 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -47,7 +47,7 @@ makeWrapper() { varName="${params[$((n + 1))]}" value="${params[$((n + 2))]}" n=$((n + 2)) - echo "export $varName=\"$value\"" >> "$wrapper" + echo "export $varName=${value@Q}" >> "$wrapper" elif [[ "$p" == "--unset" ]]; then varName="${params[$((n + 1))]}" n=$((n + 1)) @@ -63,9 +63,9 @@ makeWrapper() { n=$((n + 3)) if test -n "$value"; then if test "$p" = "--suffix"; then - echo "export $varName=\$$varName\${$varName:+$separator}$value" >> "$wrapper" + echo "export $varName=\$$varName\${$varName:+${separator@Q}}${value@Q}" >> "$wrapper" else - echo "export $varName=$value\${$varName:+$separator}\$$varName" >> "$wrapper" + echo "export $varName=${value@Q}\${$varName:+${separator@Q}}\$$varName" >> "$wrapper" fi fi elif [[ "$p" == "--suffix-each" ]]; then @@ -74,7 +74,7 @@ makeWrapper() { values="${params[$((n + 3))]}" n=$((n + 3)) for value in $values; do - echo "export $varName=\$$varName\${$varName:+$separator}$value" >> "$wrapper" + echo "export $varName=\$$varName\${$varName:+$separator}${value@Q}" >> "$wrapper" done elif [[ ("$p" == "--suffix-contents") || ("$p" == "--prefix-contents") ]]; then varName="${params[$((n + 1))]}" @@ -82,10 +82,11 @@ makeWrapper() { fileNames="${params[$((n + 3))]}" n=$((n + 3)) for fileName in $fileNames; do + contents="$(cat "$fileName")" if test "$p" = "--suffix-contents"; then - echo "export $varName=\$$varName\${$varName:+$separator}$(cat "$fileName")" >> "$wrapper" + echo "export $varName=\$$varName\${$varName:+$separator}${contents@Q}" >> "$wrapper" else - echo "export $varName=$(cat "$fileName")\${$varName:+$separator}\$$varName" >> "$wrapper" + echo "export $varName=${contents@Q}\${$varName:+$separator}\$$varName" >> "$wrapper" fi done elif [[ "$p" == "--add-flags" ]]; then From 2e49ed21d4253f1a6da88b8f20d2b667cdeff297 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Thu, 9 Nov 2017 11:09:11 -0800 Subject: [PATCH 04/69] libusb1: 1.0.20 -> 1.0.21 --- pkgs/development/libraries/libusb1/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix index dd2f1edc5f2a..44638b4dfd59 100644 --- a/pkgs/development/libraries/libusb1/default.nix +++ b/pkgs/development/libraries/libusb1/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit }: stdenv.mkDerivation rec { - name = "libusb-1.0.20"; + name = "libusb-1.0.21"; src = fetchurl { url = "mirror://sourceforge/libusb/${name}.tar.bz2"; - sha256 = "1zzp6hc7r7m3gl6zjbmzn92zkih4664cckaf49l1g5hapa8721fb"; + sha256 = "0jw2n5kdnrqvp7zh792fd6mypzzfap6jp4gfcmq4n6c1kb79rkkx"; }; outputs = [ "out" "dev" ]; # get rid of propagating systemd closure From c0a04ec2f537d21ab18d72d67cc65fe651598e14 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 14 Oct 2017 11:30:59 -0400 Subject: [PATCH 05/69] libiberty: Add dev output --- lib/maintainers.nix | 1 + pkgs/development/libraries/libiberty/default.nix | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/maintainers.nix b/lib/maintainers.nix index a29d4d308e86..f09869cda2d0 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -205,6 +205,7 @@ eqyiel = "Ruben Maher "; ericbmerritt = "Eric Merritt "; ericsagnes = "Eric Sagnes "; + ericson2314 = "John Ericson "; erictapen = "Justin Humm "; erikryb = "Erik Rybakken "; ertes = "Ertugrul Söylemez "; diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix index 1f5ab2cf0969..6608a3393b12 100644 --- a/pkgs/development/libraries/libiberty/default.nix +++ b/pkgs/development/libraries/libiberty/default.nix @@ -1,15 +1,18 @@ -{ stdenv, lib, fetchurl, gcc, staticBuild ? false }: +{ stdenv, fetchurl, gcc, staticBuild ? false }: stdenv.mkDerivation rec { name = "libiberty-${gcc.cc.version}"; inherit (gcc.cc) src; + outputs = [ "out" "dev" ]; + postUnpack = "sourceRoot=\${sourceRoot}/libiberty"; - configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared"; + configureFlags = [ "--enable-install-libiberty" ] + ++ stdenv.lib.optional (!staticBuild) "--enable-shared"; - postInstall = lib.optionalString (!staticBuild) '' + postInstall = stdenv.lib.optionalString (!staticBuild) '' cp pic/libiberty.a $out/lib*/libiberty.a ''; @@ -17,7 +20,7 @@ stdenv.mkDerivation rec { homepage = http://gcc.gnu.org/; license = licenses.lgpl2; description = "Collection of subroutines used by various GNU programs"; - maintainers = with maintainers; [ abbradar ]; + maintainers = with maintainers; [ abbradar ericson2314 ]; platforms = platforms.unix; }; } From de28bd48321a3e9ed5da005e69e01862e5551873 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 10 Oct 2017 18:48:42 -0400 Subject: [PATCH 06/69] bfd, opcodes: Init separate derivations for binutils libraries On most distros, these are just built and distributed as part of binutils. We don't use binutils across the board, however, but rather switch between binutils and a cctools-binutils mashup, and change the outputs on binutils too. This creates a combinatorial conditional soup which is hard to maintain. My hope is to lower the the state space. While my patch isn't the most maintainable, they make downstream packages become more maintainable to compensate. The additional derivations themselves are completely platform-agnostic, always they always supports all possible target platforms, and always yield "out" and "dev" outputs. That, in turn, allows downstream packages to not worry about a dependency shape-shifting under them. In fact, the actual binutils package can avoid needing multiple outputs now that these serve the requisite libraries, so that also can become simpler on all platforms, too, removing the original wart this PR circumnavigates for now. Actually changing the binutils package to leverage is a mass rebuild, however, so I'll leave that for a separate PR. I do hope to upstream something like my patch too, but until then I'll make myself maintainer of these derivations --- pkgs/development/libraries/libbfd/default.nix | 47 +++++ .../libraries/libopcodes/default.nix | 43 +++++ .../build-components-separately.patch | 178 ++++++++++++++++++ .../tools/misc/binutils/default.nix | 2 +- pkgs/top-level/all-packages.nix | 8 + 5 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/libbfd/default.nix create mode 100644 pkgs/development/libraries/libopcodes/default.nix create mode 100644 pkgs/development/tools/misc/binutils/build-components-separately.patch diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix new file mode 100644 index 000000000000..7709f5506751 --- /dev/null +++ b/pkgs/development/libraries/libbfd/default.nix @@ -0,0 +1,47 @@ +{ stdenv +, fetchurl, autoreconfHook264, bison, binutils +, libiberty, zlib +}: + +stdenv.mkDerivation rec { + name = "libbfd-${version}"; + inherit (binutils) version src; + + outputs = [ "out" "dev" ]; + + patches = binutils.patches ++ [ + ../../tools/misc/binutils/build-components-separately.patch + ]; + + # We just want to build libbfd + postPatch = '' + cd bfd + ''; + + nativeBuildInputs = [ autoreconfHook264 bison ]; + buildInputs = [ libiberty zlib ]; + + configurePlatforms = [ "build" "host" ]; + configureFlags = [ + "--enable-targets=all" "--enable-64-bit-bfd" + "--enable-install-libbfd" + "--enable-shared" + "--with-system-zlib" + ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "A library for manipulating containers of machine code"; + longDescription = '' + BFD is a library which provides a single interface to read and write + object files, executables, archive files, and core files in any format. + It is associated with GNU Binutils, and elsewhere often distributed with + it. + ''; + homepage = http://www.gnu.org/software/binutils/; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ericson2314 ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix new file mode 100644 index 000000000000..c064ca25c494 --- /dev/null +++ b/pkgs/development/libraries/libopcodes/default.nix @@ -0,0 +1,43 @@ +{ stdenv, buildPackages +, fetchurl, autoreconfHook264, bison, binutils +, libiberty, libbfd +}: + +stdenv.mkDerivation rec { + name = "libopcodes-${version}"; + inherit (binutils) version src; + + outputs = [ "out" "dev" ]; + + patches = binutils.patches ++ [ + ../../tools/misc/binutils/build-components-separately.patch + ]; + + # We just want to build libopcodes + postPatch = '' + cd opcodes + find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"//' \; + ''; + + nativeBuildInputs = [ autoreconfHook264 bison buildPackages.stdenv.cc ]; + buildInputs = [ libiberty ]; + # dis-asm.h includes bfd.h + propagatedBuildInputs = [ libbfd ]; + + configurePlatforms = [ "build" "host" ]; + configureFlags = [ + "--enable-targets=all" "--enable-64-bit-bfd" + "--enable-install-libbfd" + "--enable-shared" + ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "A library from binutils for manipulating machine code"; + homepage = http://www.gnu.org/software/binutils/; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ericson2314 ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/tools/misc/binutils/build-components-separately.patch b/pkgs/development/tools/misc/binutils/build-components-separately.patch new file mode 100644 index 000000000000..d3cd0d2131cc --- /dev/null +++ b/pkgs/development/tools/misc/binutils/build-components-separately.patch @@ -0,0 +1,178 @@ +From bc09a9236f67e710d545ac11bcdac7b55dbcc1a0 Mon Sep 17 00:00:00 2001 +From: John Ericson +Date: Thu, 12 Oct 2017 11:16:57 -0400 +Subject: [PATCH] Build components separately + +--- + bfd/configure.ac | 18 +++--------------- + opcodes/Makefile.am | 17 +++++++++++++---- + opcodes/configure.ac | 45 ++++++--------------------------------------- + 3 files changed, 22 insertions(+), 58 deletions(-) + +diff --git a/bfd/configure.ac b/bfd/configure.ac +index 9a183c1628..8728837384 100644 +--- a/bfd/configure.ac ++++ b/bfd/configure.ac +@@ -241,31 +241,19 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, + + LT_LIB_M + +-# When building a shared libbfd, link against the pic version of libiberty +-# so that apps that use libbfd won't need libiberty just to satisfy any +-# libbfd references. +-# We can't do that if a pic libiberty is unavailable since including non-pic +-# code would insert text relocations into libbfd. + SHARED_LIBADD= +-SHARED_LDFLAGS= ++SHARED_LDFLAGS=-liberty + if test "$enable_shared" = "yes"; then +-changequote(,)dnl +- x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` +-changequote([,])dnl +- if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" +- fi +- + # More hacks to build DLLs on Windows. + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" +- SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" ++ SHARED_LIBADD="-liberty -lintl -lcygwin -lkernel32" + ;; + + # Hack to build or1k-src on OSX + or1k*-*-darwin*) +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" ++ SHARED_LIBADD="-liberty -lintl" + ;; + esac + +diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am +index 925e7ff651..47b395c195 100644 +--- a/opcodes/Makefile.am ++++ b/opcodes/Makefile.am +@@ -52,7 +52,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir) + endif + + # This is where bfd.h lives. +-BFD_H = ../bfd/bfd.h ++BFD_H = $(BFDDIR)/bfd.h + + BUILD_LIBS = @BUILD_LIBS@ + BUILD_LIB_DEPS = @BUILD_LIB_DEPS@ +@@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@ + # development.sh is used to determine -Werror default. + CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh + +-AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@ ++AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@ + + disassemble.lo: disassemble.c + if am__fastdepCC +@@ -324,12 +324,21 @@ libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c + # old version of libbfd, or to pick up libbfd for the wrong architecture + # if host != build. So for building with shared libraries we use a + # hardcoded path to libbfd.so instead of relying on the entries in libbfd.la. +-libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ ++libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion + libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@ +-libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@ ++libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ + # Allow dependency tracking to work on all the source files. + EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES) + ++libtool-soversion: ++ @echo "creating $@" ++ bfd_soversion="$(VERSION)" ;\ ++ . $(BFDDIR)/development.sh ;\ ++ if test "$$development" = true ; then \ ++ bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ ++ fi ;\ ++ echo "$${bfd_soversion}" > $@ ++ + # libtool will build .libs/libopcodes.a. We create libopcodes.a in + # the build directory so that we don't have to convert all the + # programs that use libopcodes.a simultaneously. This is a hack which +diff --git a/opcodes/configure.ac b/opcodes/configure.ac +index b9f5eb8a4f..ef2c2152b7 100644 +--- a/opcodes/configure.ac ++++ b/opcodes/configure.ac +@@ -89,6 +89,7 @@ AC_PROG_INSTALL + + AC_CHECK_HEADERS(string.h strings.h stdlib.h limits.h) + ACX_HEADER_STRING ++GCC_HEADER_STDINT(bfd_stdint.h) + + AC_CHECK_DECLS([basename, stpcpy]) + +@@ -134,61 +135,27 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, + + LT_LIB_M + +-#Libs for generator progs +-if test "x$cross_compiling" = "xno"; then +- BUILD_LIBS=../libiberty/libiberty.a +- BUILD_LIB_DEPS=$BUILD_LIBS +-else +- # if cross-compiling, assume that the system provides -liberty +- # and that the version is compatible with new headers. +- BUILD_LIBS=-liberty +- BUILD_LIB_DEPS= +-fi +-BUILD_LIBS="$BUILD_LIBS $LIBINTL" +-BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP" ++BUILD_LIBS="-liberty $LIBINTL" ++BUILD_LIB_DEPS="$LIBINTL_DEP" + + AC_SUBST(BUILD_LIBS) + AC_SUBST(BUILD_LIB_DEPS) + + # Horrible hacks to build DLLs on Windows and a shared library elsewhere. + SHARED_LDFLAGS= +-SHARED_LIBADD= ++SHARED_LIBADD=-liberty + SHARED_DEPENDENCIES= + if test "$enable_shared" = "yes"; then +-# When building a shared libopcodes, link against the pic version of libiberty +-# so that apps that use libopcodes won't need libiberty just to satisfy any +-# libopcodes references. +-# We can't do that if a pic libiberty is unavailable since including non-pic +-# code would insert text relocations into libopcodes. + # Note that linking against libbfd as we do here, which is itself linked + # against libiberty, may not satisfy all the libopcodes libiberty references + # since libbfd may not pull in the entirety of libiberty. +-changequote(,)dnl +- x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` +-changequote([,])dnl +- if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" +- fi +- + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" +- SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" ++ SHARED_LIBADD="-lbfd -liberty -lintl -lcygwin" + ;; +- *-*-darwin*) +- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" +- SHARED_DEPENDENCIES="../bfd/libbfd.la" +- ;; + *) +- case "$host_vendor" in +- hp) +- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}" +- ;; +- *) +- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}" +- ;; +- esac +- SHARED_DEPENDENCIES="../bfd/libbfd.la" ++ SHARED_LIBADD="-lbfd ${SHARED_LIBADD}" + ;; + esac + +-- +2.14.2 + diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 62b4812fae5b..8a048958a0e1 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -96,7 +96,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; passthru = { - inherit prefix; + inherit prefix version; }; meta = with stdenv.lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 037aa8295d41..b8f638f2a84a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -77,6 +77,10 @@ with pkgs; { deps = [ autoconf automake gettext libtool ]; } ../build-support/setup-hooks/autoreconf.sh; + autoreconfHook264 = makeSetupHook + { deps = [ autoconf264 automake111x gettext libtool ]; } + ../build-support/setup-hooks/autoreconf.sh; + ensureNewerSourcesHook = { year }: makeSetupHook {} (writeScript "ensure-newer-sources-hook.sh" '' postUnpackHooks+=(_ensureNewerSources) @@ -7833,6 +7837,10 @@ with pkgs; belle-sip = callPackage ../development/libraries/belle-sip { }; + libbfd = callPackage ../development/libraries/libbfd { }; + + libopcodes = callPackage ../development/libraries/libopcodes { }; + bobcat = callPackage ../development/libraries/bobcat { }; boehmgc = callPackage ../development/libraries/boehm-gc { }; From f72bffb4c4178bf648bffff2a6692684f69551cd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 16 Oct 2017 14:46:37 -0400 Subject: [PATCH 07/69] eztrace: Misc cleanups - Use nativeBuildInputs - Use libraries opcodes and bfd, rather than all of binutils --- .../development/tools/profiling/EZTrace/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/profiling/EZTrace/default.nix b/pkgs/development/tools/profiling/EZTrace/default.nix index 004e5dbd46e5..98b38697992d 100644 --- a/pkgs/development/tools/profiling/EZTrace/default.nix +++ b/pkgs/development/tools/profiling/EZTrace/default.nix @@ -1,4 +1,8 @@ -{ stdenv, fetchurl, autoconf, libelf, libiberty, gfortran, zlib, binutils }: +{ stdenv +, fetchurl, autoconf, gfortran +, libelf, libiberty, zlib, libbfd, libopcodes +, buildPackages +}: stdenv.mkDerivation rec { version = "1.0.6"; @@ -9,12 +13,15 @@ stdenv.mkDerivation rec { sha256 = "06q5y9qmdn1h0wjmy28z6gwswskmph49j7simfqcqwv05gvd9svr"; }; - # Goes past the rpl_malloc linking failure + # Goes past the rpl_malloc linking failure; fixes silent file breakage preConfigure = '' export ac_cv_func_malloc_0_nonnull=yes + substituteInPlace ./configure \ + --replace "/usr/bin/file" "${buildPackages.file}/bin/file" ''; - buildInputs = [ autoconf libelf libiberty gfortran zlib binutils ]; + nativeBuildInputs = [ autoconf gfortran ]; + buildInputs = [ libelf libiberty zlib libbfd libopcodes ]; meta = { description = "Tool that aims at generating automatically execution trace from HPC programs"; From d7bddc27b23da8ce7bc19cfeeeb0cbebdb5a4410 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 10 Oct 2017 19:01:42 -0400 Subject: [PATCH 08/69] treewide: Try to avoid depending on binutils directly One should depend on - `stdenv.cc.bintools`: for executables at build time - `libbfd` or `libiberty`: for those libraries - `targetPackages.cc.bintools`: for exectuables at *run* time - `binutils`: only for specifically GNU Binutils's executables, regardless of the host platform, at run time. --- pkgs/development/interpreters/lush/default.nix | 4 ++-- pkgs/development/libraries/lightning/default.nix | 5 ++--- pkgs/development/tools/analysis/kcov/default.nix | 10 +++++++--- .../tools/profiling/oprofile/default.nix | 13 ++++++++----- .../development/tools/profiling/sysprof/default.nix | 8 +++++--- pkgs/tools/filesystems/grive/default.nix | 8 ++++---- pkgs/tools/filesystems/grive2/default.nix | 4 ++-- pkgs/tools/misc/diffoscope/default.nix | 4 ++-- pkgs/tools/package-management/rpm/default.nix | 7 +++++-- pkgs/tools/security/sbsigntool/default.nix | 10 ++++++---- pkgs/top-level/python-packages.nix | 2 +- 11 files changed, 44 insertions(+), 31 deletions(-) diff --git a/pkgs/development/interpreters/lush/default.nix b/pkgs/development/interpreters/lush/default.nix index a39e79badb6c..6958bd2465f5 100644 --- a/pkgs/development/interpreters/lush/default.nix +++ b/pkgs/development/interpreters/lush/default.nix @@ -1,5 +1,5 @@ {stdenv, fetchurl, libX11, xproto, indent, readline, gsl, freeglut, mesa, SDL -, blas, binutils, intltool, gettext, zlib, libSM}: +, blas, libbfd, intltool, gettext, zlib, libSM}: stdenv.mkDerivation rec { baseName = "lush"; @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ - libX11 libSM xproto indent readline gsl freeglut mesa SDL blas binutils + libX11 libSM xproto indent readline gsl freeglut mesa SDL blas libbfd intltool gettext zlib ]; diff --git a/pkgs/development/libraries/lightning/default.nix b/pkgs/development/libraries/lightning/default.nix index 5868fdf8b63a..b4a33bbe7df2 100644 --- a/pkgs/development/libraries/lightning/default.nix +++ b/pkgs/development/libraries/lightning/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, binutils }: +{ stdenv, fetchurl, libopcodes }: with stdenv.lib; stdenv.mkDerivation rec { @@ -11,8 +11,7 @@ stdenv.mkDerivation rec { sha256 = "19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz"; }; - # Needs libopcodes.so from binutils for 'make check' - buildInputs = [ binutils ]; + buildInputs = stdenv.lib.optional doCheck libopcodes; doCheck = true; diff --git a/pkgs/development/tools/analysis/kcov/default.nix b/pkgs/development/tools/analysis/kcov/default.nix index c960f54ab204..700e2b2126ca 100644 --- a/pkgs/development/tools/analysis/kcov/default.nix +++ b/pkgs/development/tools/analysis/kcov/default.nix @@ -1,4 +1,7 @@ -{stdenv, fetchurl, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, binutils}: +{ stdenv +, fetchurl, cmake, pkgconfig +, zlib, curl, elfutils, python, libiberty, libopcodes +}: stdenv.mkDerivation rec { name = "kcov-${version}"; @@ -10,8 +13,9 @@ stdenv.mkDerivation rec { }; preConfigure = "patchShebangs src/bin-to-c-source.py"; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ cmake zlib curl elfutils python libiberty binutils ]; + nativeBuildInputs = [ cmake pkgconfig ]; + + buildInputs = [ zlib curl elfutils python libiberty libopcodes ]; meta = with stdenv.lib; { description = "Code coverage tester for compiled programs, Python scripts and shell scripts"; diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix index dc447465b238..6087400af5be 100644 --- a/pkgs/development/tools/profiling/oprofile/default.nix +++ b/pkgs/development/tools/profiling/oprofile/default.nix @@ -1,5 +1,8 @@ -{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig, linuxHeaders, coreutils -, libiberty_static, withGUI ? false , qt4 ? null}: +{ stdenv, buildPackages +, fetchurl, pkgconfig +, libbfd, popt, zlib, linuxHeaders, libiberty_static +, withGUI ? false, qt4 ? null +}: # libX11 is needed because the Qt build stuff automatically adds `-lX11'. assert withGUI -> qt4 != null; @@ -14,12 +17,12 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace opjitconv/opjitconv.c \ - --replace "/bin/rm" "${coreutils}/bin/rm" \ - --replace "/bin/cp" "${coreutils}/bin/cp" + --replace "/bin/rm" "${buildPackages.coreutils}/bin/rm" \ + --replace "/bin/cp" "${buildPackages.coreutils}/bin/cp" ''; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ binutils zlib popt linuxHeaders libiberty_static ] + buildInputs = [ libbfd zlib popt linuxHeaders libiberty_static ] ++ stdenv.lib.optionals withGUI [ qt4 ]; configureFlags = [ diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix index 001560df0a04..a2ea3444db60 100644 --- a/pkgs/development/tools/profiling/sysprof/default.nix +++ b/pkgs/development/tools/profiling/sysprof/default.nix @@ -1,5 +1,7 @@ -{ fetchurl, stdenv, binutils -, pkgconfig, gtk2, glib, pango, libglade }: +{ stdenv +, fetchurl, pkgconfig +, gtk2, glib, pango, libglade +}: stdenv.mkDerivation rec { name = "sysprof-1.2.0"; @@ -10,7 +12,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ binutils gtk2 glib pango libglade ]; + buildInputs = [ gtk2 glib pango libglade ]; meta = { homepage = http://sysprof.com/; diff --git a/pkgs/tools/filesystems/grive/default.nix b/pkgs/tools/filesystems/grive/default.nix index 4e4a139f9adc..9f4472c27f19 100644 --- a/pkgs/tools/filesystems/grive/default.nix +++ b/pkgs/tools/filesystems/grive/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, binutils }: +{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, libiberty }: stdenv.mkDerivation rec { version = "0.3.0"; @@ -10,10 +10,10 @@ stdenv.mkDerivation rec { sha256 = "11cqfcjl128nfg1rjvpvr9x1x2ch3kyliw4vi14n51zqp82f9ysb"; }; - buildInputs = [cmake libgcrypt json_c curl expat stdenv binutils boost]; + buildInputs = [cmake libgcrypt json_c curl expat stdenv libiberty boost]; - # work around new binutils headers, see - # http://stackoverflow.com/questions/11748035/binutils-bfd-h-wants-config-h-now + # work around new libiberty headers, see + # http://stackoverflow.com/questions/11748035/libiberty-bfd-h-wants-config-h-now prePatch = '' sed -i '1i#define PACKAGE "grive"\n#define PACKAGE_VERSION "${version}"' \ libgrive/src/bfd/SymbolInfo.cc diff --git a/pkgs/tools/filesystems/grive2/default.nix b/pkgs/tools/filesystems/grive2/default.nix index a3ee1b67bab2..f4bb5592abdb 100644 --- a/pkgs/tools/filesystems/grive2/default.nix +++ b/pkgs/tools/filesystems/grive2/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, binutils }: +{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, libiberty }: stdenv.mkDerivation rec { version = "0.5.0"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkgconfig ]; - buildInputs = [ libgcrypt yajl curl expat stdenv boost binutils ]; + buildInputs = [ libgcrypt yajl curl expat stdenv boost libiberty ]; meta = with stdenv.lib; { description = "A console Google Drive client"; diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 3fd5bb7daa61..5b42c811bd20 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchgit, python3Packages, docutils -, acl, apktool, binutils, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc +, acl, apktool, libbfd, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc , e2fsprogs, file, findutils, fontforge-fonttools, fpc, gettext, ghc, ghostscriptX, giflib, gnupg1, gnutar , gzip, imagemagick, jdk, libarchive, libcaca, llvm, mono, openssh, pdftk, pgpdump, poppler_utils, sng, sqlite , squashfsTools, tcpdump, unoconv, unzip, xxd, xz @@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec { # Still missing these tools: docx2txt enjarify js-beautify oggDump Rscript # Also these libraries: python3-guestfs pythonPath = with python3Packages; [ debian libarchive-c python_magic tlsh rpm ] ++ [ - acl binutils bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils + acl libbfd bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils fontforge-fonttools gettext gnutar gzip libarchive libcaca pgpdump sng sqlite squashfsTools unzip xxd xz ] ++ lib.optionals enableBloat [ diff --git a/pkgs/tools/package-management/rpm/default.nix b/pkgs/tools/package-management/rpm/default.nix index 0e9ef3876d2b..25fcb8bc27e3 100644 --- a/pkgs/tools/package-management/rpm/default.nix +++ b/pkgs/tools/package-management/rpm/default.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchurl, cpio, zlib, bzip2, file, elfutils, libarchive, nspr, nss, popt, db, xz, python, lua, pkgconfig, binutils, autoreconfHook }: +{ stdenv +, pkgconfig, autoreconfHook +, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libarchive, nspr, nss, popt, db, xz, python, lua +}: stdenv.mkDerivation rec { name = "rpm-${version}"; @@ -15,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ cpio zlib bzip2 file libarchive nspr nss db xz python lua ]; # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements - propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive binutils ]; + propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive libbfd ]; NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss"; diff --git a/pkgs/tools/security/sbsigntool/default.nix b/pkgs/tools/security/sbsigntool/default.nix index b66564d58cee..bcf1a5c1f792 100644 --- a/pkgs/tools/security/sbsigntool/default.nix +++ b/pkgs/tools/security/sbsigntool/default.nix @@ -1,5 +1,7 @@ -{ stdenv, fetchgit, autoconf, automake, utillinux, openssl, libuuid, gnu-efi -, binutils, pkgconfig, help2man }: +{ stdenv +, fetchgit, autoconf, automake, pkgconfig, help2man +, utillinux, openssl, libuuid, gnu-efi, libbfd +}: stdenv.mkDerivation rec { name = "sbsigntool-${version}"; @@ -15,8 +17,8 @@ stdenv.mkDerivation rec { prePatch = "patchShebangs ."; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ autoconf automake utillinux openssl libuuid gnu-efi binutils help2man ]; + nativeBuildInputs = [ autoconf automake pkgconfig help2man ]; + buildInputs = [ utillinux openssl libuuid gnu-efi libbfd ]; configurePhase = '' substituteInPlace configure.ac --replace "@@NIX_GNUEFI@@" "${gnu-efi}" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f4a7f9996ebb..5df1b630b915 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15226,7 +15226,7 @@ in { preConfigure = '' substituteInPlace setup.py \ --replace '"/usr/include"' '"${pkgs.gdb}/include"' \ - --replace '"/usr/lib"' '"${pkgs.binutils.lib}/lib"' + --replace '"/usr/lib"' '"${pkgs.libbfd}/lib"' ''; meta = { From e65259f00cee799a6640a7ef5100f2bce3cb9d6f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 30 Oct 2017 14:56:34 -0400 Subject: [PATCH 09/69] LLVM: Get binutils plugin header from libbfd --- pkgs/development/compilers/llvm/3.4/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/3.5/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/3.7/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/3.8/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/3.9/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/4/llvm.nix | 4 ++-- pkgs/development/compilers/llvm/5/llvm.nix | 4 ++-- pkgs/development/compilers/mono/llvm.nix | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix index 6e7ef22392b1..27047e7d941c 100644 --- a/pkgs/development/compilers/llvm/3.4/llvm.nix +++ b/pkgs/development/compilers/llvm/3.4/llvm.nix @@ -6,7 +6,7 @@ , cmake , python2 , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -67,7 +67,7 @@ in stdenv.mkDerivation rec { "-DLLVM_BUILD_TESTS=ON" "-DLLVM_ENABLE_FFI=ON" "-DLLVM_REQUIRES_RTTI=1" - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" "-DCMAKE_CXX_FLAGS=-std=c++11" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "-DBUILD_SHARED_LIBS=ON"; diff --git a/pkgs/development/compilers/llvm/3.5/llvm.nix b/pkgs/development/compilers/llvm/3.5/llvm.nix index 26144e38619f..00b2548d56e6 100644 --- a/pkgs/development/compilers/llvm/3.5/llvm.nix +++ b/pkgs/development/compilers/llvm/3.5/llvm.nix @@ -6,7 +6,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -70,7 +70,7 @@ in stdenv.mkDerivation rec { ] ++ stdenv.lib.optional enableSharedLibraries "-DBUILD_SHARED_LIBS=ON" ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals ( isDarwin) [ "-DCMAKE_CXX_FLAGS=-stdlib=libc++" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix index 54ab8c108773..1654914ff8c4 100644 --- a/pkgs/development/compilers/llvm/3.7/llvm.nix +++ b/pkgs/development/compilers/llvm/3.7/llvm.nix @@ -6,7 +6,7 @@ , cmake , python2 , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -80,7 +80,7 @@ in stdenv.mkDerivation rec { ] ++ stdenv.lib.optional enableSharedLibraries "-DBUILD_SHARED_LIBS=ON" ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals ( isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix index a0fbdf2b706a..0f259977f702 100644 --- a/pkgs/development/compilers/llvm/3.8/llvm.nix +++ b/pkgs/development/compilers/llvm/3.8/llvm.nix @@ -6,7 +6,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -79,7 +79,7 @@ in stdenv.mkDerivation rec { ] ++ stdenv.lib.optional enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals ( isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 495f95a5bbdb..f80201167505 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -6,7 +6,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -123,7 +123,7 @@ in stdenv.mkDerivation rec { ] ++ stdenv.lib.optional enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index 332fee8529ba..0559a7aee232 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -6,7 +6,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -107,7 +107,7 @@ in stdenv.mkDerivation rec { "-DSPHINX_WARNINGS_AS_ERRORS=OFF" ] ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix index 011eab5678c1..520e42c33604 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm.nix @@ -6,7 +6,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -101,7 +101,7 @@ in stdenv.mkDerivation rec { "-DSPHINX_WARNINGS_AS_ERRORS=OFF" ] ++ stdenv.lib.optional (!isDarwin) - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" diff --git a/pkgs/development/compilers/mono/llvm.nix b/pkgs/development/compilers/mono/llvm.nix index 6a4fd784d236..8e9dcc1dbcb5 100644 --- a/pkgs/development/compilers/mono/llvm.nix +++ b/pkgs/development/compilers/mono/llvm.nix @@ -5,7 +5,7 @@ , cmake , python , libffi -, binutils +, libbfd , libxml2 , valgrind , ncurses @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { cmakeFlags = with stdenv; [ "-DLLVM_ENABLE_FFI=ON" - "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include" + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" "-DCMAKE_CXX_FLAGS=-std=c++11" ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON"; From f8741c38cd546e3ff18ce9d708de14ff2aae68ab Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 17 Oct 2017 16:44:24 -0400 Subject: [PATCH 10/69] binutils, gdb: Do not expose libbfd or libopcodes, and be multitarget There are separate derivations for these libraries and we don't want conflict. Multitarget is generally more useful, and will eventually speed up cross builds, so why not?! --- .../tools/misc/binutils/default.nix | 23 ++++++++-------- pkgs/development/tools/misc/gdb/default.nix | 27 ++++++++++++------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 8a048958a0e1..e38771acb9c2 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -50,13 +50,9 @@ stdenv.mkDerivation rec { ./no-plugins.patch ]; - outputs = [ "out" ] - ++ optional (targetPlatform == hostPlatform && !hostPlatform.isDarwin) "lib" # problems in Darwin stdenv - ++ [ "info" ] - ++ optional (targetPlatform == hostPlatform) "dev"; + outputs = [ "out" "info" ]; - nativeBuildInputs = [ bison ] - ++ optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc; + nativeBuildInputs = [ bison buildPackages.stdenv.cc ]; buildInputs = [ zlib ]; inherit noSysDirs; @@ -87,11 +83,16 @@ stdenv.mkDerivation rec { then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = - [ "--enable-shared" "--enable-deterministic-archives" "--disable-werror" ] - ++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop" - ++ optionals gold [ "--enable-gold" "--enable-plugins" ] - ++ optional (stdenv.system == "i686-linux") "--enable-targets=x86_64-linux-gnu"; + configureFlags = [ + "--enable-targets=all" "--enable-64-bit-bfd" + "--disable-install-libbfd" + "--disable-shared" "--enable-static" + "--with-system-zlib" + + "--enable-deterministic-archives" + "--disable-werror" + "--enable-fix-loongson2f-nop" + ] ++ optionals gold [ "--enable-gold" "--enable-plugins" ]; enableParallelBuilding = true; diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 6ecc6bc0e52f..d1148ad48d82 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -1,18 +1,19 @@ -{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo, zlib -, dejagnu, perl, pkgconfig +{ stdenv + +# Build time +, fetchurl, pkgconfig, perl, texinfo, setupDebugInfoDirs + +# Run time +, ncurses, readline, gmp, mpfr, expat, zlib, dejagnu , buildPlatform, hostPlatform, targetPlatform , pythonSupport ? hostPlatform == buildPlatform && !hostPlatform.isCygwin, python ? null , guile ? null -# Support all known targets in one gdb binary. -, multitarget ? false - # Additional dependencies for GNU/Hurd. , mig ? null, hurd ? null -, setupDebugInfoDirs }: let @@ -58,10 +59,16 @@ stdenv.mkDerivation rec { configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = with stdenv.lib; [ - "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline" - "--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}" - ] ++ stdenv.lib.optional (!pythonSupport) "--without-python" - ++ stdenv.lib.optional multitarget "--enable-targets=all"; + "--enable-targets=all" "--enable-64-bit-bfd" + "--disable-install-libbfd" + "--disable-shared" "--enable-static" + "--with-system-zlib" + "--with-system-readline" + + "--with-gmp=${gmp.dev}" + "--with-mpfr=${mpfr.dev}" + "--with-expat" "--with-libexpat-prefix=${expat.dev}" + ] ++ stdenv.lib.optional (!pythonSupport) "--without-python"; postInstall = '' # Remove Info files already provided by Binutils and other packages. diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index defac535532c..19bb99d20a87 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -57,6 +57,7 @@ mapAliases (rec { foomatic_filters = foomatic-filters; # 2016-08 fuse_exfat = exfat; # 2015-09-11 gettextWithExpat = gettext; # 2016-02-19 + gdb-multitarget = gdb; # added 2017-11-13 git-hub = gitAndTools.git-hub; # added 2016-04-29 googleAuthenticator = google-authenticator; # added 2016-10-16 grantlee5 = libsForQt5.grantlee; # added 2015-12-19 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b8f638f2a84a..4e31727849ce 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7680,8 +7680,6 @@ with pkgs; inherit (gnu) mig; }; - gdb-multitarget = lowPrio (gdb.override { multitarget = true; }); - valgrind = callPackage ../development/tools/analysis/valgrind { inherit (darwin) xnu bootstrap_cmds cctools; llvm = llvm_39; From ff023c9bc62e8ae663e617b7fc1ba9e3a9dc316a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 1 Nov 2017 11:14:34 -0400 Subject: [PATCH 11/69] treewide: Remove references to removed binutils outputs --- pkgs/stdenv/darwin/default.nix | 2 +- pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 1 - pkgs/stdenv/linux/make-bootstrap-tools.nix | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index a67ca53e1c54..c1c9127636f1 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -353,7 +353,7 @@ in rec { bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk gnugrep llvmPackages.clang-unwrapped patch pcre.out binutils-raw.out - binutils-raw.dev binutils gettext + binutils gettext cc.expand-response-params ]) ++ (with pkgs.darwin; [ dyld Libsystem CF cctools ICU libiconv locale diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index 90c9d2cef67f..8a1f7445b30b 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix @@ -179,7 +179,6 @@ rec { for i in as ld ar ranlib nm strip readelf objdump; do cp ${binutils.out}/bin/$i $out/bin done - cp -d ${binutils.lib}/lib/lib*.so* $out/lib chmod -R u+w $out diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 008daf8d5224..8f5272cc96a9 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -128,7 +128,6 @@ rec { for i in as ld ar ranlib nm strip readelf objdump; do cp ${binutils.out}/bin/$i $out/bin done - cp -d ${binutils.lib}/lib/lib*.so* $out/lib chmod -R u+w $out From f82063ed20f3b1ce4ae185e4d103f0fc3ff713fa Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Mon, 13 Nov 2017 21:03:43 -0500 Subject: [PATCH 12/69] darwin.stdenv: use new, purer, bootstrap tools This is the first step to getting a sandboxable nixpkgs --- pkgs/stdenv/darwin/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index a67ca53e1c54..36fa474b4314 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -4,15 +4,15 @@ # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools , bootstrapFiles ? let fetch = { file, sha256, executable ? true }: import { - url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/10cbca5b30c6cb421ce15139f32ae3a4977292cf/${file}"; + url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/d5bdfcbfe6346761a332918a267e82799ec954d2/${file}"; inherit (localSystem) system; inherit sha256 executable; }; in { - sh = fetch { file = "sh"; sha256 = "0s8a9vpzj6vadq4jmf4r8cargwnsf327hdjydxgqsfxb8y1q39w3"; }; - bzip2 = fetch { file = "bzip2"; sha256 = "1jqljpjr8mkiv7g5rl5impqx3all8vn1mxxdwa004pr3h48c1zgg"; }; - mkdir = fetch { file = "mkdir"; sha256 = "17zsjiwnq07i5r85q1hg7f6cnkcgllwy2amz9klaqwjy4vzz4vwh"; }; - cpio = fetch { file = "cpio"; sha256 = "04hrair58dgja6syh442pswiga5an9nl58ls57yknkn2pq51nx9m"; }; - tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "103833hrci0vwi1gi978hkp69rncicvpdszn87ffpf1cq0jzpa14"; executable = false; }; + sh = fetch { file = "sh"; sha256 = "07wm33f1yzfpcd3rh42f8g096k4cvv7g65p968j28agzmm2s7s8m"; }; + bzip2 = fetch { file = "bzip2"; sha256 = "0y9ri2aprkrp2dkzm6229l0mw4rxr2jy7vvh3d8mxv2698v2kdbm"; }; + mkdir = fetch { file = "mkdir"; sha256 = "0sb07xpy66ws6f2jfnpjibyimzb71al8n8c6y4nr8h50al3g90nr"; }; + cpio = fetch { file = "cpio"; sha256 = "0r5c54hg678w7zydx27bzl9p3v9fs25y5ix6vdfi1ilqim7xh65n"; }; + tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "18hp5w6klr8g307ap4368r255qpzg9r0vwg9vqvj8f2zy1xilcjf"; executable = false; }; } }: From 34fe3e0a493764a6eb9bafd249d38f3661afbd0d Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 14 Nov 2017 10:34:03 -0500 Subject: [PATCH 13/69] perl: remove unsupported sandboxProfile --- pkgs/development/interpreters/perl/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 97e395d2a6df..d2fff13e2ee4 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -44,7 +44,6 @@ let substituteInPlace dist/PathTools/Cwd.pm \ --replace "/bin/pwd" "$pwd" ''; - sandboxProfile = sandbox.allow "ipc-sysv-sem"; # Build a thread-safe Perl with a dynamic libperls.o. We need the # "installstyle" option to ensure that modules are put under From b2f818569523848762f5715a48540f9f2888083c Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 14 Nov 2017 10:34:28 -0500 Subject: [PATCH 14/69] configd: remove unsupported sandbox profile --- .../darwin/apple-source-releases/configd/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix index 2b31b0420402..20168d24dd71 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -8,10 +8,6 @@ appleDerivation { propagatedBuildInputs = [ Security ]; - propagatedSandboxProfile = '' - (allow mach-lookup (global-name "com.apple.SystemConfiguration.configd")) - ''; - patchPhase = '' HACK=$PWD/hack mkdir $HACK From 762a05cbb637352fa794d2e7a55018627ae76cc5 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 14 Nov 2017 10:35:18 -0500 Subject: [PATCH 15/69] cctools-port: add a couple of (temporary) impure dependencies --- pkgs/os-specific/darwin/cctools/port.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 1f2e7c143780..182b591a60aa 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -39,6 +39,12 @@ let ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ]; + __propagatedImpureHostDeps = [ + # As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them + "/usr/lib/libobjc.A.dylib" + "/usr/lib/libobjc.dylib" + ]; + enableParallelBuilding = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. From 49a5791bc4f201c118f7f22f07f232d8f3e6a7de Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 14 Nov 2017 10:36:04 -0500 Subject: [PATCH 16/69] darwin.stdenv: fix up to allow sandboxing --- .../apple-source-releases/xnu/default.nix | 4 +- pkgs/stdenv/darwin/default.nix | 29 ++++---- pkgs/stdenv/darwin/standard-sandbox.sb | 72 ------------------- 3 files changed, 17 insertions(+), 88 deletions(-) delete mode 100644 pkgs/stdenv/darwin/standard-sandbox.sb diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix index 0ce9c54e48c4..2c7da5be6e4c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix @@ -1,9 +1,9 @@ -{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl }: +{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl, python }: appleDerivation { phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl ]; + buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python ]; patchPhase = '' substituteInPlace Makefile \ diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 36fa474b4314..ea1848492cdc 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -21,9 +21,11 @@ assert crossSystem == null; let inherit (localSystem) system platform; - libSystemProfile = '' - (import "${./standard-sandbox.sb}") - ''; + commonImpureHostDeps = [ + "/bin/sh" + "/usr/lib/libSystem.B.dylib" + "/usr/lib/system/libunc.dylib" # This ependency is "hidden", so our scanning code doesn't pick it up + ]; in rec { commonPreHook = '' export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" @@ -37,11 +39,6 @@ in rec { export gl_cv_func_getcwd_abort_bug=no ''; - # The one dependency of /bin/sh :( - binShClosure = '' - (allow file-read* (literal "/usr/lib/libncurses.5.4.dylib")) - ''; - bootstrapTools = derivation rec { inherit system; @@ -53,7 +50,7 @@ in rec { reexportedLibrariesFile = ../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries; - __sandboxProfile = binShClosure + libSystemProfile; + __impureHostDeps = commonImpureHostDeps; }; stageFun = step: last: {shell ? "${bootstrapTools}/bin/bash", @@ -108,8 +105,8 @@ in rec { }; # The stdenvs themselves don't use mkDerivation, so I need to specify this here - stdenvSandboxProfile = binShClosure + libSystemProfile; - extraSandboxProfile = binShClosure + libSystemProfile; + __stdenvImpureHostDeps = commonImpureHostDeps; + __extraImpureHostDeps = commonImpureHostDeps; extraAttrs = { inherit platform; @@ -167,7 +164,7 @@ in rec { }; stage1 = prevStage: let - persistent = _: _: {}; + persistent = _: super: { python = super.python.override { configd = null; }; }; in with prevStage; stageFun 1 prevStage { extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; extraNativeBuildInputs = []; @@ -317,8 +314,8 @@ in rec { export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; - stdenvSandboxProfile = binShClosure + libSystemProfile; - extraSandboxProfile = binShClosure + libSystemProfile; + __stdenvImpureHostDeps = commonImpureHostDeps; + __extraImpureHostDeps = commonImpureHostDeps; initialPath = import ../common-path.nix { inherit pkgs; }; shell = "${pkgs.bash}/bin/bash"; @@ -364,6 +361,10 @@ in rec { clang = cc; llvmPackages = persistent'.llvmPackages // { clang = cc; }; inherit cc; + + darwin = super.darwin // { + xnu = super.darwin.xnu.override { python = super.python.override { configd = null; }; }; + }; }; }; diff --git a/pkgs/stdenv/darwin/standard-sandbox.sb b/pkgs/stdenv/darwin/standard-sandbox.sb deleted file mode 100644 index b87be89f35f2..000000000000 --- a/pkgs/stdenv/darwin/standard-sandbox.sb +++ /dev/null @@ -1,72 +0,0 @@ -(define TMPDIR (param "_GLOBAL_TMP_DIR")) - -; obvious -(allow process-fork) - -; allow reading system information like #CPUs, etc. -(allow sysctl-read) - -; IPC -(allow ipc-posix*) - -; Unix sockets -(allow system-socket) - -; all runtime dependencies of libSystem.dylib -(allow file-read* - (literal "/usr/lib/libSystem.dylib") - (literal "/usr/lib/libSystem.B.dylib") - (literal "/usr/lib/libobjc.A.dylib") - (literal "/usr/lib/libobjc.dylib") - (literal "/usr/lib/libauto.dylib") - (literal "/usr/lib/libc++abi.dylib") - (literal "/usr/lib/libc++.1.dylib") - (literal "/usr/lib/libDiagnosticMessagesClient.dylib") - (subpath "/usr/lib/system")) - -; tmp -(allow file* process-exec (literal "/tmp") (subpath TMPDIR)) - -; clang likes to read the system version -(allow file-read* (literal "/System/Library/CoreServices/SystemVersion.plist")) - -; used for bootstrap builders -(allow process-exec* (literal "/bin/sh")) - -; without this line clang cannot write to /dev/null, breaking some configure tests -(allow file-read-metadata (literal "/dev")) - -; standard devices -(allow file* - (literal "/dev/null") - (literal "/dev/random") - (literal "/dev/stdin") - (literal "/dev/stdout") - (literal "/dev/tty") - (literal "/dev/urandom") - (literal "/dev/zero") - (subpath "/dev/fd")) - -; does nothing, but reduces build noise -(allow file* (literal "/dev/dtracehelper")) - -; ICU data and zoneinfo data are hardcoded -; both are in libicucore and zoneinfo is in libsystem_c as well -(allow file-read* (subpath "/usr/share/icu") (subpath "/usr/share/zoneinfo")) - -; no idea what this is -(allow file-read-data (literal "/dev/autofs_nowait")) - -; lots of autoconf projects want to list this directory -(allow file-read-metadata (literal "/var") (literal "/private/var/tmp")) - -; send signals -(allow signal (target same-sandbox)) - -; allow getpwuid (for git and other packages) -(allow mach-lookup - (global-name "com.apple.system.notification_center") - (global-name "com.apple.system.opendirectoryd.libinfo")) - -; allow networking on localhost -(allow network* (local ip) (remote unix-socket)) From eaacf47ff45e3e2a1d90bca57c23d956d624eb5e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 14 Nov 2017 10:49:30 -0500 Subject: [PATCH 17/69] binutils: Make myself a maintainer --- pkgs/development/tools/misc/binutils/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index e38771acb9c2..83982b1376e9 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -110,6 +110,7 @@ stdenv.mkDerivation rec { ''; homepage = http://www.gnu.org/software/binutils/; license = licenses.gpl3Plus; + maintainers = with maintainers; [ ericson2314 ]; platforms = platforms.unix; /* Give binutils a lower priority than gcc-wrapper to prevent a From 72b98b8b60ec1bedbc727671c7c58902fbf70fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 14 Nov 2017 21:13:31 +0100 Subject: [PATCH 18/69] darwin.stdenv: fix a typo in comment ;-) --- pkgs/stdenv/darwin/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 7383e602c498..89c903b04a04 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -24,7 +24,7 @@ let commonImpureHostDeps = [ "/bin/sh" "/usr/lib/libSystem.B.dylib" - "/usr/lib/system/libunc.dylib" # This ependency is "hidden", so our scanning code doesn't pick it up + "/usr/lib/system/libunc.dylib" # This dependency is "hidden", so our scanning code doesn't pick it up ]; in rec { commonPreHook = '' From 1c1207220f06b751a42346f33d09582e66999a6d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 14 Nov 2017 16:08:46 -0500 Subject: [PATCH 19/69] gcc: Refactor treatment of configure flags Previously configureFlags was defined as one giant interpolated string. Here we refactor this definition to instead use the usual stdenv string combinators. This seems more in-line with the average nixpkgs expression and it seems a bit more natural to things of these as lists of flags rather than monolithic strings. --- .../development/compilers/gcc/4.5/default.nix | 235 ++++++------ .../development/compilers/gcc/4.8/default.nix | 350 ++++++++--------- .../development/compilers/gcc/4.9/default.nix | 348 ++++++++--------- pkgs/development/compilers/gcc/5/default.nix | 348 ++++++++--------- pkgs/development/compilers/gcc/6/default.nix | 360 +++++++++--------- pkgs/development/compilers/gcc/7/default.nix | 348 ++++++++--------- .../compilers/gcc/snapshot/default.nix | 348 ++++++++--------- 7 files changed, 1190 insertions(+), 1147 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index e7b188ad71b8..69022c2aa3d8 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -67,55 +67,53 @@ let version = "4.5.4"; gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform; gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatform; gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null targetPlatform; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); crossConfigureFlags = - withArch + - withCpu + - withAbi + + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + - (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libmudflap " + - " --disable-libgomp " + - " --disable-shared" + - " --disable-decimal-float" # libdecnumber requires libc - else - " --with-headers=${libcCross}/include" + - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --enable-version-specific-runtime-libs" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" - else - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) - ); + [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp --disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libmudflap" + "--disable-libgomp " + "--disable-shared" + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + "--with-headers=${libcCross}/include" + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-version-specific-runtime-libs" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + ] else [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" + ]) # No final libdecnumber (it may work only in 386) + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -241,44 +239,61 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if ppl != null then "--with-ppl=${ppl}" else ""} - ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp=${gmp.dev}" + "--with-mpfr=${mpfr.dev}" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ) + ) + }" + ] ++ + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + + # Optional features + optional (cloogppl != null) "--with-cloog=${cloogppl}" ++ + optional (ppl != null) "--with-ppl=${ppl}" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp=${gmp.dev} - --with-mpfr=${mpfr.dev} - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ) - ) - } - ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f - if targetPlatform == hostPlatform && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + # Trick that should be taken out once we have a mips64el-linux not loongson2f + optional (targetPlatform == hostPlatform && stdenv.system == "mips64el-linux") "--with-arch=loongson2f" + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -295,37 +310,41 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""} - ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + optional (ppl != null) "--with-ppl=${ppl.crossDrv}" ++ + optional (cloogppl != null) "--with-cloog=${cloogppl.crossDrv}" ++ + + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags + ; }; - + # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index ab91528049c4..7cba8296d83a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -108,102 +108,83 @@ let version = "4.8.5"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libmudflap " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot" - else " --with-headers=${libcCross.dev}/include") + - # Ensure that -print-prog-name is able to find the correct programs. - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp --disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) - ); + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] + ) + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -329,63 +310,87 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -404,11 +409,6 @@ stdenv.mkDerivation ({ xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -422,38 +422,40 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 794d809fa727..98df530d884c 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -99,107 +99,90 @@ let version = "4.9.4"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot" - else " --with-headers=${libcCross.dev}/include") + - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not # available in uclibc. - " --disable-libsanitizer" + + "--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ]) ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -326,61 +309,86 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr=${mpfr.dev}" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp=${gmp.dev} - --with-mpfr=${mpfr.dev} - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -393,17 +401,13 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -417,38 +421,40 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 345e2baf6718..fe9735d1fd62 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -103,107 +103,89 @@ let version = "5.5.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot" - else " --with-headers=${getDev libcCross}/include") + - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp --disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not # available in uclibc. - " --disable-libsanitizer" + + "--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) - ); + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] + ) + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -340,62 +322,86 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -408,17 +414,13 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -432,37 +434,39 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 03c6b3834ea4..f0d2ab6a914c 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -100,103 +100,86 @@ let version = "6.4.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot" - else " --with-headers=${getDev libcCross}/include") + - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - " --disable-libsanitizer" + - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) - ); + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ]) + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -341,85 +324,104 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals (hostPlatform.isSunOS) [ + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + " --with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = if bootstrap then - (if profiledCompiler then "profiledbootstrap" else "bootstrap") - else ""; + buildFlags = + optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap"); installTargets = if stripped then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -433,37 +435,39 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 3a7c0eb64437..e44b32ef9d37 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -98,108 +98,90 @@ let version = "7.2.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot" - else " --with-headers=${getDev libcCross}/include") + - # Ensure that -print-prog-name is able to find the correct programs. - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not # available in uclibc. - " --disable-libsanitizer" + + "--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ]) ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -335,62 +317,86 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -403,17 +409,13 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -427,37 +429,39 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, targetPlatform != hostPlatform NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index e235be639c6e..ed127effd7ed 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -98,108 +98,90 @@ let version = "7-20170409"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings */ + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot" - else " --with-headers=${getDev libcCross}/include") + - # Ensure that -print-prog-name is able to find the correct programs. - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not # available in uclibc. - " --disable-libsanitizer" + + "--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ]) ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -322,62 +304,86 @@ stdenv.mkDerivation ({ then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; - configureFlags = " - ${if hostPlatform.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 --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -390,17 +396,13 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -414,37 +416,39 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; From ab77a6bb1e7d2ff475210ad392f1a9bd1bb6ba3a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 14 Nov 2017 18:32:50 -0500 Subject: [PATCH 20/69] gcc: Misc indentation and whitespace-in-string fixes --- .../development/compilers/gcc/4.5/default.nix | 28 ++-- .../development/compilers/gcc/4.8/default.nix | 127 ++++++++-------- .../development/compilers/gcc/4.9/default.nix | 135 +++++++++--------- pkgs/development/compilers/gcc/5/default.nix | 126 ++++++++-------- pkgs/development/compilers/gcc/6/default.nix | 122 ++++++++-------- pkgs/development/compilers/gcc/7/default.nix | 127 ++++++++-------- .../compilers/gcc/snapshot/default.nix | 127 ++++++++-------- 7 files changed, 398 insertions(+), 394 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 69022c2aa3d8..088a64ff5438 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -74,8 +74,8 @@ let version = "4.5.4"; optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ optional (gccAbi != null) "--with-abi=${gccAbi}" ++ # Ensure that -print-prog-name is able to find the correct programs. - [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then [ "--with-headers=${libcCross}/include" "--with-gcc" @@ -88,19 +88,21 @@ let version = "4.5.4"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" - ] else if crossStageStatic then [ - "--disable-libssp --disable-nls" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" "--without-headers" "--disable-threads" "--disable-libmudflap" - "--disable-libgomp " + "--disable-libgomp" "--disable-shared" "--disable-decimal-float" # libdecnumber requires libc - ] else [ + ] else [ "--with-headers=${libcCross}/include" "--enable-__cxa_atexit" "--enable-long-long" - ] ++ (if crossMingw then [ + ] ++ + (if crossMingw then [ "--enable-threads=win32" "--enable-sjlj-exceptions" "--enable-hash-synchronization" @@ -108,12 +110,11 @@ let version = "4.5.4"; "--disable-libssp" "--disable-nls" "--with-dwarf2" - ] else [ + ] else [ "--enable-threads=posix" "--enable-nls" - "--disable-decimal-float" - ]) # No final libdecnumber (it may work only in 386) - ); + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -274,11 +275,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 7cba8296d83a..7003ace28905 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -123,68 +123,66 @@ let version = "4.8.5"; optional (gccFloat != null) "--with-float=${gccFloat}" ++ optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings (build == host != target) */ /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp --disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ] - ) - ); + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -347,7 +345,11 @@ stdenv.mkDerivation ({ # Optional features optional (isl != null) "--with-isl=${isl}" ++ - optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + optionals (cloog != null) [ + "--with-cloog=${cloog}" + "--disable-cloog-version-check" + "--enable-cloog-backend=isl" + ] ++ (if enableMultilib then ["--enable-multilib" "--disable-libquadmath"] @@ -359,11 +361,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -386,9 +389,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 98df530d884c..362670ff5dbd 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -118,67 +118,65 @@ let version = "4.9.4"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -353,15 +351,20 @@ stdenv.mkDerivation ({ # Optional features optional (isl != null) "--with-isl=${isl}" ++ - optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + optionals (cloog != null) [ + "--with-cloog=${cloog}" + "--disable-cloog-version-check" + "--enable-cloog-backend=isl" + ] ++ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -384,9 +387,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; @@ -427,7 +430,7 @@ stdenv.mkDerivation ({ optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++ + optional (cloog != null) "--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl" ++ [ "--with-gmp=${gmp.crossDrv}" "--with-mpfr=${mpfr.crossDrv}" diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index fe9735d1fd62..c9b49c0ede63 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -122,66 +122,65 @@ let version = "5.5.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp --disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ] - ) - ); + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -370,11 +369,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -397,9 +397,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index f0d2ab6a914c..a68946a6f345 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -119,67 +119,65 @@ let version = "6.4.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then [ - "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads" - "--disable-libgomp" - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -372,7 +370,7 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . @@ -399,9 +397,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals (hostPlatform.isSunOS) [ - " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - " --with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index e44b32ef9d37..c201ca6373b7 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -117,67 +117,65 @@ let version = "7.2.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -365,11 +363,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -392,9 +391,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index ed127effd7ed..2e0a49957c02 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -117,67 +117,65 @@ let version = "7-20170409"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ + mkPlatformFlags targetPlatform ++ - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -352,11 +350,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -379,9 +378,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; From 0fe7bde3d88027977a07a24baee98d2ecc07222f Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Mon, 30 Oct 2017 16:19:15 +0100 Subject: [PATCH 21/69] Delete lib/sandbox.nix for now --- lib/sandbox.nix | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 lib/sandbox.nix diff --git a/lib/sandbox.nix b/lib/sandbox.nix deleted file mode 100644 index 2cdeb40938ad..000000000000 --- a/lib/sandbox.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ lib }: -with lib.strings; - -/* Helpers for creating lisp S-exprs for the Apple sandbox - -lib.sandbox.allowFileRead [ "/usr/bin/file" ]; - # => "(allow file-read* (literal \"/usr/bin/file\"))"; - -lib.sandbox.allowFileRead { - literal = [ "/usr/bin/file" ]; - subpath = [ "/usr/lib/system" ]; -} - # => "(allow file-read* (literal \"/usr/bin/file\") (subpath \"/usr/lib/system\"))" -*/ - -let - -sexp = tokens: "(" + builtins.concatStringsSep " " tokens + ")"; -generateFileList = files: - if builtins.isList files - then concatMapStringsSep " " (x: sexp [ "literal" ''"${x}"'' ]) files - else if builtins.isString files - then generateFileList [ files ] - else concatStringsSep " " ( - (map (x: sexp [ "literal" ''"${x}"'' ]) (files.literal or [])) ++ - (map (x: sexp [ "subpath" ''"${x}"'' ]) (files.subpath or [])) - ); -applyToFiles = f: act: files: f "${act} ${generateFileList files}"; -genActions = actionName: let - action = feature: sexp [ actionName feature ]; - self = { - "${actionName}" = action; - "${actionName}File" = applyToFiles action "file*"; - "${actionName}FileRead" = applyToFiles action "file-read*"; - "${actionName}FileReadMetadata" = applyToFiles action "file-read-metadata"; - "${actionName}DirectoryList" = self."${actionName}FileReadMetadata"; - "${actionName}FileWrite" = applyToFiles action "file-write*"; - "${actionName}FileWriteMetadata" = applyToFiles action "file-write-metadata"; - }; - in self; - -in - -genActions "allow" // genActions "deny" // { - importProfile = derivation: '' - (import "${derivation}") - ''; -} From 10220de35ebf78555b5d164d2fb1b9b238180e80 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Tue, 31 Oct 2017 12:20:22 +0100 Subject: [PATCH 22/69] Fix a couple of python modules to work in sandbox --- pkgs/development/python-modules/cffi/default.nix | 14 ++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 16 insertions(+) diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index b0524b4121ad..f8e313d660eb 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -17,6 +17,20 @@ if isPyPy then null else buildPythonPackage rec { propagatedBuildInputs = [ libffi pycparser ]; buildInputs = [ pytest ]; + # On Darwin, the cffi tests want to hit libm a lot, and look for it in a global + # impure search path. It's obnoxious how much repetition there is, and how difficult + # it is to get it to search somewhere else (since we do actually have a libm symlink in libSystem) + prePatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace testing/cffi0/test_parsing.py \ + --replace 'lib_m = "m"' 'lib_m = "System"' \ + --replace '"libm" in name' '"libSystem" in name' + substituteInPlace testing/cffi0/test_unicode_literals.py --replace 'lib_m = "m"' 'lib_m = "System"' + substituteInPlace testing/cffi0/test_zdistutils.py --replace 'self.lib_m = "m"' 'self.lib_m = "System"' + substituteInPlace testing/cffi1/test_recompiler.py --replace 'lib_m = "m"' 'lib_m = "System"' + substituteInPlace testing/cffi0/test_function.py --replace "lib_m = 'm'" "lib_m = 'System'" + substituteInPlace testing/cffi0/test_verify.py --replace "lib_m = ['m']" "lib_m = ['System']" + ''; + # The tests use -Werror but with python3.6 clang detects some unreachable code. NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5df1b630b915..2acfa029088f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14095,6 +14095,8 @@ in { propagatedBuildInputs = with self; [ cryptography pyasn1 ]; + __darwinAllowLocalNetworking = true; + # https://github.com/paramiko/paramiko/issues/449 doCheck = !(isPyPy || isPy33); checkPhase = '' From 7dc0cab79452c0650722e678414da61735e2f651 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Mon, 30 Oct 2017 19:45:17 +0100 Subject: [PATCH 23/69] Fix go bootstrap build on sandbox --- pkgs/development/compilers/go/1.4.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix index 2a1944debd91..b8c283fef07e 100644 --- a/pkgs/development/compilers/go/1.4.nix +++ b/pkgs/development/compilers/go/1.4.nix @@ -23,6 +23,9 @@ stdenv.mkDerivation rec { hardeningDisable = [ "all" ]; + # The tests try to do stuff with 127.0.0.1 and localhost + __darwinAllowLocalNetworking = true; + # I'm not sure what go wants from its 'src', but the go installation manual # describes an installation keeping the src. preUnpack = '' From f63f05ef5f6929e70e69708f515b72e212c03e79 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 31 Oct 2017 11:32:06 +0100 Subject: [PATCH 24/69] python-execnet: fix sandbox build on darwin --- pkgs/top-level/python-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2acfa029088f..d8d4e680893e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4976,6 +4976,7 @@ in { checkPhase = '' py.test testing ''; + __darwinAllowLocalNetworking = true; meta = { description = "Rapid multi-Python deployment"; license = licenses.gpl2; From dadcca3f4048fb7233b3a0b324fa3c5daa2202d2 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 31 Oct 2017 11:20:18 +0100 Subject: [PATCH 25/69] frameworks-coremedia: add impure dependnecy on CoreImage Fixes ffmpeg sandbox build on darwin --- pkgs/os-specific/darwin/apple-sdk/default.nix | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 9a6624104f45..5a58410ae926 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -198,6 +198,22 @@ in rec { }; overrides = super: { + AppKit = stdenv.lib.overrideDerivation super.AppKit (drv: { + __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ + "/System/Library/PrivateFrameworks/" + ]; + }); + + CoreMedia = stdenv.lib.overrideDerivation super.CoreMedia (drv: { + __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ + "/System/Library/Frameworks/CoreImage.framework" + ]; + }); + + Security = stdenv.lib.overrideDerivation super.Security (drv: { + setupHook = ./security-setup-hook.sh; + }); + QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: { installPhase = drv.installPhase + '' f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h" @@ -205,16 +221,6 @@ in rec { --replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage" ''; }); - - CoreServices = stdenv.lib.overrideDerivation super.CoreServices (drv: { - __propagatedSandboxProfile = drv.__propagatedSandboxProfile ++ ['' - (allow mach-lookup (global-name "com.apple.CoreServices.coreservicesd")) - '']; - }); - - Security = stdenv.lib.overrideDerivation super.Security (drv: { - setupHook = ./security-setup-hook.sh; - }); }; bareFrameworks = stdenv.lib.mapAttrs framework (import ./frameworks.nix { From 8a43659e15df297b0cfb6ba993eea2b87e282756 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 31 Oct 2017 07:37:15 +0100 Subject: [PATCH 26/69] rustc: fix sandbox build on darwin --- pkgs/development/compilers/rust/binaryBuild.nix | 9 ++++++++- pkgs/development/compilers/rust/bootstrap.nix | 4 ++-- pkgs/development/compilers/rust/rustc.nix | 10 +++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix index 37b06555bdbd..cbe92df814cb 100644 --- a/pkgs/development/compilers/rust/binaryBuild.nix +++ b/pkgs/development/compilers/rust/binaryBuild.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl +{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl, darwin , version , src , platform @@ -36,6 +36,8 @@ rec { phases = ["unpackPhase" "installPhase"]; + propagatedBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security; + installPhase = '' ./install.sh --prefix=$out \ --components=${installComponents} @@ -49,6 +51,11 @@ rec { --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ "$out/bin/cargo" ''} + ${optionalString (stdenv.isDarwin && bootstrapping) '' + install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo" + install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo" + install_name_tool -change /usr/lib/libz.1.dylib '${stdenv.lib.getLib zlib}/lib/libz.1.dylib' "$out/bin/cargo" + ''} ${optionalString needsPatchelf '' patchelf \ diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix index fbcac09fc458..d9aa3f757a4e 100644 --- a/pkgs/development/compilers/rust/bootstrap.nix +++ b/pkgs/development/compilers/rust/bootstrap.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, makeWrapper, cacert, zlib, curl }: +{ stdenv, fetchurl, makeWrapper, cacert, zlib, curl, darwin }: let # Note: the version MUST be one version prior to the version we're @@ -30,7 +30,7 @@ let }; in import ./binaryBuild.nix - { inherit stdenv fetchurl makeWrapper cacert zlib curl; + { inherit stdenv fetchurl makeWrapper cacert zlib curl darwin; buildRustPackage = null; inherit version src platform; versionType = "bootstrap"; diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 9f96d05c1163..4d92566edd4a 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation { inherit src; - __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ]; + __darwinAllowLocalNetworking = true; NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib"; @@ -109,6 +109,14 @@ stdenv.mkDerivation { # Disable all lldb tests. # error: Can't run LLDB test because LLDB's python path is not set rm -vr src/test/debuginfo/* + + # Disable tests that fail when sandboxing is enabled. + substituteInPlace src/libstd/sys/unix/ext/net.rs \ + --replace '#[test]' '#[test] #[ignore]' + substituteInPlace src/test/run-pass/env-home-dir.rs \ + --replace 'home_dir().is_some()' true + rm -v src/test/run-pass/fds-are-cloexec.rs # FIXME: pipes? + rm -v src/test/run-pass/sync-send-in-std.rs # FIXME: ??? ''; preConfigure = '' From 95997376c0e5a055da147231a1c24afb54eeec48 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 30 Oct 2017 21:02:07 +0100 Subject: [PATCH 27/69] perl-nethttp: fix sandbox build on darwin --- pkgs/top-level/perl-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index dc369d54782a..a05462306328 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -10277,6 +10277,7 @@ let self = _self // overrides; _self = with self; { sha256 = "8565aff76b3d09084642f3a83c654fb4ced8220e8e19d35c78b661519b4c1be6"; }; propagatedBuildInputs = [ URI ]; + __darwinAllowLocalNetworking = true; meta = { homepage = https://github.com/libwww-perl/Net-HTTP; description = "Low-level HTTP connection (client)"; From 9a244374110af2be1986f8dc00f7ce178e798cd1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 15 Nov 2017 11:59:54 -0500 Subject: [PATCH 28/69] libbfd, libopcodes: Fix eval on Darwin Not sure how I missed this... --- pkgs/development/libraries/libbfd/default.nix | 6 +++--- pkgs/development/libraries/libopcodes/default.nix | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix index 7709f5506751..700c5a928e55 100644 --- a/pkgs/development/libraries/libbfd/default.nix +++ b/pkgs/development/libraries/libbfd/default.nix @@ -1,15 +1,15 @@ { stdenv -, fetchurl, autoreconfHook264, bison, binutils +, fetchurl, autoreconfHook264, bison, binutils-raw , libiberty, zlib }: stdenv.mkDerivation rec { name = "libbfd-${version}"; - inherit (binutils) version src; + inherit (binutils-raw) version src; outputs = [ "out" "dev" ]; - patches = binutils.patches ++ [ + patches = binutils-raw.patches ++ [ ../../tools/misc/binutils/build-components-separately.patch ]; diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix index c064ca25c494..f3e12db39819 100644 --- a/pkgs/development/libraries/libopcodes/default.nix +++ b/pkgs/development/libraries/libopcodes/default.nix @@ -1,15 +1,15 @@ { stdenv, buildPackages -, fetchurl, autoreconfHook264, bison, binutils +, fetchurl, autoreconfHook264, bison, binutils-raw , libiberty, libbfd }: stdenv.mkDerivation rec { name = "libopcodes-${version}"; - inherit (binutils) version src; + inherit (binutils-raw) version src; outputs = [ "out" "dev" ]; - patches = binutils.patches ++ [ + patches = binutils-raw.patches ++ [ ../../tools/misc/binutils/build-components-separately.patch ]; From 3aa914ceeb8371feb53f83358db1735f9de64536 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 16 Nov 2017 01:53:51 +0800 Subject: [PATCH 29/69] libuv: 1.15.0 -> 1.16.1 --- pkgs/development/libraries/libuv/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index 8dea502a4ff4..ba745010504b 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -2,14 +2,14 @@ , ApplicationServices, CoreServices }: stdenv.mkDerivation rec { - version = "1.15.0"; + version = "1.16.1"; name = "libuv-${version}"; src = fetchFromGitHub { owner = "libuv"; repo = "libuv"; rev = "v${version}"; - sha256 = "092hxqjvbb6d03h3msc38359w2kixba1ansyrsbyqq8iqiqwnkw0"; + sha256 = "06p3xy276spqbr9xzbs7qlpdk34qsn87s2qmp6xn4j7v3bnqja7z"; }; postPatch = let From bf134bac8d2154097e17a71bd80df20fc3d786ec Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 16 Nov 2017 01:54:52 +0800 Subject: [PATCH 30/69] nodejs: 9.0.0 -> 9.2.0 --- pkgs/development/web/nodejs/v9.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/nodejs/v9.nix b/pkgs/development/web/nodejs/v9.nix index aa51421253fb..8a1cd2d148d1 100644 --- a/pkgs/development/web/nodejs/v9.nix +++ b/pkgs/development/web/nodejs/v9.nix @@ -5,7 +5,7 @@ let in buildNodejs { inherit enableNpm; - version = "9.0.0"; - sha256 = "19az7mxcb3d1aj0f7gvhriyyghn1rwn0425924pa84d6j1mbsljv"; + version = "9.2.0"; + sha256 = "1hmvwfbavk2axqz9kin8b5zsld25gznhvlz55h3yl6nwx9iz5jk4"; patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ]; } From 171d0e3ac70604a2396a08798281e7ae754c28c1 Mon Sep 17 00:00:00 2001 From: Maik Figura Date: Wed, 15 Nov 2017 21:25:32 +0100 Subject: [PATCH 31/69] pytest: 3.2.3 -> 3.2.5 --- pkgs/development/python-modules/pytest/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 42a591e58b64..bb2e19c5233d 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -2,7 +2,7 @@ , setuptools_scm }: buildPythonPackage rec { - version = "3.2.3"; + version = "3.2.5"; pname = "pytest"; name = "${pname}-${version}"; @@ -13,7 +13,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "27fa6617efc2869d3e969a3e75ec060375bfb28831ade8b5cdd68da3a741dc3c"; + sha256 = "6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81"; }; buildInputs = [ hypothesis setuptools_scm ]; From 6a5cda5131e094da3d28969af0512046c4fd81a5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 8 Nov 2017 13:43:28 -0500 Subject: [PATCH 32/69] stdenv setup: Run setup hooks and other processing after accumulating deps I find the separation of concerns, accumulating, then processing, easier to follow. Also, with my yet-to-be-merged cross work, the accumulation part will become more complex. --- pkgs/stdenv/generic/setup.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 02da3829c5ae..ee25013d5a59 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -324,6 +324,18 @@ findInputs() { exit 1 fi + if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then + local pkgNext + for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do + findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile" + done + fi +} + +# Add package to the future PATH and run setup hooks +activatePackage() { + local pkg="$1" + if [ -f "$pkg" ]; then local oldOpts="$(shopt -po nounset)" set +u @@ -341,13 +353,6 @@ findInputs() { source "$pkg/nix-support/setup-hook" eval "$oldOpts" fi - - if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then - local pkgNext - for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do - findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile" - done - fi } declare -a nativePkgs crossPkgs @@ -359,15 +364,22 @@ if [ -z "${crossConfig:-}" ]; then ${propagatedNativeBuildInputs:-} ${propagatedBuildInputs:-}; do findInputs "$i" nativePkgs propagated-native-build-inputs done + + for i in "${nativePkgs[@]}"; do + activatePackage "$i" + done else for i in ${buildInputs:-} ${defaultBuildInputs:-} ${propagatedBuildInputs:-}; do findInputs "$i" crossPkgs propagated-build-inputs done - declare -a nativePkgs for i in ${nativeBuildInputs:-} ${defaultNativeBuildInputs:-} ${propagatedNativeBuildInputs:-}; do findInputs "$i" nativePkgs propagated-native-build-inputs done + + for i in "${nativePkgs[@]}" "${crossPkgs[@]}"; do + activatePackage "$i" + done fi From 32a6838bc6cfd07b1a0e18368468ba825b4b18c2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 16 Nov 2017 17:40:38 -0500 Subject: [PATCH 33/69] darwin-bintuils: Don't try to bring in missing bits of GNU Binutils libbfd and libopcdes are separate derivations which now provide all headers and libraries. Binutils should just provide executables. --- pkgs/os-specific/darwin/binutils/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 5fc0db44f860..e38272593d00 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -37,17 +37,12 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${stdenv.lib.getDev binutils-raw}/include/*.h; do - ln -s "$i" "$out/include/$(basename $i)" - done - for i in ${cctools}/include/*; do ln -s "$i" "$out/include/$(basename $i)" done # FIXME: this will give us incorrect man pages for bits of cctools ln -s ${binutils-raw.out}/share $out/share - ln -s ${binutils-raw.out}/lib $out/lib ln -s ${cctools}/libexec $out/libexec ''; From 652c2beda9a5351ddd07e422215100aca75412ae Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 16 Nov 2017 15:00:28 -0500 Subject: [PATCH 34/69] cctools: Don't always bring in headers - Give cctools a dev output for the headers - Update Libsystem to grab the headers from that dev output - Don't include the headers in Darwin binutils, just as GNU Binutils no longer does. --- .../darwin/apple-source-releases/Libsystem/default.nix | 2 +- pkgs/os-specific/darwin/binutils/default.nix | 4 ---- pkgs/os-specific/darwin/cctools/port.nix | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 3d7e59f15547..28406c9751dc 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -23,7 +23,7 @@ appleDerivation rec { (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include) done - (cd ${cctools}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) + (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) cat < $out/include/TargetConditionals.h #ifndef __TARGETCONDITIONALS__ diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index e38272593d00..8ac93689373d 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -37,10 +37,6 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${cctools}/include/*; do - ln -s "$i" "$out/include/$(basename $i)" - done - # FIXME: this will give us incorrect man pages for bits of cctools ln -s ${binutils-raw.out}/share $out/share diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 1f2e7c143780..8fd2cb715a01 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -29,6 +29,8 @@ let sha256 = "0l45mvyags56jfi24rawms8j2ihbc45mq7v13pkrrwppghqrdn52"; }; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ autoconf automake libtool_2 ]; buildInputs = [ libuuid ] ++ # Only need llvm and clang if the stdenv isn't already clang-based (TODO: just make a stdenv.cc.isClang) From 020a6663d319c7b4af5c0219bc451abdac12f62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 12 Nov 2017 09:47:30 +0100 Subject: [PATCH 35/69] SDL2: disable parallel building Example failure: https://hydra.nixos.org/build/63996552 (cherry picked from commit 80e8e555b4c2cd90701bbff664b1c8db6e81fd2f) --- pkgs/development/libraries/SDL2/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index d2ffa45626be..d75aea726e10 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -54,7 +54,9 @@ stdenv.mkDerivation rec { # https://bugzilla.libsdl.org/show_bug.cgi?id=1431 dontDisableStatic = true; - enableParallelBuilding = true; + # /build/SDL2-2.0.7/src/video/wayland/SDL_waylandevents.c:41:10: fatal error: + # pointer-constraints-unstable-v1-client-protocol.h: No such file or directory + enableParallelBuilding = false; # XXX: By default, SDL wants to dlopen() PulseAudio, in which case # we must arrange to add it to its RPATH; however, `patchelf' seems From 035b5892457d7d198090dc6a68cac2b99d2fec52 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 17 Nov 2017 06:37:25 +0000 Subject: [PATCH 36/69] glibc: support obsolete "compat" in nsswitch.conf Fixes #31700. See https://bugs.archlinux.org/task/54592. --- pkgs/development/libraries/glibc/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 7894d75fbe67..86f3be15fea6 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -91,6 +91,7 @@ stdenv.mkDerivation ({ configureFlags = [ "-C" "--enable-add-ons" + "--enable-obsolete-nsl" "--enable-obsolete-rpc" "--sysconfdir=/etc" "--enable-stackguard-randomization" From f9cb7a03222b937d4e8a9f484403600a56da4ef4 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 17 Nov 2017 15:04:00 +0800 Subject: [PATCH 37/69] czmq: Fix build with gcc-7 --- pkgs/development/libraries/czmq/3.x.nix | 2 ++ pkgs/development/libraries/czmq/4.x.nix | 9 ++++++- .../libraries/czmq/czmq3-gcc7.patch | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/czmq/czmq3-gcc7.patch diff --git a/pkgs/development/libraries/czmq/3.x.nix b/pkgs/development/libraries/czmq/3.x.nix index 0b4aeeb0801d..9c9d85134224 100644 --- a/pkgs/development/libraries/czmq/3.x.nix +++ b/pkgs/development/libraries/czmq/3.x.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb"; }; + patches = [ ./czmq3-gcc7.patch ]; + # Fix build on Glibc 2.24. NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; diff --git a/pkgs/development/libraries/czmq/4.x.nix b/pkgs/development/libraries/czmq/4.x.nix index 971d15686cab..840fa34d6ae1 100644 --- a/pkgs/development/libraries/czmq/4.x.nix +++ b/pkgs/development/libraries/czmq/4.x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, zeromq }: +{ stdenv, fetchurl, fetchpatch, zeromq }: stdenv.mkDerivation rec { version = "4.0.2"; @@ -9,6 +9,13 @@ stdenv.mkDerivation rec { sha256 = "12gbh57xnz2v82x1g80gv4bwapmyzl00lbin5ix3swyac8i7m340"; }; + patches = [ + (fetchpatch { + url = https://patch-diff.githubusercontent.com/raw/zeromq/czmq/pull/1618.patch; + sha256 = "1dssy7k0fni6djail8rz0lk8p777158jvrqhgn500i636gkxaxhp"; + }) + ]; + # Needs to be propagated for the .pc file to work propagatedBuildInputs = [ zeromq ]; diff --git a/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/pkgs/development/libraries/czmq/czmq3-gcc7.patch new file mode 100644 index 000000000000..4ab14685a6c1 --- /dev/null +++ b/pkgs/development/libraries/czmq/czmq3-gcc7.patch @@ -0,0 +1,26 @@ +diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc +index 37dbb4eb..727aaa9b 100644 +--- a/src/zgossip_engine.inc ++++ b/src/zgossip_engine.inc +@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string) + { + if (client) { + s_client_t *self = (s_client_t *) client; +- snprintf (self->log_prefix, sizeof (self->log_prefix) - 1, ++ snprintf (self->log_prefix, sizeof (self->log_prefix), + "%6d:%-33s", self->unique_id, string); + } + } +diff --git a/src/zsys.c b/src/zsys.c +index 4d0bb8a1..f07db9c8 100644 +--- a/src/zsys.c ++++ b/src/zsys.c +@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user) + } + } + // We record the current process id in the lock file +- char pid_buffer [10]; ++ char pid_buffer [32]; + snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ()); + if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) { + zsys_error ("cannot write to lockfile: %s", strerror (errno)); From 4199892768b412a22de303cb392b698887deecb4 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 17 Nov 2017 10:11:01 +0000 Subject: [PATCH 38/69] makeWrapper: add --set-default and --set-eval After #31497 starter quoting all values, there arouse the need to left some values evaluated. `--set-default var value` expands to `export var=${var-value}`, where value is not evaluated and literally assigned to var unless it is already set. `--set-eval var value` expands to `export var=$(eval echo value)`, where value is evaluated by `eval`. --- pkgs/build-support/setup-hooks/make-wrapper.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index 01410828d39d..ab24fb38b29e 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -48,6 +48,16 @@ makeWrapper() { value="${params[$((n + 2))]}" n=$((n + 2)) echo "export $varName=${value@Q}" >> "$wrapper" + elif [[ "$p" == "--set-default" ]]; then + varName="${params[$((n + 1))]}" + value="${params[$((n + 2))]}" + n=$((n + 2)) + echo "export $varName=\${$varName-${value@Q}}" >> "$wrapper" + elif [[ "$p" == "--set-eval" ]]; then + varName="${params[$((n + 1))]}" + value="${params[$((n + 2))]}" + n=$((n + 2)) + echo "export $varName=\$(eval echo ${value@Q})" >> "$wrapper" elif [[ "$p" == "--unset" ]]; then varName="${params[$((n + 1))]}" n=$((n + 1)) From 80d1eaa01de9d02e73a99aac15b9be1908839c6a Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 17 Nov 2017 12:19:36 +0000 Subject: [PATCH 39/69] mesos: do not use makeWrapper with bash from bootstrap tools It is too old and does not support required features. The error is: /nix/store/...-hook/nix-support/setup-hook: line 78: export $varName=${value@Q}\${$varName:+${separator@Q}}\$$varName: bad substitution --- pkgs/applications/networking/cluster/mesos/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix index 909242273930..6654ee89c806 100644 --- a/pkgs/applications/networking/cluster/mesos/default.nix +++ b/pkgs/applications/networking/cluster/mesos/default.nix @@ -14,6 +14,8 @@ let # src/common/command_utils.cpp # https://github.com/NixOS/nixpkgs/issues/13783 tarWithGzip = lib.overrideDerivation gnutar (oldAttrs: { + # Original builder is bash 4.3.42 from bootstrap tools, too old for makeWrapper. + builder = "${bash}/bin/bash"; buildInputs = (oldAttrs.buildInputs or []) ++ [ makeWrapper ]; postInstall = (oldAttrs.postInstall or "") + '' wrapProgram $out/bin/tar --prefix PATH ":" "${gzip}/bin" From 74648f74662080a11e7d80511b4487989c6084c0 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 17 Nov 2017 10:15:52 +0000 Subject: [PATCH 40/69] treewide: use --set-default and --set-eval where appropriate --- pkgs/development/compilers/dmd/2.067.1.nix | 2 +- pkgs/development/compilers/dmd/default.nix | 2 +- pkgs/misc/emulators/retrofe/default.nix | 2 +- pkgs/servers/nosql/apache-jena/fuseki-binary.nix | 2 +- pkgs/tools/text/popfile/default.nix | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/dmd/2.067.1.nix b/pkgs/development/compilers/dmd/2.067.1.nix index 6a3cddbd2e50..29a8618dc7b9 100644 --- a/pkgs/development/compilers/dmd/2.067.1.nix +++ b/pkgs/development/compilers/dmd/2.067.1.nix @@ -146,7 +146,7 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/dmd \ --prefix PATH ":" "${stdenv.cc}/bin" \ - --set CC "$""{CC:-$CC""}" + --set-default CC "$CC" cd $out/bin tee dmd.conf << EOF diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index 938dd04904bf..ff19a5b872cc 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -152,7 +152,7 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/dmd \ --prefix PATH ":" "${stdenv.cc}/bin" \ - --set CC "$""{CC:-$CC""}" + --set-default CC "$CC" cd $out/bin tee dmd.conf << EOF diff --git a/pkgs/misc/emulators/retrofe/default.nix b/pkgs/misc/emulators/retrofe/default.nix index 5f921c5a9231..26ef9907f89b 100644 --- a/pkgs/misc/emulators/retrofe/default.nix +++ b/pkgs/misc/emulators/retrofe/default.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { postInstall = '' wrapProgram "$out/bin/retrofe" \ --prefix GST_PLUGIN_PATH : "$GST_PLUGIN_SYSTEM_PATH_1_0" \ - --set RETROFE_PATH "\''${RETROFE_PATH:-\$PWD}" + --set-eval RETROFE_PATH '$''\{RETROFE_PATH:-$PWD}' ''; meta = with stdenv.lib; { diff --git a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix index 6b15c165dfdf..4f9b3a6b443c 100644 --- a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix +++ b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation { for i in "$out"/bin/*; do wrapProgram "$i" \ --prefix "PATH" : "${java}/bin/" \ - --set "FUSEKI_HOME" '"''${FUSEKI_HOME:-'"$out"'}"' \ + --set-default "FUSEKI_HOME" "$out" \ ; done ''; diff --git a/pkgs/tools/text/popfile/default.nix b/pkgs/tools/text/popfile/default.nix index 10b82342051a..37ad72813f61 100644 --- a/pkgs/tools/text/popfile/default.nix +++ b/pkgs/tools/text/popfile/default.nix @@ -44,8 +44,8 @@ stdenv.mkDerivation rec { wrapProgram "$path" \ --prefix PERL5LIB : $PERL5LIB:$out/bin \ --set POPFILE_ROOT $out/bin \ - --set POPFILE_USER \$\{POPFILE_USER:-\$HOME/.popfile\} \ - --run "test -d \$POPFILE_USER || mkdir -m 0700 -p \$POPFILE_USER" + --set-eval POPFILE_USER '$''\{POPFILE_USER:-$HOME/.popfile}' \ + --run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"' done ''; From fbdc74c761ef4bbd9ccc3688924932e0af49f7f9 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 17 Nov 2017 12:53:54 +0000 Subject: [PATCH 41/69] makeWrapper: delete --set-eval because --run is good enough. --- pkgs/build-support/setup-hooks/make-wrapper.sh | 5 ----- pkgs/misc/emulators/retrofe/default.nix | 2 +- pkgs/tools/text/popfile/default.nix | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index ab24fb38b29e..f75b285bacf2 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -53,11 +53,6 @@ makeWrapper() { value="${params[$((n + 2))]}" n=$((n + 2)) echo "export $varName=\${$varName-${value@Q}}" >> "$wrapper" - elif [[ "$p" == "--set-eval" ]]; then - varName="${params[$((n + 1))]}" - value="${params[$((n + 2))]}" - n=$((n + 2)) - echo "export $varName=\$(eval echo ${value@Q})" >> "$wrapper" elif [[ "$p" == "--unset" ]]; then varName="${params[$((n + 1))]}" n=$((n + 1)) diff --git a/pkgs/misc/emulators/retrofe/default.nix b/pkgs/misc/emulators/retrofe/default.nix index 26ef9907f89b..ffc494dad4ca 100644 --- a/pkgs/misc/emulators/retrofe/default.nix +++ b/pkgs/misc/emulators/retrofe/default.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { postInstall = '' wrapProgram "$out/bin/retrofe" \ --prefix GST_PLUGIN_PATH : "$GST_PLUGIN_SYSTEM_PATH_1_0" \ - --set-eval RETROFE_PATH '$''\{RETROFE_PATH:-$PWD}' + --run 'export RETROFE_PATH=''${RETROFE_PATH:-$PWD}' ''; meta = with stdenv.lib; { diff --git a/pkgs/tools/text/popfile/default.nix b/pkgs/tools/text/popfile/default.nix index 37ad72813f61..42befa2ce26b 100644 --- a/pkgs/tools/text/popfile/default.nix +++ b/pkgs/tools/text/popfile/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { wrapProgram "$path" \ --prefix PERL5LIB : $PERL5LIB:$out/bin \ --set POPFILE_ROOT $out/bin \ - --set-eval POPFILE_USER '$''\{POPFILE_USER:-$HOME/.popfile}' \ + --run 'export POPFILE_USER=''${POPFILE_USER:-$HOME/.popfile}' \ --run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"' done ''; From 88105ee01863d3905ee926975b4ad92bdb961bcf Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 24 May 2017 17:24:51 +0300 Subject: [PATCH 42/69] gtk3: compute DPI properly when Xft options are not used Taken from #25892 Fixes #25023 --- pkgs/development/libraries/gtk+/3.x.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index fe6d37ec692c..c52f30a21f73 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, gettext, perl +{ stdenv, fetchurl, fetchpatch, pkgconfig, gettext, perl , expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, gobjectIntrospection , xorg, epoxy, json_glib, libxkbcommon, gmp , waylandSupport ? stdenv.isLinux, wayland, wayland-protocols @@ -29,7 +29,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection perl ]; - patches = [ ./3.0-immodules.cache.patch ]; + patches = [ + ./3.0-immodules.cache.patch + (fetchpatch { + name = "Xft-setting-fallback-compute-DPI-properly.patch"; + url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123"; + sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p"; + }) + ]; buildInputs = [ libxkbcommon epoxy json_glib ]; propagatedBuildInputs = with xorg; with stdenv.lib; From e4bf9e4fef50e5e978f71b40ebaa5f299c7954bd Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Nov 2017 13:36:14 +0100 Subject: [PATCH 43/69] git: honor $PATH for sendmail used in git-send-email command git-send-email will now search $PATH for a sendmail binary, instead of the (previously fixed) list of paths. --- .../git-and-tools/git/default.nix | 1 + .../git/git-send-email-honor-PATH.patch | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch 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 5e42992cbe22..c0b672069005 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -32,6 +32,7 @@ stdenv.mkDerivation { ./symlinks-in-bin.patch ./git-sh-i18n.patch ./ssh-path.patch + ./git-send-email-honor-PATH.patch ]; postPatch = '' diff --git a/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch new file mode 100644 index 000000000000..1aec77504b7b --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch @@ -0,0 +1,47 @@ +From 9a4396ddaedaf59ebee16d69900884e990b79cdd Mon Sep 17 00:00:00 2001 +From: Florian Klink +Date: Fri, 17 Nov 2017 13:21:37 +0100 +Subject: [PATCH] git-send-email: honor $PATH + +This will search $PATH for a sendmail binary, instead of the (previously +fixed) list of paths. + +Signed-off-by: Florian Klink +--- + Documentation/git-send-email.txt | 5 ++--- + git-send-email.perl | 3 ++- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt +index bac9014ac..b9b1f2c41 100644 +--- a/Documentation/git-send-email.txt ++++ b/Documentation/git-send-email.txt +@@ -203,9 +203,8 @@ a password is obtained using 'git-credential'. + specify a full pathname of a sendmail-like program instead; + the program must support the `-i` option. Default value can + be specified by the `sendemail.smtpServer` configuration +- option; the built-in default is `/usr/sbin/sendmail` or +- `/usr/lib/sendmail` if such program is available, or +- `localhost` otherwise. ++ option; the built-in default is to search in $PATH if such program is ++ available, or `localhost` otherwise. + + --smtp-server-port=:: + Specifies a port different from the default port (SMTP +diff --git a/git-send-email.perl b/git-send-email.perl +index 2208dcc21..8e357aeab 100755 +--- a/git-send-email.perl ++++ b/git-send-email.perl +@@ -885,7 +885,8 @@ if (defined $initial_reply_to) { + } + + if (!defined $smtp_server) { +- foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) { ++ my @sendmail_paths = map {"$_/sendmail"} split /:/, $ENV{PATH}; ++ foreach (@sendmail_paths) { + if (-x $_) { + $smtp_server = $_; + last; +-- +2.15.0 + From 9792c039ee5ee3a09c2701a49ad00cce1f09bc8a Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 18 Nov 2017 17:55:01 +0100 Subject: [PATCH 44/69] ninja: 1.7.2 -> 1.8.2 --- .../tools/build-managers/ninja/default.nix | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix index fff6af396b9f..c59d2faaf26c 100644 --- a/pkgs/development/tools/build-managers/ninja/default.nix +++ b/pkgs/development/tools/build-managers/ninja/default.nix @@ -1,29 +1,28 @@ -{ stdenv, fetchurl, python, asciidoc, re2c }: +{ stdenv, fetchFromGitHub, python, asciidoc, re2c }: stdenv.mkDerivation rec { name = "ninja-${version}"; - version = "1.7.2"; + version = "1.8.2"; - src = fetchurl { - name = "${name}.tar.gz"; - url = "https://github.com/ninja-build/ninja/archive/v${version}.tar.gz"; - sha256 = "1n8n3g26ppwh7zwrc37n3alkbpbj0wki34ih53s3rkhs8ajs1p9f"; + src = fetchFromGitHub { + owner = "ninja-build"; + repo = "ninja"; + rev = "v${version}"; + sha256 = "16scq9hcq6c5ap6sy8j4qi75qps1zvrf3p79j1vbrvnqzp928i5f"; }; - buildInputs = [ python asciidoc re2c ]; + nativeBuildInputs = [ python asciidoc re2c ]; buildPhase = '' - python bootstrap.py + python configure.py --bootstrap asciidoc doc/manual.asciidoc ''; installPhase = '' - mkdir -p $out/bin - cp ninja $out/bin/ - - mkdir -p $out/share/doc/ninja - cp doc/manual.asciidoc $out/share/doc/ninja/ - cp doc/manual.html $out/share/doc/ninja/ + install -Dm555 -t $out/bin ninja + install -Dm444 -t $out/share/doc/ninja doc/manual.asciidoc doc/manual.html + install -Dm444 misc/bash-completion $out/share/bash-completion/completions/ninja + install -Dm444 misc/zsh-completion $out/share/zsh/site-functions/_ninja ''; setupHook = ./setup-hook.sh; @@ -36,9 +35,9 @@ stdenv.mkDerivation rec { input files generated by a higher-level build system, and it is designed to run builds as fast as possible. ''; - homepage = http://martine.github.io/ninja/; + homepage = https://ninja-build.org/; license = licenses.asl20; platforms = platforms.unix; - maintainers = [ maintainers.thoughtpolice maintainers.bjornfor ]; + maintainers = with maintainers; [ thoughtpolice bjornfor orivej ]; }; } From c76890f2fe24ca64bc216515149f7316080912f0 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 03:30:43 +0000 Subject: [PATCH 45/69] binutils: disambiguate ARM targets https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766 Since [1] libbfd is compiled with support for all available targets. However, it can not choose whether an ARM ELF file is elf32-littlearm, elf32-littlearm-symbian, or elf32-littlearm-vxworks, and fails with the "File format is ambiguous" error. Here [2] Alan Modra intended to prioritize the first of the three, but although his patch was merged and reportedly solved the issue, currently glibc 2.28.1 and 2.29.1 again fail to disambiguate these targets. This commit makes it prioritize elf32-littlearm over the other two. [1] f8741c38cd546e3ff18ce9d708de14ff2aae68ab [2] https://sourceware.org/ml/binutils/2013-05/msg00271.html --- .../tools/misc/binutils/default.nix | 5 ++++ .../binutils/disambiguate-arm-targets.patch | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 83982b1376e9..8e44a982067d 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -48,6 +48,11 @@ stdenv.mkDerivation rec { # there) and causes a cycle between the lib and bin outputs, so # get rid of it. ./no-plugins.patch + + # Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and + # elf32-littlearm-vxworks in favor of the first. + # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766 + ./disambiguate-arm-targets.patch ]; outputs = [ "out" "info" ]; diff --git a/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch b/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch new file mode 100644 index 000000000000..abbfa73da05d --- /dev/null +++ b/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch @@ -0,0 +1,23 @@ +diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c +index 9f956d3..f5b61f1 100644 +--- a/bfd/elf32-arm.c ++++ b/bfd/elf32-arm.c +@@ -19585,7 +19585,10 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) + #undef ELF_MAXPAGESIZE + #define ELF_MAXPAGESIZE 0x1000 + ++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-vxworks (priority 2) */ ++#define elf_match_priority 2 + #include "elf32-target.h" ++#undef elf_match_priority + + + /* Merge backend specific data from an object file to the output +@@ -19974,4 +19977,7 @@ elf32_arm_symbian_plt_sym_val (bfd_vma i, const asection *plt, + #undef ELF_MAXPAGESIZE + #define ELF_MAXPAGESIZE 0x8000 + ++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-symbian (priority 2) */ ++#define elf_match_priority 2 + #include "elf32-target.h" ++#undef elf_match_priority From 130bf93bb42d97198703049ef66e2c78f6d48aea Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 08:33:53 +0000 Subject: [PATCH 46/69] python.pkgs.pybfd: support split libbfd and libopcodes PR #30484 (f8741c38cd546e3ff18ce9d708de14ff2aae68ab) has split libbfd and libopcodes from binutils and gdb. The original pybfd setup.py is completely unsuitable to handle that. This commit replaces the original source with a fork with a patched setup.py. --- .../python-modules/pybfd/default.nix | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pybfd/default.nix b/pkgs/development/python-modules/pybfd/default.nix index 12f704d80374..ee1a79955740 100644 --- a/pkgs/development/python-modules/pybfd/default.nix +++ b/pkgs/development/python-modules/pybfd/default.nix @@ -1,25 +1,27 @@ -{ lib, buildPythonPackage, isPyPy, isPy3k, fetchurl, gdb, libbfd }: +{ lib, fetchFromGitHub, buildPythonPackage, isPyPy, isPy3k, libbfd, libopcodes }: buildPythonPackage rec { name = "pybfd-0.1.1"; disabled = isPyPy || isPy3k; - src = fetchurl { - url = "mirror://pypi/p/pybfd/${name}.tar.gz"; - sha256 = "d99b32ad077e704ddddc0b488c83cae851c14919e5cbc51715d00464a1932df4"; + src = fetchFromGitHub { + owner = "orivej"; + repo = "pybfd"; + rev = "a2c3a7b94a3c9f7a353b863f69a79174c6a41ebe"; + sha256 = "0wrz234dz25hs0ajzcz5w8lzc1yzf64wqa8fj01hhr4yy23vjkcr"; }; - preConfigure = '' - substituteInPlace setup.py \ - --replace '"/usr/include"' '"${gdb}/include"' \ - --replace '"/usr/lib"' '"${libbfd}/lib"' - ''; + LIBBFD_INCLUDE_DIR = "${libbfd.dev}/include"; + LIBBFD_LIBRARY = "${libbfd}/lib/libbfd.so"; + LIBOPCODES_INCLUDE_DIR = "${libopcodes.dev}/include"; + LIBOPCODES_LIBRARY = "${libopcodes}/lib/libopcodes.so"; meta = { homepage = https://github.com/Groundworkstech/pybfd; description = "A Python interface to the GNU Binary File Descriptor (BFD) library"; license = lib.licenses.gpl2; platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ orivej ]; }; } From 3c81b7639a41d1ed9c1572e0791cf0406660d0c7 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 10:19:21 +0000 Subject: [PATCH 47/69] lib: delete reference to lib/sandbox.nix after it was deleted in 0fe7bde3d88027977a07a24baee98d2ecc07222f --- lib/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index 3e30ec515fcb..9dc4fea99fc2 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -41,7 +41,6 @@ let generators = callLibs ./generators.nix; misc = callLibs ./deprecated.nix; # domain-specific - sandbox = callLibs ./sandbox.nix; fetchers = callLibs ./fetchers.nix; # Eval-time filesystem handling From 96666650ef2e85252fed3bf8881a96f65a49dafd Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 19 Nov 2017 15:04:32 +0100 Subject: [PATCH 48/69] man-db: explicitly pass section string Work around a bug in the autoconf setup of man-db: The list of default sections does not include section 0 (zero) despite ``./configure --help`` advertising it. This causes header man pages (e. g. time.h from package posix_man_pages) to be ignored by man(1): $ file /run/current-system/sw/share/man/man0p/time.h.0p.gz /run/current-system/sw/share/man/man0p/time.h.0p.gz: gzip compressed data, from Unix $ man 0p time.h No manual entry for 0p No manual entry for time.h Override the default (as defined in m4/man-arg-sections.m4) until this is fixed upstream. --- pkgs/tools/misc/man-db/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix index f5a99ba1c71c..d0cb9a223366 100644 --- a/pkgs/tools/misc/man-db/default.nix +++ b/pkgs/tools/misc/man-db/default.nix @@ -28,6 +28,10 @@ stdenv.mkDerivation rec { "--with-systemdtmpfilesdir=\${out}/lib/tmpfiles.d" ]; + preConfigure = '' + configureFlagsArray+=("--with-sections=1 n l 8 3 0 2 5 4 9 6 7") + ''; + postInstall = '' # apropos/whatis uses program name to decide whether to act like apropos or whatis # (multi-call binary). `apropos` is actually just a symlink to whatis. So we need to From 50d8720d2a6fcdd0fb28912c5fb422c2051d5ab0 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 14:15:19 +0000 Subject: [PATCH 49/69] nixos/testing: fix after --set ceased to evaluate the value --- nixos/lib/testing.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index 9339ba78ff0c..532fff681d37 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -113,8 +113,7 @@ rec { --add-flags "''${vms[*]}" \ ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin:${imagemagick}/bin'"} \ - --run "testScript=\"\$(cat $out/test-script)\"" \ - --set testScript '$testScript' \ + --run "export testScript=\"\$(cat $out/test-script)\"" \ --set VLANS '${toString vlans}' ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms wrapProgram $out/bin/nixos-run-vms \ From d1f7d794cfd4f583c8171fd4f666921be5155d82 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Nov 2017 17:53:43 +0200 Subject: [PATCH 50/69] devicemapper: 2.02.175 -> 2.02.176 --- pkgs/os-specific/linux/lvm2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix index 6382b90f1683..e6d5c10341b4 100644 --- a/pkgs/os-specific/linux/lvm2/default.nix +++ b/pkgs/os-specific/linux/lvm2/default.nix @@ -2,7 +2,7 @@ , thin-provisioning-tools, enable_dmeventd ? false }: let - version = "2.02.175"; + version = "2.02.176"; in stdenv.mkDerivation { @@ -10,7 +10,7 @@ stdenv.mkDerivation { src = fetchurl { url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${version}.tgz"; - sha256 = "0n95cc2b0jb0fh2pd9jyg9ww7lyzpia9n9sryw9f4aq8dpna7dsd"; + sha256 = "0wx4rvy4frdmb66znh2xms2j2n06sm361ki6l5ks4y1ciii87kny"; }; configureFlags = [ From dfd2e6ff746c3dad60c1fb26fafa4fc8a0fee78b Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Nov 2017 17:54:09 +0200 Subject: [PATCH 51/69] iproute: 4.13.0 -> 4.14.1 --- pkgs/os-specific/linux/iproute/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index b64278ae4ba0..be9be49208a4 100644 --- a/pkgs/os-specific/linux/iproute/default.nix +++ b/pkgs/os-specific/linux/iproute/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { name = "iproute2-${version}"; - version = "4.13.0"; + version = "4.14.1"; src = fetchurl { url = "mirror://kernel/linux/utils/net/iproute2/${name}.tar.xz"; - sha256 = "0l2w84cwr54gaw3cbxijf614l76hx8mgcz57v81rwl68z3nq3yww"; + sha256 = "0rq0n7yxb0hmk0s6wx5awzjgf7ikjbibd0a5ix20ldfcmxlc0fnl"; }; preConfigure = '' From 28ea0a5259113251b9470dd6e5bc98aa56ecc5f8 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Nov 2017 17:54:37 +0200 Subject: [PATCH 52/69] pciutils: 3.5.5 -> 3.5.6 --- pkgs/tools/system/pciutils/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix index 7508b4fc56c4..1139c49ddf80 100644 --- a/pkgs/tools/system/pciutils/default.nix +++ b/pkgs/tools/system/pciutils/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, zlib, kmod, which }: stdenv.mkDerivation rec { - name = "pciutils-3.5.5"; # with database from 2017-07 + name = "pciutils-3.5.6"; # with database from 2017-07 src = fetchurl { url = "mirror://kernel/software/utils/pciutils/${name}.tar.xz"; - sha256 = "1d62f8fa192f90e61c35a6fc15ff3cb9a7a792f782407acc42ef67817c5939f5"; + sha256 = "08dvsk1b5m1r7qqzsm849h4glq67mngf8zw7bg0102ff1jwywipk"; }; nativeBuildInputs = [ pkgconfig ]; From fb703ad1173abe80740e846b10e448d7c7f1d87c Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 23:50:49 +0000 Subject: [PATCH 53/69] treewide: update the usage of makeWrapper after #31497 --- .../networking/instant-messengers/hipchat/default.nix | 4 ++-- pkgs/applications/window-managers/qtile/default.nix | 6 +++--- pkgs/development/compilers/chicken/eggDerivation.nix | 2 +- pkgs/development/tools/build-managers/redo-sh/default.nix | 2 +- pkgs/games/mudlet/default.nix | 2 +- pkgs/servers/sql/oracle-xe/default.nix | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix index 4e116e685c60..4d4b32453a4f 100644 --- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix +++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix @@ -78,8 +78,8 @@ stdenv.mkDerivation { --replace /opt/HipChat4/bin/HipChat4 $out/bin/hipchat makeWrapper $d/HipChat.bin $out/bin/hipchat \ - --set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \ - --set HIPCHAT_QT_PLUGIN_PATH '"$QT_PLUGIN_PATH"' \ + --run 'export HIPCHAT_LD_LIBRARY_PATH=$LD_LIBRARY_PATH' \ + --run 'export HIPCHAT_QT_PLUGIN_PATH=$QT_PLUGIN_PATH' \ --set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb \ --set QTWEBENGINEPROCESS_PATH $d/QtWebEngineProcess diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix index 8f4d4858ca11..3415bda90816 100644 --- a/pkgs/applications/window-managers/qtile/default.nix +++ b/pkgs/applications/window-managers/qtile/default.nix @@ -36,9 +36,9 @@ python27Packages.buildPythonApplication rec { postInstall = '' wrapProgram $out/bin/qtile \ - --set QTILE_WRAPPER '$0' \ - --set QTILE_SAVED_PYTHONPATH '$PYTHONPATH' \ - --set QTILE_SAVED_PATH '$PATH' + --run "export QTILE_WRAPPER=$0" \ + --run "export QTILE_SAVED_PYTHONPATH=$PYTHONPATH" \ + --run "export QTILE_SAVED_PATH=$PATH" ''; meta = with stdenv.lib; { diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix index 97ce9d9be79b..58247e5aeb53 100644 --- a/pkgs/development/compilers/chicken/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/eggDerivation.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation ({ wrapProgram $f \ --set CHICKEN_REPOSITORY $CHICKEN_REPOSITORY \ --prefix CHICKEN_REPOSITORY_EXTRA : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_EXTRA" \ - --prefix CHICKEN_INCLUDE_PATH \; \"$CHICKEN_INCLUDE_PATH\;$out/share/\" \ + --prefix CHICKEN_INCLUDE_PATH \; "$CHICKEN_INCLUDE_PATH;$out/share/" \ --prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY" done diff --git a/pkgs/development/tools/build-managers/redo-sh/default.nix b/pkgs/development/tools/build-managers/redo-sh/default.nix index f81ff3b91d4f..c888627cfce3 100644 --- a/pkgs/development/tools/build-managers/redo-sh/default.nix +++ b/pkgs/development/tools/build-managers/redo-sh/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { mv man "$out/share" mv bin "$out" for p in $out/bin/*; do - wrapProgram "$p" --set PATH '$PATH:'"$out/bin" + wrapProgram "$p" --suffix PATH : "$out/bin" done ''; diff --git a/pkgs/games/mudlet/default.nix b/pkgs/games/mudlet/default.nix index 078075931dae..673efb0e118d 100644 --- a/pkgs/games/mudlet/default.nix +++ b/pkgs/games/mudlet/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { cp -r mudlet-lua $out makeWrapper $out/mudlet $out/bin/mudlet \ - --set LUA_CPATH "\"${luaFileSystemPath};${luaZipPath};${lrexlibPath};${luasqlitePath}\"" \ + --set LUA_CPATH "${luaFileSystemPath};${luaZipPath};${lrexlibPath};${luasqlitePath}" \ --run "cd $out"; ''; diff --git a/pkgs/servers/sql/oracle-xe/default.nix b/pkgs/servers/sql/oracle-xe/default.nix index e86406cd469c..9068ca70cc6e 100644 --- a/pkgs/servers/sql/oracle-xe/default.nix +++ b/pkgs/servers/sql/oracle-xe/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { makeWrapper "$i" "$out/bin/''${i##*/}" \ --set ORACLE_HOME "$out/libexec/oracle" \ --set ORACLE_SID XE \ - --set NLS_LANG '$("'"$out"'/libexec/oracle/bin/nls_lang.sh")' \ + --run "export NLS_LANG=\$($out/libexec/oracle/bin/nls_lang.sh)" \ --prefix PATH : "$out/libexec/oracle/bin" done ''; From eb3d20761169696f78bfd40afb92ab099c7507a3 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 19 Nov 2017 23:56:03 +0000 Subject: [PATCH 54/69] qtile: fix wrapProgram quotation --- pkgs/applications/window-managers/qtile/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix index 3415bda90816..22521cc6da8d 100644 --- a/pkgs/applications/window-managers/qtile/default.nix +++ b/pkgs/applications/window-managers/qtile/default.nix @@ -36,9 +36,9 @@ python27Packages.buildPythonApplication rec { postInstall = '' wrapProgram $out/bin/qtile \ - --run "export QTILE_WRAPPER=$0" \ - --run "export QTILE_SAVED_PYTHONPATH=$PYTHONPATH" \ - --run "export QTILE_SAVED_PATH=$PATH" + --run 'export QTILE_WRAPPER=$0' \ + --run 'export QTILE_SAVED_PYTHONPATH=$PYTHONPATH' \ + --run 'export QTILE_SAVED_PATH=$PATH' ''; meta = with stdenv.lib; { From c30d535c7bb65184c8441f8a94a6879339a6da17 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Mon, 20 Nov 2017 16:50:16 +0000 Subject: [PATCH 55/69] wayland: 1.12.0 -> 1.14.0 --- pkgs/development/libraries/wayland/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index 836a4527b508..5def37b791cf 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -8,11 +8,11 @@ assert expat != null; stdenv.mkDerivation rec { name = "wayland-${version}"; - version = "1.12.0"; + version = "1.14.0"; src = fetchurl { url = "http://wayland.freedesktop.org/releases/${name}.tar.xz"; - sha256 = "d6b4135cba0188abcb7275513c72dede751d6194f6edc5b82183a3ba8b821ab1"; + sha256 = "1f3sla6h0bw15fz8pjc67jhwj7pwmfdc7qlj42j5k9v116ycm07d"; }; configureFlags = [ "--with-scanner" "--disable-documentation" ]; From 2ac6343d5614d63477c3b0e1f86b7573e1292ed9 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Mon, 20 Nov 2017 16:50:36 +0000 Subject: [PATCH 56/69] wayland-protocols: 1.10 -> 1.11 --- pkgs/development/libraries/wayland/protocols.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index 436de5609e5a..5b1495ccbe1a 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { name = "wayland-protocols-${version}"; - version = "1.10"; + version = "1.11"; src = fetchurl { url = "http://wayland.freedesktop.org/releases/${name}.tar.xz"; - sha256 = "5719c51d7354864983171c5083e93a72ac99229e2b460c4bb10513de08839c0a"; + sha256 = "0138psvx6fv8z5x2p6xi4iij6m5k62c0qyfsb45xgcf5a4fyxz1s"; }; nativeBuildInputs = [ pkgconfig ]; From fc39418ad4a1bef3e61da0416d846f8943b39527 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Mon, 20 Nov 2017 16:55:52 +0000 Subject: [PATCH 57/69] weston: 1.12.0 -> 3.0.0 --- pkgs/applications/window-managers/weston/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/weston/default.nix b/pkgs/applications/window-managers/weston/default.nix index 395541d62503..0b78debdc589 100644 --- a/pkgs/applications/window-managers/weston/default.nix +++ b/pkgs/applications/window-managers/weston/default.nix @@ -7,11 +7,11 @@ stdenv.mkDerivation rec { name = "weston-${version}"; - version = "1.12.0"; + version = "3.0.0"; src = fetchurl { url = "http://wayland.freedesktop.org/releases/${name}.tar.xz"; - sha256 = "ac7ac2a32e3b9f50131fccded5d2326bd36b2226712d90b61999118a09af5033"; + sha256 = "19936zlkb75xcaidd8fag4ah8000wrh2ziqy7nxkq36pimgdbqfd"; }; nativeBuildInputs = [ pkgconfig ]; From 0b9cd7ad0f3c3aad8553a597bd69453e046df26f Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 03:43:00 +0000 Subject: [PATCH 58/69] pdf2djvu: ignore windres on linux to fix build https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345899910 --- pkgs/tools/typesetting/pdf2djvu/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/typesetting/pdf2djvu/default.nix b/pkgs/tools/typesetting/pdf2djvu/default.nix index e4613802892e..847477809406 100644 --- a/pkgs/tools/typesetting/pdf2djvu/default.nix +++ b/pkgs/tools/typesetting/pdf2djvu/default.nix @@ -15,8 +15,13 @@ stdenv.mkDerivation rec { preConfigure = '' sed -i 's#\$djvulibre_bin_path#${djvulibre.bin}/bin#g' configure + + # Configure skips the failing check for usability of windres when it is nonempty. + unset WINDRES ''; + enableParallelBuilding = true; + meta = with stdenv.lib; { description = "Creates djvu files from PDF files"; homepage = https://jwilk.net/software/pdf2djvu; From 4f73b3162b117178b26beecc73cbb532290ae03f Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 04:27:10 +0000 Subject: [PATCH 59/69] treewide: preset windres missing to fix builds on Linux https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345899910 --- pkgs/applications/audio/schismtracker/default.nix | 7 +++++++ pkgs/applications/science/astronomy/gravit/default.nix | 9 ++++++++- pkgs/games/freedink/default.nix | 7 +++++++ pkgs/games/macopix/default.nix | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/audio/schismtracker/default.nix b/pkgs/applications/audio/schismtracker/default.nix index 2b2fd161ede3..22786304faa9 100644 --- a/pkgs/applications/audio/schismtracker/default.nix +++ b/pkgs/applications/audio/schismtracker/default.nix @@ -9,10 +9,17 @@ stdenv.mkDerivation rec { sha256 = "1ny7wv2wxm1av299wvpskall6438wjjpadphmqc7c0h6d0zg5kii"; }; + preConfigure = '' + # Build fails on Linux with windres. + export ac_cv_prog_ac_ct_WINDRES= + ''; + configureFlags = "--enable-dependency-tracking"; buildInputs = [ alsaLib python SDL ]; + enableParallelBuilding = true; + meta = { description = "Music tracker application, free reimplementation of Impulse Tracker"; homepage = http://schismtracker.org/; diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix index 5903edd337df..190186db1810 100644 --- a/pkgs/applications/science/astronomy/gravit/default.nix +++ b/pkgs/applications/science/astronomy/gravit/default.nix @@ -12,7 +12,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake ]; - preConfigure = "./autogen.sh"; + preConfigure = '' + ./autogen.sh + + # Build fails on Linux with windres. + export ac_cv_prog_WINDRES= + ''; + + enableParallelBuilding = true; meta = { homepage = http://gravit.slowchop.com; diff --git a/pkgs/games/freedink/default.nix b/pkgs/games/freedink/default.nix index 94451ef8930d..c1bfda9e2f2f 100644 --- a/pkgs/games/freedink/default.nix +++ b/pkgs/games/freedink/default.nix @@ -28,11 +28,18 @@ in stdenv.mkDerivation rec { pkgconfig intltool fontconfig libzip zip zlib ]; + preConfigure = '' + # Build fails on Linux with windres. + export ac_cv_prog_ac_ct_WINDRES= + ''; + postInstall = '' mkdir -p "$out/share/" ln -s ${freedink_data}/share/dink "$out/share/" ''; + enableParallelBuilding = true; + meta = { description = "A free, portable and enhanced version of the Dink Smallwood game engine"; diff --git a/pkgs/games/macopix/default.nix b/pkgs/games/macopix/default.nix index 72b0b0d00cdd..b490231442e3 100644 --- a/pkgs/games/macopix/default.nix +++ b/pkgs/games/macopix/default.nix @@ -11,6 +11,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ gtk openssl ]; + preConfigure = '' + # Build fails on Linux with windres. + export ac_cv_prog_WINDRES= + ''; + + enableParallelBuilding = true; + meta = { description = "Mascot Constructive Pilot for X"; homepage = http://rosegray.sakura.ne.jp/macopix/index-e.html; From 5421d2908f776fc86cb79d8ee3bfad51596c7776 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 17:58:48 +0000 Subject: [PATCH 60/69] boehm-gc: enable parallel building --- pkgs/development/libraries/boehm-gc/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index 1ac96e2b4f04..421d7072397b 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { mv $out/share/gc $out/share/doc/gc ''; + enableParallelBuilding = true; + meta = { description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++"; From e207ac1ee3d2deb18e374bfde5b8ef6f1371b06b Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 21 Nov 2017 20:22:14 +0100 Subject: [PATCH 61/69] alsa-lib: 1.1.4.1 -> 1.1.5 --- pkgs/os-specific/linux/alsa-lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix index 8a6eb77e6b1e..5b0d404faaf0 100644 --- a/pkgs/os-specific/linux/alsa-lib/default.nix +++ b/pkgs/os-specific/linux/alsa-lib/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "alsa-lib-1.1.4.1"; + name = "alsa-lib-1.1.5"; src = fetchurl { urls = [ "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2" "http://alsa.cybermirror.org/lib/${name}.tar.bz2" ]; - sha256 = "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"; + sha256 = "1rhacnlj0grvfagjx5qzsnbhw7m7lyccghqs4jsv0dnsqv9qmxpl"; }; patches = [ From 9b8ebd8e14f40e31f119da73c230e4150993c5ae Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 21 Nov 2017 20:22:54 +0100 Subject: [PATCH 62/69] alsa-utils: 1.1.4 -> 1.1.5 --- pkgs/os-specific/linux/alsa-utils/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix index 4cb4af5ca724..c9b5b0d2e2dc 100644 --- a/pkgs/os-specific/linux/alsa-utils/default.nix +++ b/pkgs/os-specific/linux/alsa-utils/default.nix @@ -2,14 +2,14 @@ stdenv.mkDerivation rec { name = "alsa-utils-${version}"; - version = "1.1.4"; + version = "1.1.5"; src = fetchurl { urls = [ "ftp://ftp.alsa-project.org/pub/utils/${name}.tar.bz2" "http://alsa.cybermirror.org/utils/${name}.tar.bz2" ]; - sha256 = "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"; + sha256 = "1s727md6mb408y2cfwzjkx23abxhampyrjdkgpyygdhxx62x42rj"; }; patchPhase = '' From e1f8c72ec8aa42bc8b0e185ad6c08061983592e1 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 21 Nov 2017 20:23:14 +0100 Subject: [PATCH 63/69] alsa-tools: 1.1.3 -> 1.1.5 --- pkgs/os-specific/linux/alsa-tools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/alsa-tools/default.nix b/pkgs/os-specific/linux/alsa-tools/default.nix index 940dde1f75dd..d1cae06d7fff 100644 --- a/pkgs/os-specific/linux/alsa-tools/default.nix +++ b/pkgs/os-specific/linux/alsa-tools/default.nix @@ -4,14 +4,14 @@ stdenv.mkDerivation rec { name = "alsa-tools-${version}"; - version = "1.1.3"; + version = "1.1.5"; src = fetchurl { urls = [ "ftp://ftp.alsa-project.org/pub/tools/${name}.tar.bz2" "http://alsa.cybermirror.org/tools/${name}.tar.bz2" ]; - sha256 = "02b75fyfmm9m2iz59d3xa97cas4f697a4pzdxn1i64kjd36iv3yq"; + sha256 = "0d6m5dm5yskfr6q42cv1ihp5lfgv4a67nj39gpp26ll3vrknag5w"; }; nativeBuildInputs = [ pkgconfig ]; From 111c8f12870cde06a8dccb311eece49727b5fbcf Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 21 Nov 2017 20:23:38 +0100 Subject: [PATCH 64/69] alsa-plugins: 1.1.4 -> 1.1.5 --- pkgs/os-specific/linux/alsa-plugins/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix index ae0aaa3cb638..dc11d21ff1cb 100644 --- a/pkgs/os-specific/linux/alsa-plugins/default.nix +++ b/pkgs/os-specific/linux/alsa-plugins/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, libpulseaudio ? null, libjack2 ? null }: stdenv.mkDerivation rec { - name = "alsa-plugins-1.1.4"; + name = "alsa-plugins-1.1.5"; src = fetchurl { urls = [ "ftp://ftp.alsa-project.org/pub/plugins/${name}.tar.bz2" "http://alsa.cybermirror.org/plugins/${name}.tar.bz2" ]; - sha256 = "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"; + sha256 = "073zpgvj4pldmzqq97l40wngvbqnvrkc8yw153mgny9kypwaazbr"; }; # ToDo: a52, etc.? From d5e3935a6abc9ba2e7025cf5483bf6a5693a5006 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 19:29:10 +0000 Subject: [PATCH 65/69] atlas: enable parallel building --- pkgs/development/libraries/science/math/atlas/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix index c6797ef05ac3..becc60e68ea6 100644 --- a/pkgs/development/libraries/science/math/atlas/default.nix +++ b/pkgs/development/libraries/science/math/atlas/default.nix @@ -100,6 +100,8 @@ stdenv.mkDerivation { fi ''; + enableParallelBuilding = true; + meta = { homepage = http://math-atlas.sourceforge.net/; description = "Automatically Tuned Linear Algebra Software (ATLAS)"; From 10cec932d7b161307228ef721eb956f9dd5251d0 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 19:29:29 +0000 Subject: [PATCH 66/69] retroarch: enable parallel building --- pkgs/misc/emulators/retroarch/cores.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index c2ec16081e86..ab1e71380c13 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -26,6 +26,8 @@ let --add-flags "-L $COREDIR/${d2u core}_libretro.so $@" ''; + enableParallelBuilding = true; + passthru = { core = core; libretroCore = "/lib/retroarch/cores"; From 71a2a5ae40b2b94150365bb846fb78b620562df8 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 21 Nov 2017 19:30:18 +0000 Subject: [PATCH 67/69] qt4: enable parallel building Please let me know if it fails to build in parallel so we could fix it, because overwise it is a bottleneck of mass rebuilds. --- pkgs/development/libraries/qt-4.x/4.8/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index c9679d227d88..f5bce5fb2997 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -164,7 +164,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl pkgconfig which ]; - enableParallelBuilding = false; + enableParallelBuilding = true; NIX_CFLAGS_COMPILE = optionalString stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin From a0948ffdb04ebf6376caca9a007e381065895a0f Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 21 Nov 2017 19:43:44 +0100 Subject: [PATCH 68/69] Csu: fix build with CoreFoundation --- .../apple-source-releases/Csu/default.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix index 8dcf28a59094..7fd32a64fe57 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix @@ -1,24 +1,22 @@ { stdenv, appleDerivation }: appleDerivation { - postUnpack = '' - substituteInPlace $sourceRoot/Makefile \ - --replace "/usr/lib" "/lib" \ - --replace "/usr/local/lib" "/lib" \ - --replace "/usr/bin" "" \ - --replace "/bin/" "" \ + prePatch = '' + substituteInPlace Makefile \ + --replace /usr/lib /lib \ + --replace /usr/local/lib /lib \ + --replace /usr/bin "" \ + --replace /bin/ "" \ --replace "CC = " "CC = cc #" \ - --replace "SDK_DIR = " "SDK_DIR = . #" + --replace "SDK_DIR = " "SDK_DIR = . #" \ + + # Mac OS didn't support rpaths back before 10.5, but we don't care about it. + substituteInPlace Makefile \ + --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.6 \ + --replace -mmacosx-version-min=10.5 -mmacosx-version-min=10.6 ''; - # Mac OS didn't support rpaths back before 10.5, and this package intentionally builds stubs targeting versions prior to that - NIX_DONT_SET_RPATH = "1"; - NIX_NO_SELF_RPATH = "1"; - - installPhase = '' - export DSTROOT=$out - make install - ''; + installFlags = [ "DSTROOT=$(out)" ]; meta = with stdenv.lib; { description = "Apple's common startup stubs for darwin"; From 4d50d79bc84845208711907020f2a871f3a433d4 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Wed, 22 Nov 2017 06:48:46 +0000 Subject: [PATCH 69/69] atlas: disable parallel building --- pkgs/development/libraries/science/math/atlas/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix index becc60e68ea6..7fad5c312a01 100644 --- a/pkgs/development/libraries/science/math/atlas/default.nix +++ b/pkgs/development/libraries/science/math/atlas/default.nix @@ -100,7 +100,9 @@ stdenv.mkDerivation { fi ''; - enableParallelBuilding = true; + # 1. /buildATLAS/build/bin/ATLrun.sh: multiple segfaults. + # 2. "atlas does its own parallel builds" + enableParallelBuilding = false; meta = { homepage = http://math-atlas.sourceforge.net/;