diff --git a/pkgs/applications/audio/sisco.lv2/default.nix b/pkgs/applications/audio/sisco.lv2/default.nix index d429d5452345..8ac7a9115ca8 100644 --- a/pkgs/applications/audio/sisco.lv2/default.nix +++ b/pkgs/applications/audio/sisco.lv2/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { inherit name; srcs = [ src robtkSrc ]; - sourceRoot = "sisco.lv2-${src.rev}-src"; + sourceRoot = src.name; buildInputs = [ pkgconfig lv2 pango cairo libjack2 mesa ]; diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index e6576e5a3894..676fbd006881 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -10,6 +10,7 @@ , zlib ? null, extraPackages ? [], extraBuildCommands ? "" , dyld ? null # TODO: should this be a setup-hook on dyld? , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null +, buildPackages ? {}, hostPlatform, targetPlatform , runCommand ? null }: @@ -121,6 +122,17 @@ let null) else ""; + expand-response-params = if buildPackages.stdenv.cc or null != null && buildPackages.stdenv.cc != "/dev/null" + then buildPackages.stdenv.mkDerivation { + name = "expand-response-params"; + src = ./expand-response-params.c; + buildCommand = '' + # Work around "stdenv-darwin-boot-2 is not allowed to refer to path /nix/store/...-expand-response-params.c" + cp "$src" expand-response-params.c + "$CC" -std=c99 -O3 -o "$out" expand-response-params.c + ''; + } else ""; + in stdenv.mkDerivation { @@ -369,11 +381,13 @@ stdenv.mkDerivation { + '' substituteAll ${preWrap ./add-flags.sh} $out/nix-support/add-flags.sh substituteAll ${preWrap ./add-hardening.sh} $out/nix-support/add-hardening.sh - cp -p ${preWrap ./utils.sh} $out/nix-support/utils.sh + substituteAll ${preWrap ./utils.sh} $out/nix-support/utils.sh '' + extraBuildCommands; - inherit dynamicLinker; + inherit dynamicLinker expand-response-params; + + expandResponseParams = expand-response-params; # for substitution in utils.sh crossAttrs = { shell = shell.crossDrv + shell.crossDrv.shellPath; diff --git a/pkgs/build-support/cc-wrapper/expand-response-params.c b/pkgs/build-support/cc-wrapper/expand-response-params.c new file mode 100644 index 000000000000..05b9c62b1e8d --- /dev/null +++ b/pkgs/build-support/cc-wrapper/expand-response-params.c @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include + +typedef struct { char *data; size_t len, cap; } String; + +void resize(String *s, size_t len) { + s->len = len; + if (s->cap < s->len) { + s->cap = s->len * 2; + s->data = (char *)realloc(s->data, s->cap); + assert(s->data); + } +} + +void append(String *s, const char *data, size_t len) { + resize(s, s->len + len); + memcpy(s->data + s->len - len, data, len); +} + +typedef enum { space = 0, other = 1, backslash = 2, apostrophe = 3, quotation_mark = 4 } CharClass; +typedef enum { outside, unq, unq_esc, sq, sq_esc, dq, dq_esc } State; + +// current State -> CharClass -> next State +const State transitions[][5] = { + [outside] = {outside, unq, unq_esc, sq, dq}, + [unq] = {outside, unq, unq_esc, sq, dq}, + [unq_esc] = {unq, unq, unq, unq, unq}, + [sq] = {sq, sq, sq_esc, unq, sq}, + [sq_esc] = {sq, sq, sq, sq, sq}, + [dq] = {dq, dq, dq_esc, dq, unq}, + [dq_esc] = {dq, dq, dq, dq, dq}, +}; + +CharClass charClass(int c) { + return c == '\\' ? backslash : c == '\'' ? apostrophe : c == '"' ? quotation_mark : + isspace(c) ? space : other; +} + +// expandArg writes NULL-terminated expansions of `arg', a NULL-terminated +// string, to stdout. If arg does not begin with `@' or does not refer to a +// file, it is written as is. Otherwise the contents of the file are +// recursively expanded. On unexpected EOF in malformed response files an +// incomplete final argument is written, even if it is empty, to parse like GCC. +void expandArg(String *arg) { + FILE *f; + if (arg->data[0] != '@' || !(f = fopen(&arg->data[1], "r"))) { + fwrite(arg->data, 1, arg->len, stdout); + return; + } + + resize(arg, 0); + State cur = outside; + int c; + do { + c = fgetc(f); + State next = transitions[cur][charClass(c)]; + if ((cur == unq && next == outside) || (cur != outside && c == EOF)) { + append(arg, "", 1); + expandArg(arg); + resize(arg, 0); + } else if (cur == unq_esc || cur == sq_esc || cur == dq_esc || + (cur == outside ? next == unq : cur == next)) { + char s = c; + append(arg, &s, 1); + } + cur = next; + } while (c != EOF); + + fclose(f); +} + +int main(int argc, char **argv) { + String arg = { 0 }; + while (*++argv) { + resize(&arg, 0); + append(&arg, *argv, strlen(*argv) + 1); + expandArg(&arg); + } + free(arg.data); + return EXIT_SUCCESS; +} diff --git a/pkgs/build-support/cc-wrapper/utils.sh b/pkgs/build-support/cc-wrapper/utils.sh index 8cefc47816f8..87e48da9c8d5 100644 --- a/pkgs/build-support/cc-wrapper/utils.sh +++ b/pkgs/build-support/cc-wrapper/utils.sh @@ -23,52 +23,18 @@ badPath() { "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP" } -# @args.rsp parser. -# Char classes: space, other, backslash, single quote, double quote. -# States: 0 - outside, 1/2 - unquoted arg/slash, 3/4 - 'arg'/slash, 5/6 - "arg"/slash. -# State transitions: -rspT=(01235 01235 11111 33413 33333 55651 55555) -# Push (a) arg or (c) char on transition: -rspP[10]=a rspP[01]=c rspP[11]=c rspP[21]=c rspP[33]=c rspP[43]=c rspP[55]=c rspP[65]=c - -rspParse() { - rsp=() - local state=0 - local arg='' - local c - - while read -r -N1 c; do - local cls=1 - case "$c" in - ' ' | $'\t' | $'\r' | $'\n') cls=0 ;; - '\') cls=2 ;; - "'") cls=3 ;; - '"') cls=4 ;; - esac - local nextstates="${rspT[$state]}" - local nextstate="${nextstates:$cls:1}" - case "${rspP[$state$nextstate]}" in - 'c') arg+="$c" ;; - 'a') rsp+=("$arg"); arg='' ;; - esac - state="$nextstate" - done - - if [ "$state" -ne 0 ]; then - rsp+=("$arg") - fi -} - expandResponseParams() { - params=() - while [ $# -gt 0 ]; do - local p="$1" - shift - if [ "${p:0:1}" = '@' -a -e "${p:1}" ]; then - rspParse <"${p:1}" - set -- "${rsp[@]}" "$@" - else - params+=("$p") + params=("$@") + local arg + for arg in "$@"; do + if [[ "$arg" == @* ]]; then + if [ -n "@expandResponseParams@" ]; then + readarray -d '' params < <("@expandResponseParams@" "$@") + return 0 + else + echo "Response files aren't supported during bootstrapping" >&2 + return 1 + fi fi done } diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 8e060b87ebd3..57afb1c4ab87 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -1,21 +1,9 @@ -{stdenv, git, cacert}: let - urlToName = url: rev: let - inherit (stdenv.lib) removeSuffix splitString last; - base = last (splitString ":" (baseNameOf (removeSuffix "/" url))); +{stdenv, git, cacert, gitRepoToName}: - matched = builtins.match "(.*).git" base; - - short = builtins.substring 0 7 rev; - - appendShort = if (builtins.match "[a-f0-9]*" rev) != null - then "-${short}" - else ""; - in "${if matched == null then base else builtins.head matched}${appendShort}"; -in { url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? deepClone , fetchSubmodules ? true, deepClone ? false , branchName ? null -, name ? urlToName url rev +, name ? gitRepoToName url rev , # Shell code executed after the file has been fetched # successfully. This can do things like check or transform the file. postFetch ? "" diff --git a/pkgs/build-support/fetchgit/gitrepotoname.nix b/pkgs/build-support/fetchgit/gitrepotoname.nix new file mode 100644 index 000000000000..9f4392c387f6 --- /dev/null +++ b/pkgs/build-support/fetchgit/gitrepotoname.nix @@ -0,0 +1,14 @@ +{ lib }: + +urlOrRepo: rev: let + inherit (lib) removeSuffix splitString last; + base = last (splitString ":" (baseNameOf (removeSuffix "/" urlOrRepo))); + + matched = builtins.match "(.*).git" base; + + short = builtins.substring 0 7 rev; + + appendShort = if (builtins.match "[a-f0-9]*" rev) != null + then "-${short}" + else ""; +in "${if matched == null then base else builtins.head matched}${appendShort}" \ No newline at end of file diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index fa66a1f55406..a180509a3265 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -283,8 +283,8 @@ _clone_user_rev() { if test -z "$(echo "$rev" | tr -d 0123456789abcdef)"; then clone "$dir" "$url" "$rev" "" 1>&2 else - echo 1>&2 "Bad commit hash or bad reference." - exit 1 + # if revision is not hexadecimal it might be a tag + clone "$dir" "$url" "" "refs/tags/$rev" 1>&2 fi;; esac diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index 276db7a7b416..8d40ee3c8aa2 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -9,7 +9,7 @@ let name = "clang-${version}"; unpackPhase = '' - unpackFile ${fetch "cfe" "12n99m60aa680cir3ql56s1jsv6lp61hq4w9rabf4c6vpn7gi9ff"} + unpackFile ${fetch "cfe" "16vnv3msnvx33dydd17k2cq0icndi1a06bg5vcxkrhjjb1rqlwv1"} mv cfe-${version}* clang sourceRoot=$PWD/clang unpackFile ${clang-tools-extra_src} diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix index 20e9d8d4d978..8fee3f4a87ce 100644 --- a/pkgs/development/compilers/llvm/4/default.nix +++ b/pkgs/development/compilers/llvm/4/default.nix @@ -2,7 +2,7 @@ let callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; }); - release_version = "4.0.0"; + release_version = "4.0.1"; version = release_version; # differentiating these is important for rc's fetch = name: sha256: fetchurl { @@ -10,8 +10,8 @@ let inherit sha256; }; - compiler-rt_src = fetch "compiler-rt" "059ipqq27gd928ay06f1ck3vw6y5h5z4zd766x8k0k7jpqimpwnk"; - clang-tools-extra_src = fetch "clang-tools-extra" "16bwckgcxfn56mbqjlxi7fxja0zm9hjfa6s3ncm3dz98n5zd7ds1"; + compiler-rt_src = fetch "compiler-rt" "0h5lpv1z554szi4r4blbskhwrkd78ir50v3ng8xvk1s86fa7gj53"; + clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m"; # Add man output without introducing extra dependencies. overrideManOutput = drv: diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix index a43826d7a310..b74d2fb89dcd 100644 --- a/pkgs/development/compilers/llvm/4/libc++/default.nix +++ b/pkgs/development/compilers/llvm/4/libc++/default.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation rec { name = "libc++-${version}"; - src = fetch "libcxx" "15ngfcjc3pjakpwfq7d4n546jj0rgfdv5rpb1qv9xgv9mp236kag"; + src = fetch "libcxx" "0k6cmjcxnp2pyl8xwy1wkyyckkmdrjddim94yf1gzjbjy9qi22jj"; postUnpack = '' unpackFile ${libcxxabi.src} diff --git a/pkgs/development/compilers/llvm/4/libc++abi.nix b/pkgs/development/compilers/llvm/4/libc++abi.nix index 3a0e996fb9a0..6a3d91101360 100644 --- a/pkgs/development/compilers/llvm/4/libc++abi.nix +++ b/pkgs/development/compilers/llvm/4/libc++abi.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation { name = "libc++abi-${version}"; - src = fetch "libcxxabi" "1n416kv27anabg9jsw6331r28ic30xk46p381lx2vbb2jrhwpafw"; + src = fetch "libcxxabi" "0cqvzallxh0nwiijsf6i4d5ds9m5ijfzywg7376ncv50i64if24g"; nativeBuildInputs = [ cmake ]; buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; diff --git a/pkgs/development/compilers/llvm/4/lld.nix b/pkgs/development/compilers/llvm/4/lld.nix index f9cd72b4200c..776109ee74d1 100644 --- a/pkgs/development/compilers/llvm/4/lld.nix +++ b/pkgs/development/compilers/llvm/4/lld.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { name = "lld-${version}"; - src = fetch "lld" "00km1qawk146pyjqa6aphcdzgkzrmg6cgk0ikg4661ffp5bn9q1k"; + src = fetch "lld" "1v9nkpr158j4yd4zmi6rpnfxkp78r1fapr8wji9s6v176gji1kk3"; nativeBuildInputs = [ cmake ]; buildInputs = [ llvm ]; diff --git a/pkgs/development/compilers/llvm/4/lldb.nix b/pkgs/development/compilers/llvm/4/lldb.nix index a3c46a4c7e94..7d33179913be 100644 --- a/pkgs/development/compilers/llvm/4/lldb.nix +++ b/pkgs/development/compilers/llvm/4/lldb.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { name = "lldb-${version}"; - src = fetch "lldb" "0g83hbw1r4gd0z8hlph9i34xs6dlcc69vz3h2bqwkhb2qq2qzg9d"; + src = fetch "lldb" "0yy43a27zx3r51b6gkv3v2mdiqcq3mf0ngki47ya0i30v3gx4cl4"; patches = [ ./lldb-libedit.patch ]; postPatch = '' diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index c5d22825f301..da40a42d9856 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -22,7 +22,7 @@ }: let - src = fetch "llvm" "1giklnw71wzsgbqg9wb5x7dxnbj39m6zpfvskvzvhwvfz4fm244d"; + src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s"; shlib = if stdenv.isDarwin then "dylib" else "so"; # Used when creating a version-suffixed symlink of libLLVM.dylib @@ -64,13 +64,6 @@ in stdenv.mkDerivation rec { + stdenv.lib.optionalString (enableSharedLibraries) '' substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib patch -p1 < ./llvm-outputs.patch - '' - # Remove broken tests: (https://bugs.llvm.org//show_bug.cgi?id=31610) - + '' - rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll - rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll - rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll - rm test/CodeGen/AMDGPU/runtime-metadata.ll ''; # hacky fix: created binaries need to be run before installation diff --git a/pkgs/development/compilers/llvm/4/openmp.nix b/pkgs/development/compilers/llvm/4/openmp.nix index 197e9a784653..0bdf5c71e1f3 100644 --- a/pkgs/development/compilers/llvm/4/openmp.nix +++ b/pkgs/development/compilers/llvm/4/openmp.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { name = "openmp-${version}"; - src = fetch "openmp" "09kf41zgv551fnv628kqhlwgqkd2bkiwii9gqi6q12djgdddhmfv"; + src = fetch "openmp" "195dykamd39yhi5az7nqj3ksqhb3wq30l93jnfkxl0061qbknsgc"; nativeBuildInputs = [ cmake perl ]; buildInputs = [ llvm ]; diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index a552b2719bb2..f3d4ae4bb00e 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -59,7 +59,7 @@ let srcs = [ rubySrc rubygemsSrc ]; sourceRoot = if useRailsExpress then - "ruby-${tag}-src" + rubySrc.name else unpackdir rubySrc; diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix index 974989dc24bf..9f97b18b4d77 100644 --- a/pkgs/development/libraries/aws-sdk-cpp/default.nix +++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix @@ -26,6 +26,7 @@ in stdenv.mkDerivation rec { # FIXME: might be nice to put different APIs in different outputs # (e.g. libaws-cpp-sdk-s3.so in output "s3"). outputs = [ "out" "dev" ]; + separateDebugInfo = stdenv.isLinux; buildInputs = [ cmake curl ]; diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index d32ec6cbf58b..e4311c0a5e9c 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -14,6 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; outputs = [ "out" "dev" "doc" ]; + separateDebugInfo = stdenv.isLinux; configureFlags = [ "--enable-cplusplus" ] diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 647a34e95dba..1b53acf12b17 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -68,7 +68,8 @@ stdenv.mkDerivation ({ ++ lib.optionals stdenv.isi686 [ ./fix-i686-memchr.patch ./i686-fix-vectorized-strcspn.patch - ]; + ] + ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch; postPatch = # Needed for glibc to build with the gnumake 3.82 diff --git a/pkgs/development/libraries/glibc/fix-x64-abi.patch b/pkgs/development/libraries/glibc/fix-x64-abi.patch new file mode 100644 index 000000000000..1d60dcd7988b --- /dev/null +++ b/pkgs/development/libraries/glibc/fix-x64-abi.patch @@ -0,0 +1,35 @@ +From 3288c6da64add3b4561b8c10fff522027caea01c Mon Sep 17 00:00:00 2001 +From: Nicholas Miell +Date: Sat, 17 Jun 2017 18:21:07 -0700 +Subject: [PATCH] Align the stack on entry to __tls_get_addr() + +Old versions of gcc (4 & 5) didn't align the stack according to the +AMD64 psABI when calling __tls_get_addr(). Apparently new versions of +gcc (7) got much more aggressive about vectorizing and generating MOVAPS +instructions, which means old binaries built with the buggy versions of +gcc are much more likely to crash when using versions of glibc built +using gcc 7. + +For example, a large number of Linux games built using the Unity game +engine and available for purchase on Steam. +--- + elf/dl-tls.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/elf/dl-tls.c b/elf/dl-tls.c +index 5aba33b3fa..3f3cb917de 100644 +--- a/elf/dl-tls.c ++++ b/elf/dl-tls.c +@@ -827,6 +827,10 @@ rtld_hidden_proto (__tls_get_addr) + rtld_hidden_def (__tls_get_addr) + #endif + ++#ifdef __x86_64__ ++/* Old versions of gcc didn't align the stack. */ ++__attribute__((force_align_arg_pointer)) ++#endif + /* The generic dynamic and local dynamic model cannot be used in + statically linked applications. */ + void * +-- +2.13.0 diff --git a/pkgs/development/libraries/gnutls/3.5.nix b/pkgs/development/libraries/gnutls/3.5.nix index e47537c64a9c..62ff25475694 100644 --- a/pkgs/development/libraries/gnutls/3.5.nix +++ b/pkgs/development/libraries/gnutls/3.5.nix @@ -1,11 +1,11 @@ { callPackage, fetchurl, ... } @ args: callPackage ./generic.nix (args // rec { - version = "3.5.13"; + version = "3.5.14"; src = fetchurl { url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz"; - sha256 = "15ihq6p0hnnhs8cnjrkj40dmlcaa1jjg8xg0g2ydbnlqs454ixbr"; + sha256 = "1nhv0mf3apz65ljh335l8xds7wpn08ywljkrvws08apljbn2v8aa"; }; # Skip two tests introduced in 3.5.11. Probable reasons of failure: diff --git a/pkgs/development/libraries/libsodium/default.nix b/pkgs/development/libraries/libsodium/default.nix index bfe224d28cd6..b508b2fea0eb 100644 --- a/pkgs/development/libraries/libsodium/default.nix +++ b/pkgs/development/libraries/libsodium/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation rec { }; outputs = [ "out" "dev" ]; + separateDebugInfo = stdenv.isLinux; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index e6db7af6ee2d..827a556a4688 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -46,9 +46,6 @@ stdenv.mkDerivation rec { buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm; preConfigure = '' - # These paths end up in the default lookup chain. - export TERMINFO_DIRS=/etc/terminfo - export PKG_CONFIG_LIBDIR="$dev/lib/pkgconfig" mkdir -p "$PKG_CONFIG_LIBDIR" configureFlagsArray+=( diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 2120e60ec6aa..c0296f42406d 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -29,6 +29,7 @@ let outputs = [ "bin" "dev" "out" "man" ]; setOutputFlags = false; + separateDebugInfo = stdenv.isLinux; nativeBuildInputs = [ perl ]; buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders; diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 5230df995242..21d89c49e7c7 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation { }; outputs = [ "bin" "dev" "out" ]; + separateDebugInfo = stdenv.isLinux; buildInputs = lib.optionals interactive [ readline ncurses ]; diff --git a/pkgs/os-specific/darwin/ios-cross/default.nix b/pkgs/os-specific/darwin/ios-cross/default.nix index e0981d48c8c9..f56c8148317d 100644 --- a/pkgs/os-specific/darwin/ios-cross/default.nix +++ b/pkgs/os-specific/darwin/ios-cross/default.nix @@ -6,7 +6,9 @@ , stdenv , coreutils , gnugrep -, hostPlatform, targetPlatform +, buildPackages +, hostPlatform +, targetPlatform }: /* As of this writing, known-good prefix/arch/simulator triples: @@ -29,7 +31,7 @@ let sdk = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhone${sdkType}.platform/Developer/SDKs/iPhone${sdkType}${sdkVer}.sdk"; in (import ../../../build-support/cc-wrapper { - inherit stdenv coreutils gnugrep runCommand; + inherit stdenv coreutils gnugrep runCommand buildPackages; nativeTools = false; nativeLibc = false; inherit binutils; diff --git a/pkgs/servers/mail/postfix/pfixtools.nix b/pkgs/servers/mail/postfix/pfixtools.nix index 1bbe6f3466b8..6a0d7fb588fd 100644 --- a/pkgs/servers/mail/postfix/pfixtools.nix +++ b/pkgs/servers/mail/postfix/pfixtools.nix @@ -10,7 +10,7 @@ let sha256 = "1vmbrw686f41n6xfjphfshn96vl07ynvnsyjdw9yfn9bfnldcjcq"; }; - srcRoot = "pfixtools-${pfixtoolsSrc.rev}-src"; + srcRoot = pfixtoolsSrc.name; libCommonSrc = fetchFromGitHub { owner = "Fruneau"; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 0e68b5c8e128..f6d9bcac5104 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -54,14 +54,17 @@ in rec { __sandboxProfile = binShClosure + libSystemProfile; }; - stageFun = step: last: {shell ? "${bootstrapTools}/bin/sh", + stageFun = step: last: {shell ? "${bootstrapTools}/bin/bash", overrides ? (self: super: {}), extraPreHook ? "", extraBuildInputs, allowedRequisites ? null}: let thisStdenv = import ../generic { - inherit config shell extraBuildInputs allowedRequisites; + inherit config shell extraBuildInputs; + allowedRequisites = if allowedRequisites == null then null else allowedRequisites ++ [ + thisStdenv.cc.expand-response-params + ]; name = "stdenv-darwin-boot-${toString step}"; @@ -77,12 +80,17 @@ in rec { nativeTools = true; nativePrefix = bootstrapTools; nativeLibc = false; + buildPackages = lib.optionalAttrs (last ? stdenv) { + inherit (last) stdenv; + }; + hostPlatform = localSystem; + targetPlatform = localSystem; libc = last.pkgs.darwin.Libsystem; isClang = true; cc = { name = "clang-9.9.9"; outPath = bootstrapTools; }; }; - preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/sh") '' + preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/bash") '' # Don't patch #!/interpreter because it leads to retained # dependencies on the bootstrapTools in the final stdenv. dontPatchShebangs=1 @@ -294,6 +302,11 @@ in rec { inherit shell; nativeTools = false; nativeLibc = false; + buildPackages = { + inherit (prevStage) stdenv; + }; + hostPlatform = localSystem; + targetPlatform = localSystem; inherit (pkgs) coreutils binutils gnugrep; inherit (pkgs.darwin) dyld; cc = pkgs.llvmPackages.clang-unwrapped; @@ -314,6 +327,7 @@ in rec { 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 + cc.expand-response-params ]) ++ (with pkgs.darwin; [ dyld Libsystem CF cctools ICU libiconv locale ]); diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index a27aca771abd..c475d2d1e927 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -76,6 +76,11 @@ let else lib.makeOverridable (import ../../build-support/cc-wrapper) { nativeTools = false; nativeLibc = false; + buildPackages = lib.optionalAttrs (prevStage ? stdenv) { + inherit (prevStage) stdenv; + }; + hostPlatform = localSystem; + targetPlatform = localSystem; cc = prevStage.gcc-unwrapped; isGNU = true; libc = prevStage.glibc; @@ -236,6 +241,11 @@ in nativeTools = false; nativeLibc = false; isGNU = true; + buildPackages = { + inherit (prevStage) stdenv; + }; + hostPlatform = localSystem; + targetPlatform = localSystem; cc = prevStage.gcc-unwrapped; libc = self.glibc; inherit (self) stdenv binutils coreutils gnugrep; diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index d1f7c4112c61..daf5a19b01c2 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -29,6 +29,7 @@ stdenv.mkDerivation rec { }; outputs = [ "bin" "dev" "out" "man" "devdoc" ]; + separateDebugInfo = stdenv.isLinux; enableParallelBuilding = true; diff --git a/pkgs/tools/networking/email/default.nix b/pkgs/tools/networking/email/default.nix index 017da63a1e92..c7a6fbcfd7c7 100644 --- a/pkgs/tools/networking/email/default.nix +++ b/pkgs/tools/networking/email/default.nix @@ -8,7 +8,7 @@ let sha256 = "1cxxzhm36civ6vjdgrk7mfmlzkih44kdii6l2xgy4r434s8rzcpn"; }; - srcRoot = "eMail-${eMailSrc.rev}-src"; + srcRoot = eMailSrc.name; dlibSrc = fetchFromGitHub { owner = "deanproxy"; diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index aa9ece8955b4..fc6b1abf24dd 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -57,8 +57,11 @@ stdenv.mkDerivation rec { # Remove example output with (random?) colors and creation date # to avoid non-determinism in the output. postInstall = '' - rm $doc/share/doc/groff/examples/hdtbl/*color*ps - find $doc/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' + rm "$doc"/share/doc/groff/examples/hdtbl/*color*ps + find "$doc"/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' + for f in 'man.local' 'mdoc.local'; do + cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f" + done ''; meta = with stdenv.lib; { diff --git a/pkgs/tools/text/groff/site.tmac b/pkgs/tools/text/groff/site.tmac new file mode 100644 index 000000000000..8ef1040ca4a0 --- /dev/null +++ b/pkgs/tools/text/groff/site.tmac @@ -0,0 +1,16 @@ +. +.if n \{\ +. \" Character translations for non-keyboard +. \" characters - to make them searchable +. if '\*[.T]'utf8' \{\ +. char \- \N'45' +. char - \N'45' +. char ' \N'39' +. char \' \N'39' +. \} +. +. \" Shut off SGR by default (groff colors) +. \" Require GROFF_SGR envvar defined to turn it on +. if '\V[GROFF_SGR]'' \ +. output x X tty: sgr 0 +.\} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f49741b320b3..544632fb226d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -185,8 +185,10 @@ with pkgs; fetchzip = callPackage ../build-support/fetchzip { }; + gitRepoToName = callPackage ../build-support/fetchgit/gitrepotoname.nix { }; + fetchFromGitHub = { - owner, repo, rev, name ? "${repo}-${rev}-src", + owner, repo, rev, name ? gitRepoToName repo rev, fetchSubmodules ? false, private ? false, githubBase ? "github.com", varPrefix ? null, ... # For hash agility @@ -223,7 +225,7 @@ with pkgs; } // passthruAttrs) // { inherit rev; }; fetchFromBitbucket = { - owner, repo, rev, name ? "${repo}-${rev}-src", + owner, repo, rev, name ? gitRepoToName repo rev, ... # For hash agility }@args: fetchzip ({ inherit name; @@ -234,7 +236,7 @@ with pkgs; # cgit example, snapshot support is optional in cgit fetchFromSavannah = { - repo, rev, name ? "${repo}-${rev}-src", + repo, rev, name ? gitRepoToName repo rev, ... # For hash agility }@args: fetchzip ({ inherit name; @@ -244,7 +246,7 @@ with pkgs; # gitlab example fetchFromGitLab = { - owner, repo, rev, name ? "${repo}-${rev}-src", + owner, repo, rev, name ? gitRepoToName repo rev, ... # For hash agility }@args: fetchzip ({ inherit name; @@ -254,7 +256,7 @@ with pkgs; # gitweb example, snapshot support is optional in gitweb fetchFromRepoOrCz = { - repo, rev, name ? "${repo}-${rev}-src", + repo, rev, name ? gitRepoToName repo rev, ... # For hash agility }@args: fetchzip ({ inherit name;