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 diff --git a/lib/maintainers.nix b/lib/maintainers.nix index d798d6d315b5..0baf98a0422c 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -208,6 +208,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/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}") - ''; -} 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 \ 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/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" 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/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/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 + diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix index 8f4d4858ca11..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 \ - --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/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 ]; diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index f9d435df655b..f75b285bacf2 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -47,7 +47,12 @@ 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" == "--set-default" ]]; then + varName="${params[$((n + 1))]}" + value="${params[$((n + 2))]}" + n=$((n + 2)) + echo "export $varName=\${$varName-${value@Q}}" >> "$wrapper" elif [[ "$p" == "--unset" ]]; then varName="${params[$((n + 1))]}" n=$((n + 1)) @@ -63,9 +68,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 +79,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 +87,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 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/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/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index e7b188ad71b8..088a64ff5438 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -67,55 +67,54 @@ 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 +240,62 @@ 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 ""} - "; + "--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) 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 +312,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..7003ace28905 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -108,102 +108,81 @@ 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) */ 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 + - # 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-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" + - # 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 targetPlatform.libc == "uclibc" then - # 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) - ); + 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" ] ++ + (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 ""; @@ -329,63 +308,92 @@ 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}" ++ + optionals (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 ""} - "; + "--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) (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 +412,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 +425,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..362670ff5dbd 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -99,107 +99,88 @@ 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 + - # 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=${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" + - # 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 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) - ); + 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" ] ++ + (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 ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -326,61 +307,91 @@ 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}" ++ + optionals (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 ""} - "; + "--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) (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 +404,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 +424,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..c9b49c0ede63 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -103,107 +103,88 @@ 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 + - # 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 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) - ); + 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" ] ++ + (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 ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -340,62 +321,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 "--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 ""} - "; + "--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) (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..a68946a6f345 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -100,103 +100,84 @@ 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 + - # 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 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) - ); + 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" ] ++ + (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 ""; @@ -341,85 +322,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 +433,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..c201ca6373b7 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -98,108 +98,88 @@ 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 + - # 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") + - # 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" + - # 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 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) - ); + 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" ] ++ + (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 ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -335,62 +315,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 "--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) (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 +408,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 +428,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 4ec92b7bdb62..38df9de08c2c 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -98,108 +98,88 @@ 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 + - # 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") + - # 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" + - # 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 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) - ); + 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" ] ++ + (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 ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -322,62 +302,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 "--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) (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 +395,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 +415,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/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 = '' 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"; diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix index e67b305106e1..8dfe26f72f4a 100644 --- a/pkgs/development/compilers/rust/binaryBuild.nix +++ b/pkgs/development/compilers/rust/binaryBuild.nix @@ -70,6 +70,11 @@ rec { --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ "$out/bin/rustdoc" ''} + ${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" + ''} ${patchBootstrapCargo} 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 = '' 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/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 diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index 04634aa8f271..d75aea726e10 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -54,8 +54,9 @@ stdenv.mkDerivation rec { # https://bugzilla.libsdl.org/show_bug.cgi?id=1431 dontDisableStatic = true; - # Flaky: fatal error: pointer-constraints-....h: No such file or directory - #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 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++"; 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)); 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" diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 1d0930d8d03c..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 @@ -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" ]; @@ -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; diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix new file mode 100644 index 000000000000..700c5a928e55 --- /dev/null +++ b/pkgs/development/libraries/libbfd/default.nix @@ -0,0 +1,47 @@ +{ stdenv +, fetchurl, autoreconfHook264, bison, binutils-raw +, libiberty, zlib +}: + +stdenv.mkDerivation rec { + name = "libbfd-${version}"; + inherit (binutils-raw) version src; + + outputs = [ "out" "dev" ]; + + patches = binutils-raw.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/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; }; } diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix new file mode 100644 index 000000000000..f3e12db39819 --- /dev/null +++ b/pkgs/development/libraries/libopcodes/default.nix @@ -0,0 +1,43 @@ +{ stdenv, buildPackages +, fetchurl, autoreconfHook264, bison, binutils-raw +, libiberty, libbfd +}: + +stdenv.mkDerivation rec { + name = "libopcodes-${version}"; + inherit (binutils-raw) version src; + + outputs = [ "out" "dev" ]; + + patches = binutils-raw.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/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 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 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/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 diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix index c6797ef05ac3..7fad5c312a01 100644 --- a/pkgs/development/libraries/science/math/atlas/default.nix +++ b/pkgs/development/libraries/science/math/atlas/default.nix @@ -100,6 +100,10 @@ stdenv.mkDerivation { fi ''; + # 1. /buildATLAS/build/bin/ATLrun.sh: multiple segfaults. + # 2. "atlas does its own parallel builds" + enableParallelBuilding = false; + meta = { homepage = http://math-atlas.sourceforge.net/; description = "Automatically Tuned Linear Algebra Software (ATLAS)"; 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" ]; 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 ]; 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/development/python-modules/pybfd/default.nix b/pkgs/development/python-modules/pybfd/default.nix index 259e0cea86d0..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, binutils }: +{ 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"' '"${binutils.lib}/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 ]; }; } 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 ]; diff --git a/pkgs/development/tools/analysis/kcov/default.nix b/pkgs/development/tools/analysis/kcov/default.nix index 509f3e19e802..3c3665e72200 100644 --- a/pkgs/development/tools/analysis/kcov/default.nix +++ b/pkgs/development/tools/analysis/kcov/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, binutils}: +{stdenv, fetchFromGitHub, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, libopcodes}: stdenv.mkDerivation rec { name = "kcov-${version}"; @@ -12,8 +12,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 ]; enableParallelBuilding = true; 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 ]; }; } 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/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..8e44a982067d 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -48,15 +48,16 @@ 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" ] - ++ 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,16 +88,21 @@ 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; passthru = { - inherit prefix; + inherit prefix version; }; meta = with stdenv.lib; { @@ -109,6 +115,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 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 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/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"; 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/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 ]; } 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; 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/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"; diff --git a/pkgs/misc/emulators/retrofe/default.nix b/pkgs/misc/emulators/retrofe/default.nix index 5f921c5a9231..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 RETROFE_PATH "\''${RETROFE_PATH:-\$PWD}" + --run 'export RETROFE_PATH=''${RETROFE_PATH:-$PWD}' ''; meta = with stdenv.lib; { 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 { 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"; 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/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 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/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 5fc0db44f860..8ac93689373d 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -37,17 +37,8 @@ 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 ''; diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 1f2e7c143780..e08e78339832 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) @@ -39,6 +41,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. 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 = [ 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.? 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 ]; 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 = '' 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 = '' 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 = [ 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/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 ''; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index a67ca53e1c54..89c903b04a04 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; }; } }: @@ -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 dependency 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"; @@ -353,7 +350,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 @@ -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)) 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 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 c8cddf248ab9..52eea41bdbd7 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 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/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 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/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 ]; 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" ]; }; } diff --git a/pkgs/tools/text/popfile/default.nix b/pkgs/tools/text/popfile/default.nix index 10b82342051a..42befa2ce26b 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" + --run 'export POPFILE_USER=''${POPFILE_USER:-$HOME/.popfile}' \ + --run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"' done ''; 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; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 6b662c56579d..253248f4cad1 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -58,6 +58,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 5d69015b748d..b5ffb39b8ca4 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) @@ -7707,8 +7711,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; @@ -7864,6 +7866,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 { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 3b7548f40d8e..3d70bb0cc252 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -10282,6 +10282,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)"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 97af4f8b48ec..d5a2ee462ba8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4988,6 +4988,7 @@ in { checkPhase = '' py.test testing ''; + __darwinAllowLocalNetworking = true; meta = { description = "Rapid multi-Python deployment"; license = licenses.gpl2; @@ -14047,6 +14048,8 @@ in { propagatedBuildInputs = with self; [ cryptography pyasn1 ]; + __darwinAllowLocalNetworking = true; + # https://github.com/paramiko/paramiko/issues/449 doCheck = !(isPyPy || isPy33); checkPhase = ''