From fac757a77efa87c4050bef653d197381547f1b59 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Jun 2014 11:31:20 +0200 Subject: [PATCH 0001/3123] Make Perl 5.20 the default Perl --- pkgs/top-level/all-packages.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df954e3fae6..c1637d53e72 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3492,13 +3492,13 @@ let perl514 = callPackage ../development/interpreters/perl/5.14 { }; - perl516 = callPackage ../development/interpreters/perl/5.16 { + perl516 = callPackage ../development/interpreters/perl/5.16 { }; + + perl520 = callPackage ../development/interpreters/perl/5.20 { fetchurl = fetchurlBoot; }; - perl520 = callPackage ../development/interpreters/perl/5.20 { }; - - perl = if system != "i686-cygwin" then perl516 else sysPerl; + perl = if system != "i686-cygwin" then perl520 else sysPerl; php = php54; From b0f2d3419c3340978026272496c306287a8cdbd9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Jun 2014 15:38:37 +0200 Subject: [PATCH 0002/3123] Allow multiple hooks with the same name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You can now register multiple values per named hook, e.g. addHook preConfigure "echo foo" addHook preConfigure "echo bar" will cause ‘runHook preConfigure’ to run both ‘echo foo’ and ‘echo bar’ (in that order). It will also call the shell function preConfigure() or eval the shell variable $preConfigure, if defined. Thus, if you don't call addHook, it works like the old hook mechanism. Allowing multiple hooks makes stdenv more modular and extensible. For instance, multiple setup hooks can define a preFixup hook, and all of these will be executed. --- pkgs/stdenv/generic/setup.sh | 53 ++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index c3b9033b49a..de762490715 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,8 +1,38 @@ -# Run the named hook, either by calling the function with that name or -# by evaluating the variable with that name. This allows convenient -# setting of hooks both from Nix expressions (as attributes / -# environment variables) and from shell scripts (as functions). +###################################################################### +# Hook handling. + + +# Add the specified shell code to the named hook, e.g. ‘addHook +# preConfigure "rm ./foo; touch ./bar"’. +addHook() { + local hookName="$1" + local hookCode="$2" + eval "_${hookName}_hooks+=(\"\$hookCode\")" +} + + +# Run all hooks with the specified name in the order in which they +# were added, stopping if any fails (returns a non-zero exit +# code). Hooks are added using ‘addHooks ’, or +# implicitly by defining a shell function or variable . Note +# that the latter takes precedence over hooks added via ‘addHooks’. runHook() { + local hookName="$1" + local var="_${hookName}_hooks" + eval "local -a dummy=(\"\${_${hookName}_hooks[@]}\")" + for hook in "runSingleHook $hookName" "${dummy[@]}"; do + if ! _eval "$hook"; then return 1; fi + done + return 0 +} + + +# Run the named hook, either by calling the function with that name or +# by evaluating the variable with that name. This allows convenient +# setting of hooks both from Nix expressions (as attributes / +# environment variables) and from shell scripts (as functions). If you +# want to allow multiple hooks, use runHook instead. +runSingleHook() { local hookName="$1" case "$(type -t $hookName)" in (function|alias|builtin) $hookName;; @@ -13,6 +43,17 @@ runHook() { } +# A function wrapper around ‘eval’ that ensures that ‘return’ inside +# hooks exits the hook, not the caller. +_eval() { + local code="$1" + eval "$code" +} + + +###################################################################### +# Error handling. + exitHandler() { exitCode=$? set +e @@ -467,7 +508,7 @@ unpackFile() { echo "source archive $curSrc has unknown type" exit 1 fi - runHook unpackCmd + runSingleHook unpackCmd fi ;; esac @@ -505,7 +546,7 @@ unpackPhase() { # Find the source directory. if [ -n "$setSourceRoot" ]; then - runHook setSourceRoot + runSingleHook setSourceRoot elif [ -z "$sourceRoot" ]; then sourceRoot= for i in *; do From 37889e2b5ea444fce8a48fe3bf9250c9ddafa7d0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Jun 2014 16:47:58 +0200 Subject: [PATCH 0003/3123] Provide a hook for per-output fixup --- pkgs/stdenv/generic/setup.sh | 75 +++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index de762490715..14c64e8020d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,3 +1,6 @@ +: ${outputs:=out} + + ###################################################################### # Hook handling. @@ -784,14 +787,16 @@ installPhase() { } -# The fixup phase performs generic, package-independent, Nix-related -# stuff, like running patchelf and setting the -# propagated-build-inputs. It should rarely be overriden. +# The fixup phase performs generic, package-independent stuff, like +# stripping binaries, running patchelf and setting +# propagated-build-inputs. fixupPhase() { - runHook preFixup - # Make sure everything is writable so "strip" et al. work. - if [ -e "$prefix" ]; then chmod -R u+w "$prefix"; fi + for output in $outputs; do + if [ -e "$output" ]; then chmod -R u+w "$output"; fi + done + + runHook preFixup # Put man/doc/info under $out/share. forceShare=${forceShare:=man doc info} @@ -812,10 +817,42 @@ fixupPhase() { done; fi + # Apply fixup to each output. + local output + for output in $outputs; do + prefix=${!output} runHook fixupOutput + done + + if [ -n "$propagatedBuildInputs" ]; then + mkdir -p "$out/nix-support" + echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs" + fi + + if [ -n "$propagatedNativeBuildInputs" ]; then + mkdir -p "$out/nix-support" + echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs" + fi + + if [ -n "$propagatedUserEnvPkgs" ]; then + mkdir -p "$out/nix-support" + echo "$propagatedUserEnvPkgs" > "$out/nix-support/propagated-user-env-packages" + fi + + if [ -n "$setupHook" ]; then + mkdir -p "$out/nix-support" + substituteAll "$setupHook" "$out/nix-support/setup-hook" + fi + + runHook postFixup +} + + +addHook fixupOutput _defaultFixupOutput +_defaultFixupOutput() { if [ -z "$dontGzipMan" ]; then echo "gzipping man pages" GLOBIGNORE=.:..:*.gz:*.bz2 - for f in "$out"/share/man/*/* "$out"/share/man/*/*/*; do + for f in "$prefix"/share/man/*/* "$prefix"/share/man/*/*/*; do if [ -f "$f" -a ! -L "$f" ]; then if gzip -c -n "$f" > "$f".gz; then rm "$f" @@ -824,7 +861,7 @@ fixupPhase() { fi fi done - for f in "$out"/share/man/*/* "$out"/share/man/*/*/*; do + for f in "$prefix"/share/man/*/* "$prefix"/share/man/*/*/*; do if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then ln -sf `readlink "$f"`.gz "$f".gz && rm "$f" fi @@ -852,28 +889,6 @@ fixupPhase() { if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix" fi - - if [ -n "$propagatedBuildInputs" ]; then - mkdir -p "$out/nix-support" - echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs" - fi - - if [ -n "$propagatedNativeBuildInputs" ]; then - mkdir -p "$out/nix-support" - echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs" - fi - - if [ -n "$propagatedUserEnvPkgs" ]; then - mkdir -p "$out/nix-support" - echo "$propagatedUserEnvPkgs" > "$out/nix-support/propagated-user-env-packages" - fi - - if [ -n "$setupHook" ]; then - mkdir -p "$out/nix-support" - substituteAll "$setupHook" "$out/nix-support/setup-hook" - fi - - runHook postFixup } From 0a8605ded168751dbe8bcd0d00d1e38b9d1feded Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Jun 2014 16:51:18 +0200 Subject: [PATCH 0004/3123] Formatting --- pkgs/stdenv/generic/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 0d8355e89cc..039ac76e406 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -23,7 +23,7 @@ let # {pkgs, ...}: # { # allowUnfree = false; - # allowUnfreePredicate = (x: pkgs.lib.hasPrefix "flashplayero-" x.name); + # allowUnfreePredicate = (x: pkgs.lib.hasPrefix "flashplayer-" x.name); # } allowUnfreePredicate = config.allowUnfreePredicate or (x: false); @@ -74,7 +74,9 @@ let unsafeGetAttrPos "name" attrs; pos' = if pos != null then "‘" + pos.file + ":" + toString pos.line + "’" else "«unknown-file»"; in - if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) && !(allowUnfreePredicate attrs) then + if !allowUnfree + && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) + && !allowUnfreePredicate attrs then throw '' Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. You can set { nixpkgs.config.allowUnfree = true; } From b23dbb1a5dffbfa3abb47fcd0f1579ac2e6f29fc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Jun 2014 17:01:29 +0200 Subject: [PATCH 0005/3123] Allow buildInputs to be regular files If a build input is a regular file, use it as a setup hook. This makes setup hooks more efficient to create: you don't need a derivation that copies them to $out/nix-support/setup-hook, instead you can use the file as is. --- pkgs/stdenv/generic/setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 14c64e8020d..d3d2d250e50 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -198,6 +198,10 @@ findInputs() { eval $var="'${!var} $pkg '" + if [ -f $pkg ]; then + source $pkg + fi + if [ -f $pkg/nix-support/setup-hook ]; then source $pkg/nix-support/setup-hook fi From 83a41771abbfcfc027270671be55eb3ed1606a46 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jun 2014 11:15:28 +0200 Subject: [PATCH 0006/3123] Move RPATH shrinking from stdenv to a setup hook provided by patchelf --- .../tools/misc/patchelf/default.nix | 2 ++ .../tools/misc/patchelf/setup-hook.sh | 18 +++++++++++++++ pkgs/stdenv/generic/setup.sh | 17 -------------- pkgs/stdenv/linux/default.nix | 23 ++++++++++--------- 4 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 pkgs/development/tools/misc/patchelf/setup-hook.sh diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix index 06b5c2ef516..5aa81e46bed 100644 --- a/pkgs/development/tools/misc/patchelf/default.nix +++ b/pkgs/development/tools/misc/patchelf/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7"; }; + setupHook = [ ./setup-hook.sh ]; + meta = { homepage = http://nixos.org/patchelf.html; license = "GPL"; diff --git a/pkgs/development/tools/misc/patchelf/setup-hook.sh b/pkgs/development/tools/misc/patchelf/setup-hook.sh new file mode 100644 index 00000000000..e27d1ed5b00 --- /dev/null +++ b/pkgs/development/tools/misc/patchelf/setup-hook.sh @@ -0,0 +1,18 @@ +# This setup hook calls patchelf to automatically remove unneeded +# directories from the RPATH of every library or executable in every +# output. + +if [ -z "$dontPatchELF" ]; then + addHook fixupOutput 'patchELF "$prefix"' +fi + +patchELF() { + header "patching ELF executables and libraries in $prefix" + if [ -e "$prefix" ]; then + find "$prefix" \( \ + \( -type f -a -name "*.so*" \) -o \ + \( -type f -a -perm +0100 \) \ + \) -print -exec patchelf --shrink-rpath '{}' \; + fi + stopNest +} diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index d3d2d250e50..a953176127c 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -702,19 +702,6 @@ checkPhase() { } -patchELF() { - # Patch all ELF executables and shared libraries. - header "patching ELF executables and libraries" - if [ -e "$prefix" ]; then - find "$prefix" \( \ - \( -type f -a -name "*.so*" \) -o \ - \( -type f -a -perm +0100 \) \ - \) -print -exec patchelf --shrink-rpath '{}' \; - fi - stopNest -} - - patchShebangs() { # Rewrite all script interpreter file names (`#! /path') under the # specified directory tree to paths found in $PATH. E.g., @@ -886,10 +873,6 @@ _defaultFixupOutput() { fi fi - if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then - patchELF "$prefix" - fi - if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix" fi diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 23cccf223f4..7169ce9f94e 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -26,7 +26,6 @@ rec { commonPreHook = '' export NIX_ENFORCE_PURITY=1 - havePatchELF=1 ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} ''; @@ -46,7 +45,7 @@ rec { builder = bootstrapFiles.sh; args = - if system == "armv5tel-linux" || system == "armv6l-linux" + if system == "armv5tel-linux" || system == "armv6l-linux" || system == "armv7l-linux" then [ ./scripts/unpack-bootstrap-tools-arm.sh ] else [ ./scripts/unpack-bootstrap-tools.sh ]; @@ -69,10 +68,10 @@ rec { # This function builds the various standard environments used during # the bootstrap. stdenvBootFun = - {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}: + { gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraBuildInputs ? [], fetchurl }: import ../generic { - inherit system config; + inherit system config extraBuildInputs; name = "stdenv-linux-boot"; preHook = '' @@ -82,7 +81,7 @@ rec { ${commonPreHook} ''; shell = "${bootstrapTools}/bin/sh"; - initialPath = [bootstrapTools] ++ extraPath; + initialPath = [ bootstrapTools ]; fetchurlBoot = fetchurl; inherit gcc; # Having the proper 'platform' in all the stdenvs allows getting proper @@ -208,9 +207,9 @@ rec { ppl = pkgs.ppl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; }; extraAttrs = { - glibc = stdenvLinuxGlibc; # Required by gcc47 build + glibc = stdenvLinuxGlibc; # Required by gcc47 build }; - extraPath = [ stdenvLinuxBoot1Pkgs.paxctl ]; + extraBuildInputs = [ stdenvLinuxBoot2Pkgs.patchelf stdenvLinuxBoot1Pkgs.paxctl ]; inherit fetchurl; }; @@ -233,7 +232,7 @@ rec { gcc = stdenvLinuxBoot3Pkgs.gcc.gcc; name = ""; }; - extraPath = [ stdenvLinuxBoot3Pkgs.xz ]; + extraBuildInputs = [ stdenvLinuxBoot2Pkgs.patchelf stdenvLinuxBoot3Pkgs.xz ]; overrides = pkgs: { inherit (stdenvLinuxBoot1Pkgs) perl; inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 gmp; @@ -268,8 +267,10 @@ rec { ''; initialPath = - ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}) - ++ [stdenvLinuxBoot4Pkgs.patchelf stdenvLinuxBoot4Pkgs.paxctl ]; + ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}); + + extraBuildInputs = + [ stdenvLinuxBoot4Pkgs.patchelf stdenvLinuxBoot4Pkgs.paxctl ]; gcc = wrapGCC rec { inherit (stdenvLinuxBoot4Pkgs) binutils coreutils; @@ -284,7 +285,7 @@ rec { fetchurlBoot = fetchurl; extraAttrs = { - inherit (stdenvLinuxBoot3Pkgs) glibc; + glibc = stdenvLinuxGlibc; inherit platform bootstrapTools; shellPackage = stdenvLinuxBoot4Pkgs.bash; }; From d7a4fa26b064aa294b1f52c61b02770feed6903b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jun 2014 11:29:51 +0200 Subject: [PATCH 0007/3123] Fix dontPatchELF being set after the setup script has been sourced --- pkgs/development/tools/misc/patchelf/setup-hook.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/patchelf/setup-hook.sh b/pkgs/development/tools/misc/patchelf/setup-hook.sh index e27d1ed5b00..6bc918a4610 100644 --- a/pkgs/development/tools/misc/patchelf/setup-hook.sh +++ b/pkgs/development/tools/misc/patchelf/setup-hook.sh @@ -2,9 +2,7 @@ # directories from the RPATH of every library or executable in every # output. -if [ -z "$dontPatchELF" ]; then - addHook fixupOutput 'patchELF "$prefix"' -fi +addHook fixupOutput 'if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi' patchELF() { header "patching ELF executables and libraries in $prefix" From daa66b8b1cb2ea5359f9914418350f63f0a53d7e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jun 2014 13:33:05 +0200 Subject: [PATCH 0008/3123] Factor out fixup phase stuff into separate setup hooks --- .../setup-hooks/compress-man-pages.sh | 27 ++++ .../setup-hooks/patch-shebangs.sh | 62 +++++++++ pkgs/build-support/setup-hooks/strip.sh | 36 ++++++ pkgs/stdenv/generic/default.nix | 10 +- pkgs/stdenv/generic/setup.sh | 122 +----------------- 5 files changed, 134 insertions(+), 123 deletions(-) create mode 100644 pkgs/build-support/setup-hooks/compress-man-pages.sh create mode 100644 pkgs/build-support/setup-hooks/patch-shebangs.sh create mode 100644 pkgs/build-support/setup-hooks/strip.sh diff --git a/pkgs/build-support/setup-hooks/compress-man-pages.sh b/pkgs/build-support/setup-hooks/compress-man-pages.sh new file mode 100644 index 00000000000..74c565ebffc --- /dev/null +++ b/pkgs/build-support/setup-hooks/compress-man-pages.sh @@ -0,0 +1,27 @@ +addHook fixupOutput 'if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; fi' + +compressManPages() { + local dir="$1" + + echo "gzipping man pages in $dir" + + GLOBIGNORE=.:..:*.gz:*.bz2 + + for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do + if [ -f "$f" -a ! -L "$f" ]; then + if gzip -c -n "$f" > "$f".gz; then + rm "$f" + else + rm "$f".gz + fi + fi + done + + for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do + if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then + ln -sf `readlink "$f"`.gz "$f".gz && rm "$f" + fi + done + + unset GLOBIGNORE +} diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh new file mode 100644 index 00000000000..6b42291358d --- /dev/null +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -0,0 +1,62 @@ +# This setup hook causes the fixup phase to rewrite all script +# interpreter file names (`#! /path') to paths found in $PATH. E.g., +# /bin/sh will be rewritten to /nix/store/-some-bash/bin/sh. +# /usr/bin/env gets special treatment so that ".../bin/env python" is +# rewritten to /nix/store//bin/python. Interpreters that are +# already in the store are left untouched. + +addHook fixupOutput 'if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix"; fi' + +patchShebangs() { + local dir="$1" + header "patching script interpreter paths in $dir" + local f + local oldPath + local newPath + local arg0 + local args + local oldInterpreterLine + local newInterpreterLine + + find "$dir" -type f -perm +0100 | while read f; do + if [ "$(head -1 "$f" | head -c +2)" != '#!' ]; then + # missing shebang => not a script + continue + fi + + oldInterpreterLine=$(head -1 "$f" | tail -c +3) + read -r oldPath arg0 args <<< "$oldInterpreterLine" + + if $(echo "$oldPath" | grep -q "/bin/env$"); then + # Check for unsupported 'env' functionality: + # - options: something starting with a '-' + # - environment variables: foo=bar + if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then + echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" + exit 1 + fi + newPath="$(command -v "$arg0" || true)" + else + if [ "$oldPath" = "" ]; then + # If no interpreter is specified linux will use /bin/sh. Set + # oldpath="/bin/sh" so that we get /nix/store/.../sh. + oldPath="/bin/sh" + fi + newPath="$(command -v "$(basename "$oldPath")" || true)" + args="$arg0 $args" + fi + + newInterpreterLine="$newPath $args" + + if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then + if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"" + # escape the escape chars so that sed doesn't interpret them + escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g') + sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" + fi + fi + done + + stopNest +} diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh new file mode 100644 index 00000000000..a84f7beaa5a --- /dev/null +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -0,0 +1,36 @@ +# This setup hook strips libraries and executables in the fixup phase. + +addHook fixupOutput _doStrip + +_doStrip() { + if [ -z "$dontStrip" ]; then + stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin} + if [ -n "$stripDebugList" ]; then + stripDirs "$stripDebugList" "${stripDebugFlags:--S}" + fi + + stripAllList=${stripAllList:-} + if [ -n "$stripAllList" ]; then + stripDirs "$stripAllList" "${stripAllFlags:--s}" + fi + fi +} + +stripDirs() { + local dirs="$1" + local stripFlags="$2" + local dirsNew= + + for d in ${dirs}; do + if [ -d "$prefix/$d" ]; then + dirsNew="${dirsNew} $prefix/$d " + fi + done + dirs=${dirsNew} + + if [ -n "${dirs}" ]; then + header "stripping (with flags $stripFlags) in $dirs" + find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $commonStripFlags $stripFlags || true + stopNest + fi +} diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 039ac76e406..f370aec88cf 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -31,6 +31,12 @@ let unsafeGetAttrPos = builtins.unsafeGetAttrPos or (n: as: null); + extraBuildInputs' = extraBuildInputs ++ + [ ../../build-support/setup-hooks/compress-man-pages.sh + ../../build-support/setup-hooks/strip.sh + ../../build-support/setup-hooks/patch-shebangs.sh + ]; + # The stdenv that we are producing. result = @@ -106,10 +112,10 @@ let __ignoreNulls = true; # Inputs built by the cross compiler. - buildInputs = lib.optionals (crossConfig != null) (buildInputs ++ extraBuildInputs); + buildInputs = lib.optionals (crossConfig != null) (buildInputs ++ extraBuildInputs'); propagatedBuildInputs = lib.optionals (crossConfig != null) propagatedBuildInputs; # Inputs built by the usual native compiler. - nativeBuildInputs = nativeBuildInputs ++ lib.optionals (crossConfig == null) (buildInputs ++ extraBuildInputs); + nativeBuildInputs = nativeBuildInputs ++ lib.optionals (crossConfig == null) (buildInputs ++ extraBuildInputs'); propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ lib.optionals (crossConfig == null) propagatedBuildInputs; }))) ( diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index a953176127c..286e9e019b1 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -325,25 +325,6 @@ export NIX_BUILD_CORES # Misc. helper functions. -stripDirs() { - local dirs="$1" - local stripFlags="$2" - local dirsNew= - - for d in ${dirs}; do - if [ -d "$prefix/$d" ]; then - dirsNew="${dirsNew} $prefix/$d " - fi - done - dirs=${dirsNew} - - if [ -n "${dirs}" ]; then - header "stripping (with flags $stripFlags) in $dirs" - find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $commonStripFlags $stripFlags || true - stopNest - fi -} - # PaX-mark binaries paxmark() { local flags="$1" @@ -357,6 +338,7 @@ paxmark() { paxctl -zex -${flags} "$@" } + ###################################################################### # Textual substitution functions. @@ -702,67 +684,6 @@ checkPhase() { } -patchShebangs() { - # Rewrite all script interpreter file names (`#! /path') under the - # specified directory tree to paths found in $PATH. E.g., - # /bin/sh will be rewritten to /nix/store/-some-bash/bin/sh. - # /usr/bin/env gets special treatment so that ".../bin/env python" is - # rewritten to /nix/store//bin/python. - # Interpreters that are already in the store are left untouched. - header "patching script interpreter paths" - local dir="$1" - local f - local oldPath - local newPath - local arg0 - local args - local oldInterpreterLine - local newInterpreterLine - - find "$dir" -type f -perm +0100 | while read f; do - if [ "$(head -1 "$f" | head -c +2)" != '#!' ]; then - # missing shebang => not a script - continue - fi - - oldInterpreterLine=$(head -1 "$f" | tail -c +3) - read -r oldPath arg0 args <<< "$oldInterpreterLine" - - if $(echo "$oldPath" | grep -q "/bin/env$"); then - # Check for unsupported 'env' functionality: - # - options: something starting with a '-' - # - environment variables: foo=bar - if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then - echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" - exit 1 - fi - newPath="$(command -v "$arg0" || true)" - else - if [ "$oldPath" = "" ]; then - # If no interpreter is specified linux will use /bin/sh. Set - # oldpath="/bin/sh" so that we get /nix/store/.../sh. - oldPath="/bin/sh" - fi - newPath="$(command -v "$(basename "$oldPath")" || true)" - args="$arg0 $args" - fi - - newInterpreterLine="$newPath $args" - - if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then - if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"" - # escape the escape chars so that sed doesn't interpret them - escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g') - sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" - fi - fi - done - - stopNest -} - - installPhase() { runHook preInstall @@ -838,47 +759,6 @@ fixupPhase() { } -addHook fixupOutput _defaultFixupOutput -_defaultFixupOutput() { - if [ -z "$dontGzipMan" ]; then - echo "gzipping man pages" - GLOBIGNORE=.:..:*.gz:*.bz2 - for f in "$prefix"/share/man/*/* "$prefix"/share/man/*/*/*; do - if [ -f "$f" -a ! -L "$f" ]; then - if gzip -c -n "$f" > "$f".gz; then - rm "$f" - else - rm "$f".gz - fi - fi - done - for f in "$prefix"/share/man/*/* "$prefix"/share/man/*/*/*; do - if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then - ln -sf `readlink "$f"`.gz "$f".gz && rm "$f" - fi - done - unset GLOBIGNORE - fi - - # TODO: strip _only_ ELF executables, and return || fail here... - if [ -z "$dontStrip" ]; then - stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin} - if [ -n "$stripDebugList" ]; then - stripDirs "$stripDebugList" "${stripDebugFlags:--S}" - fi - - stripAllList=${stripAllList:-} - if [ -n "$stripAllList" ]; then - stripDirs "$stripAllList" "${stripAllFlags:--s}" - fi - fi - - if [ -z "$dontPatchShebangs" ]; then - patchShebangs "$prefix" - fi -} - - installCheckPhase() { runHook preInstallCheck From 5e82aab5d4c6916fb4f35370b6f162d88bc6bf69 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jun 2014 13:40:12 +0200 Subject: [PATCH 0009/3123] Drop redundant space --- pkgs/build-support/setup-hooks/strip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh index a84f7beaa5a..1815297cb6d 100644 --- a/pkgs/build-support/setup-hooks/strip.sh +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -29,7 +29,7 @@ stripDirs() { dirs=${dirsNew} if [ -n "${dirs}" ]; then - header "stripping (with flags $stripFlags) in $dirs" + header "stripping (with flags $stripFlags) in$dirs" find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $commonStripFlags $stripFlags || true stopNest fi From 1a44dbbbb900acb993fc68995fc3cfb50e5122ba Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jun 2014 13:21:30 +0200 Subject: [PATCH 0010/3123] unpackFile: Always copy directories If $src refers to a directory, then always copy it. Previously, we checked the extension first, so if the directory had an extension like .tar, unpackPhase would fail. --- pkgs/build-support/fetchzip/default.nix | 4 +-- pkgs/stdenv/generic/setup.sh | 46 ++++++++++++++----------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix index 7c6e16a0589..12fb69ba8ef 100644 --- a/pkgs/build-support/fetchzip/default.nix +++ b/pkgs/build-support/fetchzip/default.nix @@ -13,9 +13,7 @@ , ... } @ args: fetchurl ({ - # Remove the extension, because otherwise unpackPhase will get - # confused. FIXME: fix unpackPhase. - name = args.name or lib.removeSuffix ".zip" (lib.removeSuffix ".tar.gz" (baseNameOf url)); + name = args.name or (baseNameOf url); recursiveHash = true; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 286e9e019b1..c3ebc3e9b5f 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -475,32 +475,36 @@ unpackFile() { header "unpacking source archive $curSrc" 3 - case "$curSrc" in - *.tar.xz | *.tar.lzma) - # Don't rely on tar knowing about .xz. - xz -d < $curSrc | tar xf - - ;; - *.tar | *.tar.* | *.tgz | *.tbz2) - # GNU tar can automatically select the decompression method - # (info "(tar) gzip"). - tar xf $curSrc - ;; - *.zip) - unzip -qq $curSrc - ;; - *) - if [ -d "$curSrc" ]; then - stripHash $curSrc - cp -prd --no-preserve=timestamps $curSrc $strippedName - else + if [ -d "$curSrc" ]; then + + stripHash $curSrc + cp -prd --no-preserve=timestamps $curSrc $strippedName + + else + + case "$curSrc" in + *.tar.xz | *.tar.lzma) + # Don't rely on tar knowing about .xz. + xz -d < $curSrc | tar xf - + ;; + *.tar | *.tar.* | *.tgz | *.tbz2) + # GNU tar can automatically select the decompression method + # (info "(tar) gzip"). + tar xf $curSrc + ;; + *.zip) + unzip -qq $curSrc + ;; + *) if [ -z "$unpackCmd" ]; then echo "source archive $curSrc has unknown type" exit 1 fi runSingleHook unpackCmd - fi - ;; - esac + ;; + esac + + fi stopNest } From 3e33c975fb850e903feaac4925b8e267493a6205 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jun 2014 13:48:29 +0200 Subject: [PATCH 0011/3123] stdenv: Make unpackFile extensible via the hook mechanism unpackCmd is now a regular hook, so there can be multiple functions hooking into it. --- pkgs/stdenv/generic/setup.sh | 49 ++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index c3ebc3e9b5f..9a756fd4723 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -23,25 +23,41 @@ runHook() { local hookName="$1" local var="_${hookName}_hooks" eval "local -a dummy=(\"\${_${hookName}_hooks[@]}\")" - for hook in "runSingleHook $hookName" "${dummy[@]}"; do + for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do if ! _eval "$hook"; then return 1; fi done return 0 } +# Run all hooks with the specified name, until one succeeds (returns a +# zero exit code). If none succeed, return a non-zero exit code. +runOneHook() { + local hookName="$1" + local var="_${hookName}_hooks" + eval "local -a dummy=(\"\${_${hookName}_hooks[@]}\")" + for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do + if _eval "$hook"; then + return 0 + fi + done + return 1 +} + + # Run the named hook, either by calling the function with that name or # by evaluating the variable with that name. This allows convenient # setting of hooks both from Nix expressions (as attributes / # environment variables) and from shell scripts (as functions). If you # want to allow multiple hooks, use runHook instead. -runSingleHook() { - local hookName="$1" +_callImplicitHook() { + local def="$1" + local hookName="$2" case "$(type -t $hookName)" in (function|alias|builtin) $hookName;; (file) source $hookName;; (keyword) :;; - (*) eval "${!hookName}";; + (*) if [ -z "${!hookName}" ]; then return "$def"; else eval "${!hookName}"; fi;; esac } @@ -469,12 +485,8 @@ stripHash() { } -unpackFile() { - curSrc="$1" - local cmd - - header "unpacking source archive $curSrc" 3 - +addHook unpackCmd _defaultUnpack +_defaultUnpack() { if [ -d "$curSrc" ]; then stripHash $curSrc @@ -496,16 +508,21 @@ unpackFile() { unzip -qq $curSrc ;; *) - if [ -z "$unpackCmd" ]; then - echo "source archive $curSrc has unknown type" - exit 1 - fi - runSingleHook unpackCmd + return 1 ;; esac fi +} + +unpackFile() { + curSrc="$1" + header "unpacking source archive $curSrc" 3 + if ! runOneHook unpackCmd; then + echo "do not know how to unpack source archive $curSrc" + exit 1 + fi stopNest } @@ -539,7 +556,7 @@ unpackPhase() { # Find the source directory. if [ -n "$setSourceRoot" ]; then - runSingleHook setSourceRoot + runOneHook setSourceRoot elif [ -z "$sourceRoot" ]; then sourceRoot= for i in *; do From f97ee61255478e9ca683d1fb7c9fd777247293cb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jun 2014 13:57:20 +0200 Subject: [PATCH 0012/3123] unzip: Clean up expression --- pkgs/tools/archivers/unzip/default.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/archivers/unzip/default.nix b/pkgs/tools/archivers/unzip/default.nix index f939c968c44..0f8ddb17059 100644 --- a/pkgs/tools/archivers/unzip/default.nix +++ b/pkgs/tools/archivers/unzip/default.nix @@ -1,14 +1,21 @@ { stdenv, fetchurl, bzip2 , enableNLS ? false, libnatspec }: -stdenv.mkDerivation ({ +stdenv.mkDerivation { name = "unzip-6.0"; - + src = fetchurl { url = mirror://sourceforge/infozip/unzip60.tar.gz; sha256 = "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"; }; + patches = stdenv.lib.optional enableNLS + (fetchurl { + url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/unzip/files/unzip-6.0-natspec.patch?revision=1.1"; + name = "unzip-6.0-natspec.patch"; + sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1"; + }); + nativeBuildInputs = [ bzip2 ]; buildInputs = [ bzip2 ] ++ stdenv.lib.optional enableNLS libnatspec; @@ -30,13 +37,4 @@ stdenv.mkDerivation ({ license = "free"; # http://www.info-zip.org/license.html platforms = stdenv.lib.platforms.all; }; -} // (if enableNLS then { - patches = - [ ( fetchurl { - url = - "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/unzip/files/unzip-6.0-natspec.patch?revision=1.1"; - name = "unzip-6.0-natspec.patch"; - sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1"; - }) - ]; -} else {})) +} From d7b356f73b41640f5ee741f004c4fb41e0471d30 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jun 2014 14:12:35 +0200 Subject: [PATCH 0013/3123] stdenv: Move unzip support to unzip's setup hook --- pkgs/stdenv/generic/setup.sh | 11 ++++------- pkgs/tools/archivers/unzip/default.nix | 2 ++ pkgs/tools/archivers/unzip/setup-hook.sh | 5 +++++ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 pkgs/tools/archivers/unzip/setup-hook.sh diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 9a756fd4723..e5fdbdf2d53 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -489,23 +489,20 @@ addHook unpackCmd _defaultUnpack _defaultUnpack() { if [ -d "$curSrc" ]; then - stripHash $curSrc - cp -prd --no-preserve=timestamps $curSrc $strippedName + stripHash "$curSrc" + cp -prd --no-preserve=timestamps "$curSrc" $strippedName else case "$curSrc" in *.tar.xz | *.tar.lzma) # Don't rely on tar knowing about .xz. - xz -d < $curSrc | tar xf - + xz -d < "$curSrc" | tar xf - ;; *.tar | *.tar.* | *.tgz | *.tbz2) # GNU tar can automatically select the decompression method # (info "(tar) gzip"). - tar xf $curSrc - ;; - *.zip) - unzip -qq $curSrc + tar xf "$curSrc" ;; *) return 1 diff --git a/pkgs/tools/archivers/unzip/default.nix b/pkgs/tools/archivers/unzip/default.nix index 0f8ddb17059..7f2c81e2797 100644 --- a/pkgs/tools/archivers/unzip/default.nix +++ b/pkgs/tools/archivers/unzip/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation { installFlags = "prefix=$(out)"; + setupHook = ./setup-hook.sh; + meta = { homepage = http://www.info-zip.org; description = "An extraction utility for archives compressed in .zip format"; diff --git a/pkgs/tools/archivers/unzip/setup-hook.sh b/pkgs/tools/archivers/unzip/setup-hook.sh new file mode 100644 index 00000000000..47894ded023 --- /dev/null +++ b/pkgs/tools/archivers/unzip/setup-hook.sh @@ -0,0 +1,5 @@ +addHook unpackCmd _tryUnzip +_tryUnzip() { + if ! [[ "foo.zip" =~ \.zip$ ]]; then return 1; fi + unzip -qq "$curSrc" +} From 9f822e5477bc32b77af39b5bf8cf50b56b97c196 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jun 2014 14:26:23 +0200 Subject: [PATCH 0014/3123] stdenv: Move paxmark function to paxctl's setup hook --- pkgs/os-specific/linux/paxctl/default.nix | 2 ++ pkgs/os-specific/linux/paxctl/setup-hook.sh | 8 ++++++++ pkgs/stdenv/generic/builder.sh | 1 - pkgs/stdenv/generic/default.nix | 8 +++----- pkgs/stdenv/generic/setup.sh | 19 +++---------------- 5 files changed, 16 insertions(+), 22 deletions(-) create mode 100644 pkgs/os-specific/linux/paxctl/setup-hook.sh diff --git a/pkgs/os-specific/linux/paxctl/default.nix b/pkgs/os-specific/linux/paxctl/default.nix index 8e70ddd8434..795ffa38ac4 100644 --- a/pkgs/os-specific/linux/paxctl/default.nix +++ b/pkgs/os-specific/linux/paxctl/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { "MANDIR=share/man/man1" ]; + setupHook = ./setup-hook.sh; + meta = with stdenv.lib; { description = "A tool for controlling PaX flags on a per binary basis"; homepage = "https://pax.grsecurity.net"; diff --git a/pkgs/os-specific/linux/paxctl/setup-hook.sh b/pkgs/os-specific/linux/paxctl/setup-hook.sh new file mode 100644 index 00000000000..11a6bb9910f --- /dev/null +++ b/pkgs/os-specific/linux/paxctl/setup-hook.sh @@ -0,0 +1,8 @@ +# PaX-mark binaries. +paxmark() { + local flags="$1" + shift + + paxctl -c "$@" + paxctl -zex -${flags} "$@" +} diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index 60360e7b825..fd4c17ca251 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -12,7 +12,6 @@ cat "$setup" >> $out/setup sed -e "s^@initialPath@^$initialPath^g" \ -e "s^@gcc@^$gcc^g" \ -e "s^@shell@^$shell^g" \ - -e "s^@needsPax@^$needsPax^g" \ < $out/setup > $out/setup.tmp mv $out/setup.tmp $out/setup diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index f370aec88cf..28a3c1e9f3b 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -10,8 +10,6 @@ let lib = import ../../../lib; in lib.makeOverridable ( , setupScript ? ./setup.sh , extraBuildInputs ? [] - -, skipPaxMarking ? false }: let @@ -56,9 +54,6 @@ let inherit preHook initialPath gcc shell; - # Whether we should run paxctl to pax-mark binaries - needsPax = result.isLinux && !skipPaxMarking; - propagatedUserEnvPkgs = [gcc] ++ lib.filter lib.isDerivation initialPath; } @@ -181,6 +176,9 @@ let || system == "armv6l-linux" || system == "armv7l-linux"; + # Whether we should run paxctl to pax-mark binaries. + needsPax = isLinux; + # For convenience, bring in the library functions in lib/ so # packages don't have to do that themselves. inherit lib; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e5fdbdf2d53..72db7dc6004 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -337,22 +337,9 @@ fi export NIX_BUILD_CORES -###################################################################### -# Misc. helper functions. - - -# PaX-mark binaries -paxmark() { - local flags="$1" - shift - - if [ -z "@needsPax@" ]; then - return - fi - - paxctl -c "$@" - paxctl -zex -${flags} "$@" -} +# Dummy implementation of the paxmark function. On Linux, this is +# overwritten by paxctl's setup hook. +paxmark() { true; } ###################################################################### From 15103e5e5fb01556e9c5758ef99d7e7f5d0f7699 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jul 2014 16:17:23 +0200 Subject: [PATCH 0015/3123] stdenv: Remove the special handling of gcc Now gcc is just another build input, making it possible in the future to have a stdenv that doesn't depend on a C compiler. This is very useful on NixOS, since it would allow trivial builders like writeTextFile to work without pulling in the C compiler. --- .../build-support/clang-wrapper/setup-hook.sh | 2 + pkgs/build-support/gcc-wrapper/setup-hook.sh | 2 + pkgs/stdenv/generic/builder.sh | 1 - pkgs/stdenv/generic/default.nix | 5 +- pkgs/stdenv/generic/setup.sh | 53 +++++++++---------- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/pkgs/build-support/clang-wrapper/setup-hook.sh b/pkgs/build-support/clang-wrapper/setup-hook.sh index f7687651eaf..538e6263e72 100644 --- a/pkgs/build-support/clang-wrapper/setup-hook.sh +++ b/pkgs/build-support/clang-wrapper/setup-hook.sh @@ -1,3 +1,5 @@ +export NIX_GCC=@out@ + addCVars () { if test -d $1/include; then export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh index 298ade21d1f..ea762e9b405 100644 --- a/pkgs/build-support/gcc-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh @@ -1,3 +1,5 @@ +export NIX_GCC=@out@ + addCVars () { if test -d $1/include; then export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index fd4c17ca251..fc41976b7d1 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -10,7 +10,6 @@ echo "$preHook" > $out/setup cat "$setup" >> $out/setup sed -e "s^@initialPath@^$initialPath^g" \ - -e "s^@gcc@^$gcc^g" \ -e "s^@shell@^$shell^g" \ < $out/setup > $out/setup.tmp mv $out/setup.tmp $out/setup diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 28a3c1e9f3b..3d9cec05a35 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -33,6 +33,7 @@ let [ ../../build-support/setup-hooks/compress-man-pages.sh ../../build-support/setup-hooks/strip.sh ../../build-support/setup-hooks/patch-shebangs.sh + gcc ]; # The stdenv that we are producing. @@ -52,7 +53,7 @@ let setup = setupScript; - inherit preHook initialPath gcc shell; + inherit preHook initialPath shell; propagatedUserEnvPkgs = [gcc] ++ lib.filter lib.isDerivation initialPath; @@ -186,6 +187,8 @@ let inherit fetchurlBoot; inherit overrides; + + inherit gcc; } # Propagate any extra attributes. For instance, we use this to diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 72db7dc6004..675d8ce797d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,3 +1,5 @@ +set -e + : ${outputs:=out} @@ -115,7 +117,7 @@ trap "exitHandler" EXIT ###################################################################### -# Helper functions that might be useful in setup hooks. +# Helper functions. addToSearchPathWithCustomDelimiter() { @@ -134,13 +136,24 @@ addToSearchPath() { } +ensureDir() { + echo "warning: ‘ensureDir’ is deprecated; use ‘mkdir’ instead" >&2 + local dir + for dir in "$@"; do + if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi + done +} + + +installBin() { + mkdir -p $out/bin + cp "$@" $out/bin +} + + ###################################################################### # Initialisation. -set -e - -[ -z $NIX_GCC ] && NIX_GCC=@gcc@ - # Wildcard expansions that don't match should expand to an empty list. # This ensures that, for instance, "for i in *; do ...; done" does the @@ -150,7 +163,7 @@ shopt -s nullglob # Set up the initial path. PATH= -for i in $NIX_GCC @initialPath@; do +for i in @initialPath@; do if [ "$i" = / ]; then i=; fi addToSearchPath PATH $i/bin addToSearchPath PATH $i/sbin @@ -171,27 +184,9 @@ runHook preHook # Check that the pre-hook initialised SHELL. if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi -# Hack: run gcc's setup hook. + envHooks=() crossEnvHooks=() -if [ -f $NIX_GCC/nix-support/setup-hook ]; then - source $NIX_GCC/nix-support/setup-hook -fi - - -# Ensure that the given directories exists. -ensureDir() { - echo "warning: ‘ensureDir’ is deprecated; use ‘mkdir’ instead" >&2 - local dir - for dir in "$@"; do - if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi - done -} - -installBin() { - mkdir -p $out/bin - cp "$@" $out/bin -} # Allow the caller to augment buildInputs (it's not always possible to @@ -242,7 +237,7 @@ done # Set the relevant environment variables to point to the build inputs # found above. -addToNativeEnv() { +_addToNativeEnv() { local pkg=$1 if [ -d $1/bin ]; then @@ -256,10 +251,10 @@ addToNativeEnv() { } for i in $nativePkgs; do - addToNativeEnv $i + _addToNativeEnv $i done -addToCrossEnv() { +_addToCrossEnv() { local pkg=$1 # Some programs put important build scripts (freetype-config and similar) @@ -276,7 +271,7 @@ addToCrossEnv() { } for i in $crossPkgs; do - addToCrossEnv $i + _addToCrossEnv $i done From cd948c093faef02b964f15a973313129fb029613 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jul 2014 16:43:52 +0200 Subject: [PATCH 0016/3123] stdenv: Reindent --- pkgs/stdenv/generic/default.nix | 140 ++++++++++++++++---------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 3d9cec05a35..2c9ede898de 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -36,6 +36,73 @@ let gcc ]; + # Add a utility function to produce derivations that use this + # stdenv and its shell. + mkDerivation = attrs: + let + pos = + if attrs.meta.description or null != null then + unsafeGetAttrPos "description" attrs.meta + else + unsafeGetAttrPos "name" attrs; + pos' = if pos != null then "‘" + pos.file + ":" + toString pos.line + "’" else "«unknown-file»"; + in + if !allowUnfree + && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) + && !allowUnfreePredicate attrs then + throw '' + Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. You can set + { nixpkgs.config.allowUnfree = true; } + in configuration.nix to override this. If you use Nix standalone, you can add + { allowUnfree = true; } + to ~/.nixpkgs/config.nix.'' + else if !allowBroken && attrs.meta.broken or false then + throw "you can't use package ‘${attrs.name}’ in ${pos'} because it has been marked as broken" + else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then + throw "the package ‘${attrs.name}’ in ${pos'} is not supported on ‘${result.system}’" + else + lib.addPassthru (derivation ( + (removeAttrs attrs ["meta" "passthru" "crossAttrs"]) + // (let + buildInputs = attrs.buildInputs or []; + nativeBuildInputs = attrs.nativeBuildInputs or []; + propagatedBuildInputs = attrs.propagatedBuildInputs or []; + propagatedNativeBuildInputs = attrs.propagatedNativeBuildInputs or []; + crossConfig = attrs.crossConfig or null; + in + { + builder = attrs.realBuilder or shell; + args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; + stdenv = result; + system = result.system; + userHook = config.stdenv.userHook or null; + __ignoreNulls = true; + + # Inputs built by the cross compiler. + buildInputs = lib.optionals (crossConfig != null) (buildInputs ++ extraBuildInputs'); + propagatedBuildInputs = lib.optionals (crossConfig != null) propagatedBuildInputs; + # Inputs built by the usual native compiler. + nativeBuildInputs = nativeBuildInputs ++ lib.optionals (crossConfig == null) (buildInputs ++ extraBuildInputs'); + propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ + lib.optionals (crossConfig == null) propagatedBuildInputs; + }))) ( + { + # The meta attribute is passed in the resulting attribute set, + # but it's not part of the actual derivation, i.e., it's not + # passed to the builder and is not a dependency. But since we + # include it in the result, it *is* available to nix-env for + # queries. We also a meta.position attribute here to + # identify the source location of the package. + meta = attrs.meta or {} // (if pos != null then { + position = pos.file + ":" + (toString pos.line); + } else {}); + passthru = attrs.passthru or {}; + } // + # Pass through extra attributes that are not inputs, but + # should be made available to Nix expressions using the + # derivation (e.g., in assertions). + (attrs.passthru or {})); + # The stdenv that we are producing. result = @@ -61,76 +128,7 @@ let // rec { - meta = { - description = "The default build environment for Unix packages in Nixpkgs"; - }; - - # Add a utility function to produce derivations that use this - # stdenv and its shell. - mkDerivation = attrs: - let - pos = - if attrs.meta.description or null != null then - unsafeGetAttrPos "description" attrs.meta - else - unsafeGetAttrPos "name" attrs; - pos' = if pos != null then "‘" + pos.file + ":" + toString pos.line + "’" else "«unknown-file»"; - in - if !allowUnfree - && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) - && !allowUnfreePredicate attrs then - throw '' - Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. You can set - { nixpkgs.config.allowUnfree = true; } - in configuration.nix to override this. If you use Nix standalone, you can add - { allowUnfree = true; } - to ~/.nixpkgs/config.nix.'' - else if !allowBroken && attrs.meta.broken or false then - throw "you can't use package ‘${attrs.name}’ in ${pos'} because it has been marked as broken" - else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then - throw "the package ‘${attrs.name}’ in ${pos'} is not supported on ‘${result.system}’" - else - lib.addPassthru (derivation ( - (removeAttrs attrs ["meta" "passthru" "crossAttrs"]) - // (let - buildInputs = attrs.buildInputs or []; - nativeBuildInputs = attrs.nativeBuildInputs or []; - propagatedBuildInputs = attrs.propagatedBuildInputs or []; - propagatedNativeBuildInputs = attrs.propagatedNativeBuildInputs or []; - crossConfig = attrs.crossConfig or null; - in - { - builder = attrs.realBuilder or shell; - args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; - stdenv = result; - system = result.system; - userHook = config.stdenv.userHook or null; - __ignoreNulls = true; - - # Inputs built by the cross compiler. - buildInputs = lib.optionals (crossConfig != null) (buildInputs ++ extraBuildInputs'); - propagatedBuildInputs = lib.optionals (crossConfig != null) propagatedBuildInputs; - # Inputs built by the usual native compiler. - nativeBuildInputs = nativeBuildInputs ++ lib.optionals (crossConfig == null) (buildInputs ++ extraBuildInputs'); - propagatedNativeBuildInputs = propagatedNativeBuildInputs ++ - lib.optionals (crossConfig == null) propagatedBuildInputs; - }))) ( - { - # The meta attribute is passed in the resulting attribute set, - # but it's not part of the actual derivation, i.e., it's not - # passed to the builder and is not a dependency. But since we - # include it in the result, it *is* available to nix-env for - # queries. We also a meta.position attribute here to - # identify the source location of the package. - meta = attrs.meta or {} // (if pos != null then { - position = pos.file + ":" + (toString pos.line); - } else {}); - passthru = attrs.passthru or {}; - } // - # Pass through extra attributes that are not inputs, but - # should be made available to Nix expressions using the - # derivation (e.g., in assertions). - (attrs.passthru or {})); + meta.description = "The default build environment for Unix packages in Nixpkgs"; # Utility flags to test the type of platform. isDarwin = system == "x86_64-darwin"; @@ -180,6 +178,8 @@ let # Whether we should run paxctl to pax-mark binaries. needsPax = isLinux; + inherit mkDerivation; + # For convenience, bring in the library functions in lib/ so # packages don't have to do that themselves. inherit lib; From be3fc3ae2f3a782226d2b8b8ec36c37f18fa12a3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jul 2014 17:21:32 +0200 Subject: [PATCH 0017/3123] Prevent an unnecessary evaluation of lib --- pkgs/stdenv/default.nix | 6 +++--- pkgs/stdenv/linux/default.nix | 4 +--- pkgs/stdenv/nix/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 47d1fb6d9f7..e056505f1b7 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -5,7 +5,7 @@ # Posix utilities, the GNU C compiler, and so on. On other systems, # we use the native C library. -{ system, allPackages ? import ../.., platform, config }: +{ system, allPackages ? import ../.., platform, config, lib }: rec { @@ -28,14 +28,14 @@ rec { # The Nix build environment. stdenvNix = import ./nix { - inherit config; + inherit config lib; stdenv = stdenvNative; pkgs = stdenvNativePkgs; }; # Linux standard environment. - stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux; + stdenvLinux = (import ./linux { inherit system allPackages platform config lib; }).stdenvLinux; # Select the appropriate stdenv for the platform `system'. diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 7169ce9f94e..d96a9483285 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -7,12 +7,10 @@ # The function defaults are for easy testing. { system ? builtins.currentSystem , allPackages ? import ../../top-level/all-packages.nix -, platform ? null, config ? {} }: +, platform ? null, config ? {}, lib }: rec { - lib = import ../../../lib; - bootstrapFiles = if system == "i686-linux" then import ./bootstrap/i686.nix else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index a496a819a6d..c7dd659195b 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs, config }: +{ stdenv, pkgs, config, lib }: import ../generic rec { inherit config; @@ -7,7 +7,7 @@ import ../generic rec { '' export NIX_ENFORCE_PURITY=1 export NIX_IGNORE_LD_THROUGH_GCC=1 - '' + (if stdenv.isDarwin then '' + '' + lib.optionalString stdenv.isDarwin '' export NIX_ENFORCE_PURITY= export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 @@ -18,7 +18,7 @@ import ../generic rec { export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true) export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib" - '' else ""); + ''; initialPath = (import ../common-path.nix) {pkgs = pkgs;}; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7f4e270076..c3d5f802b52 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -205,7 +205,7 @@ let allStdenvs = import ../stdenv { - inherit system platform config; + inherit system platform config lib; allPackages = args: import ./all-packages.nix ({ inherit config system; } // args); }; From e3875297fac671f20feb803306e7c55789ac749e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jul 2014 17:39:07 +0200 Subject: [PATCH 0018/3123] stdenv: Don't use sed to build the setup script --- pkgs/stdenv/generic/builder.sh | 9 +++------ pkgs/stdenv/generic/default.nix | 5 ----- pkgs/stdenv/generic/setup.sh | 14 ++++++-------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index fc41976b7d1..4fa722a73dd 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -6,14 +6,11 @@ done mkdir $out -echo "$preHook" > $out/setup +echo "export SHELL=$shell" > $out/setup +echo "initialPath=\"$initialPath\"" >> $out/setup +echo "$preHook" >> $out/setup cat "$setup" >> $out/setup -sed -e "s^@initialPath@^$initialPath^g" \ - -e "s^@shell@^$shell^g" \ - < $out/setup > $out/setup.tmp -mv $out/setup.tmp $out/setup - # Allow the user to install stdenv using nix-env and get the packages # in stdenv. mkdir $out/nix-support diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 2c9ede898de..0ff0bcebbd4 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -112,11 +112,6 @@ let builder = shell; args = ["-e" ./builder.sh]; - /* TODO: special-cased @var@ substitutions are ugly. - However, using substituteAll* from setup.sh seems difficult, - as setup.sh can't be directly sourced. - Suggestion: split similar utility functions into a separate script. - */ setup = setupScript; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 675d8ce797d..6ed94673ae7 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -163,7 +163,7 @@ shopt -s nullglob # Set up the initial path. PATH= -for i in @initialPath@; do +for i in $initialPath; do if [ "$i" = / ]; then i=; fi addToSearchPath PATH $i/bin addToSearchPath PATH $i/sbin @@ -174,17 +174,15 @@ if [ "$NIX_DEBUG" = 1 ]; then fi -# Execute the pre-hook. -export SHELL=@shell@ -export CONFIG_SHELL="$SHELL" -if [ -z "$shell" ]; then export shell=@shell@; fi -runHook preHook - - # Check that the pre-hook initialised SHELL. if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi +# Execute the pre-hook. +export CONFIG_SHELL="$SHELL" +if [ -z "$shell" ]; then export shell=$SHELL; fi + + envHooks=() crossEnvHooks=() From 2def8e74990d89bd91b8943c00110027a1f5fafa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 13:47:09 +0200 Subject: [PATCH 0019/3123] Remove addHook Just use bash arrays directly. I.e. addHook preConfigure myPreConfigure is now preConfigureHooks+=(myPreConfigure) --- .../setup-hooks/compress-man-pages.sh | 2 +- .../setup-hooks/patch-shebangs.sh | 2 +- pkgs/build-support/setup-hooks/strip.sh | 2 +- .../tools/misc/patchelf/setup-hook.sh | 2 +- pkgs/stdenv/generic/setup.sh | 27 +++++++------------ pkgs/tools/archivers/unzip/setup-hook.sh | 2 +- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/pkgs/build-support/setup-hooks/compress-man-pages.sh b/pkgs/build-support/setup-hooks/compress-man-pages.sh index 74c565ebffc..1dd9788419b 100644 --- a/pkgs/build-support/setup-hooks/compress-man-pages.sh +++ b/pkgs/build-support/setup-hooks/compress-man-pages.sh @@ -1,4 +1,4 @@ -addHook fixupOutput 'if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; fi' +fixupOutputHooks+=('if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; fi') compressManPages() { local dir="$1" diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index 6b42291358d..5a7f23b2d81 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -5,7 +5,7 @@ # rewritten to /nix/store//bin/python. Interpreters that are # already in the store are left untouched. -addHook fixupOutput 'if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix"; fi' +fixupOutputHooks+=('if [ -z "$dontPatchShebangs" ]; then patchShebangs "$prefix"; fi') patchShebangs() { local dir="$1" diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh index 1815297cb6d..6860c9b9cb9 100644 --- a/pkgs/build-support/setup-hooks/strip.sh +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -1,6 +1,6 @@ # This setup hook strips libraries and executables in the fixup phase. -addHook fixupOutput _doStrip +fixupOutputHooks+=(_doStrip) _doStrip() { if [ -z "$dontStrip" ]; then diff --git a/pkgs/development/tools/misc/patchelf/setup-hook.sh b/pkgs/development/tools/misc/patchelf/setup-hook.sh index 6bc918a4610..b0d37b73e2b 100644 --- a/pkgs/development/tools/misc/patchelf/setup-hook.sh +++ b/pkgs/development/tools/misc/patchelf/setup-hook.sh @@ -2,7 +2,7 @@ # directories from the RPATH of every library or executable in every # output. -addHook fixupOutput 'if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi' +fixupOutputHooks+=('if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi') patchELF() { header "patching ELF executables and libraries in $prefix" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 6ed94673ae7..cdebf6e4b27 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -7,24 +7,15 @@ set -e # Hook handling. -# Add the specified shell code to the named hook, e.g. ‘addHook -# preConfigure "rm ./foo; touch ./bar"’. -addHook() { - local hookName="$1" - local hookCode="$2" - eval "_${hookName}_hooks+=(\"\$hookCode\")" -} - - # Run all hooks with the specified name in the order in which they # were added, stopping if any fails (returns a non-zero exit -# code). Hooks are added using ‘addHooks ’, or -# implicitly by defining a shell function or variable . Note -# that the latter takes precedence over hooks added via ‘addHooks’. +# code). The hooks for are the shell function or variable +# , and the values of the shell array ‘Hooks’. runHook() { local hookName="$1" - local var="_${hookName}_hooks" - eval "local -a dummy=(\"\${_${hookName}_hooks[@]}\")" + local var="$hookName" + if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + eval "local -a dummy=(\"\${$var[@]}\")" for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do if ! _eval "$hook"; then return 1; fi done @@ -36,8 +27,9 @@ runHook() { # zero exit code). If none succeed, return a non-zero exit code. runOneHook() { local hookName="$1" - local var="_${hookName}_hooks" - eval "local -a dummy=(\"\${_${hookName}_hooks[@]}\")" + local var="$hookName" + if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi + eval "local -a dummy=(\"\${$var[@]}\")" for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do if _eval "$hook"; then return 0 @@ -465,7 +457,7 @@ stripHash() { } -addHook unpackCmd _defaultUnpack +unpackCmdHooks+=(_defaultUnpack) _defaultUnpack() { if [ -d "$curSrc" ]; then @@ -856,7 +848,6 @@ genericBuild() { # Execute the post-hooks. -for i in "${postHooks[@]}"; do $i; done runHook postHook diff --git a/pkgs/tools/archivers/unzip/setup-hook.sh b/pkgs/tools/archivers/unzip/setup-hook.sh index 47894ded023..4cad0fe7e91 100644 --- a/pkgs/tools/archivers/unzip/setup-hook.sh +++ b/pkgs/tools/archivers/unzip/setup-hook.sh @@ -1,4 +1,4 @@ -addHook unpackCmd _tryUnzip +unpackCmdHooks+=(_tryUnzip) _tryUnzip() { if ! [[ "foo.zip" =~ \.zip$ ]]; then return 1; fi unzip -qq "$curSrc" From 11dc9036d0b1f7bb9e277240848e699c0de90d4e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 14:14:28 +0200 Subject: [PATCH 0020/3123] Allow passing arguments to hooks This allows envHooks and crossEnvHooks to be handled using the regular hook mechanism. --- pkgs/stdenv/generic/setup.sh | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index cdebf6e4b27..daba3b5db41 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -13,11 +13,12 @@ set -e # , and the values of the shell array ‘Hooks’. runHook() { local hookName="$1" + shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi eval "local -a dummy=(\"\${$var[@]}\")" for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do - if ! _eval "$hook"; then return 1; fi + if ! _eval "$hook" "$@"; then return 1; fi done return 0 } @@ -27,11 +28,12 @@ runHook() { # zero exit code). If none succeed, return a non-zero exit code. runOneHook() { local hookName="$1" + shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi eval "local -a dummy=(\"\${$var[@]}\")" for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do - if _eval "$hook"; then + if _eval "$hook" "$@"; then return 0 fi done @@ -60,7 +62,12 @@ _callImplicitHook() { # hooks exits the hook, not the caller. _eval() { local code="$1" - eval "$code" + shift + if [ "$(type -t $code)" = function ]; then + eval "$code \"\$@\"" + else + eval "$code" + fi } @@ -175,10 +182,6 @@ export CONFIG_SHELL="$SHELL" if [ -z "$shell" ]; then export shell=$SHELL; fi -envHooks=() -crossEnvHooks=() - - # Allow the caller to augment buildInputs (it's not always possible to # do this before the call to setup.sh, since the PATH is empty at that # point; here we have a basic Unix environment). @@ -235,9 +238,7 @@ _addToNativeEnv() { fi # Run the package-specific hooks set by the setup-hook scripts. - for i in "${envHooks[@]}"; do - $i $pkg - done + runHook envHook "$pkg" } for i in $nativePkgs; do @@ -255,9 +256,7 @@ _addToCrossEnv() { fi # Run the package-specific hooks set by the setup-hook scripts. - for i in "${crossEnvHooks[@]}"; do - $i $pkg - done + runHook crossEnvHook "$pkg" } for i in $crossPkgs; do @@ -459,22 +458,24 @@ stripHash() { unpackCmdHooks+=(_defaultUnpack) _defaultUnpack() { - if [ -d "$curSrc" ]; then + local fn="$1" - stripHash "$curSrc" - cp -prd --no-preserve=timestamps "$curSrc" $strippedName + if [ -d "$fn" ]; then + + stripHash "$fn" + cp -prd --no-preserve=timestamps "$fn" $strippedName else - case "$curSrc" in + case "$fn" in *.tar.xz | *.tar.lzma) # Don't rely on tar knowing about .xz. - xz -d < "$curSrc" | tar xf - + xz -d < "$fn" | tar xf - ;; *.tar | *.tar.* | *.tgz | *.tbz2) # GNU tar can automatically select the decompression method # (info "(tar) gzip"). - tar xf "$curSrc" + tar xf "$fn" ;; *) return 1 @@ -488,7 +489,7 @@ _defaultUnpack() { unpackFile() { curSrc="$1" header "unpacking source archive $curSrc" 3 - if ! runOneHook unpackCmd; then + if ! runOneHook unpackCmd "$curSrc"; then echo "do not know how to unpack source archive $curSrc" exit 1 fi From 2db867eec9f09648cae4c6e4ab8e4eae4cfc98f1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 14:15:44 +0200 Subject: [PATCH 0021/3123] fixupPhase: Fix making the outputs writable --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index daba3b5db41..ebacb9952fc 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -696,7 +696,7 @@ installPhase() { fixupPhase() { # Make sure everything is writable so "strip" et al. work. for output in $outputs; do - if [ -e "$output" ]; then chmod -R u+w "$output"; fi + if [ -e "${!output}" ]; then chmod -R u+w "${!output}"; fi done runHook preFixup From e3f7dbbac800124baa26317fcf792fe08f140655 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 14:20:05 +0200 Subject: [PATCH 0022/3123] Cleanup: Use += to append to envHooks --- pkgs/applications/science/math/R/setup-hook.sh | 2 +- pkgs/build-support/clang-wrapper/setup-hook.sh | 2 +- pkgs/build-support/gcc-cross-wrapper/setup-hook.sh | 2 +- pkgs/build-support/gcc-wrapper/setup-hook.sh | 2 +- pkgs/build-support/setup-hooks/set-java-classpath.sh | 2 +- pkgs/desktops/e17/e_dbus/setup-hook.sh | 2 +- pkgs/development/interpreters/guile/setup-hook-2.0.sh | 2 +- pkgs/development/interpreters/guile/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/5.10/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/5.14/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/5.16/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/5.20/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/5.8/setup-hook.sh | 2 +- pkgs/development/interpreters/perl/sys-perl/setup-hook.sh | 2 +- pkgs/development/interpreters/pypy/2.3/setup-hook.sh | 2 +- pkgs/development/interpreters/python/2.6/setup-hook.sh | 2 +- pkgs/development/interpreters/python/2.7/setup-hook.sh | 2 +- pkgs/development/interpreters/python/3.2/setup-hook.sh | 2 +- pkgs/development/interpreters/python/3.3/setup-hook.sh | 2 +- pkgs/development/interpreters/python/3.4/setup-hook.sh | 2 +- pkgs/development/libraries/gstreamer/core/setup-hook.sh | 2 +- .../libraries/gstreamer/legacy/gstreamer/setup-hook.sh | 2 +- pkgs/development/libraries/libxml2/setup-hook.sh | 2 +- pkgs/development/libraries/slib/setup-hook.sh | 2 +- pkgs/development/lisp-modules/clwrapper/setup-hook.sh | 2 +- pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh | 2 +- pkgs/development/tools/misc/automake/setup-hook.sh | 2 +- pkgs/development/tools/misc/pkgconfig/setup-hook.sh | 4 ++-- pkgs/development/tools/ocaml/findlib/default.nix | 4 ++-- pkgs/development/web/nodejs/setup-hook.sh | 2 +- pkgs/tools/text/sgml/opensp/setup-hook.sh | 2 +- pkgs/tools/typesetting/tex/tetex/setup-hook.sh | 2 +- pkgs/tools/typesetting/tex/texlive/setup-hook.sh | 2 +- 33 files changed, 35 insertions(+), 35 deletions(-) diff --git a/pkgs/applications/science/math/R/setup-hook.sh b/pkgs/applications/science/math/R/setup-hook.sh index a31289bbfba..09a775db9bf 100644 --- a/pkgs/applications/science/math/R/setup-hook.sh +++ b/pkgs/applications/science/math/R/setup-hook.sh @@ -2,4 +2,4 @@ addRLibPath () { addToSearchPath R_LIBS_SITE $1/library } -envHooks=(${envHooks[@]} addRLibPath) +envHooks+=(addRLibPath) diff --git a/pkgs/build-support/clang-wrapper/setup-hook.sh b/pkgs/build-support/clang-wrapper/setup-hook.sh index 538e6263e72..0bd531050c4 100644 --- a/pkgs/build-support/clang-wrapper/setup-hook.sh +++ b/pkgs/build-support/clang-wrapper/setup-hook.sh @@ -14,7 +14,7 @@ addCVars () { fi } -envHooks=(${envHooks[@]} addCVars) +envHooks+=(addCVars) # Note: these come *after* $out in the PATH (see setup.sh). diff --git a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh index 433d36ced43..ce5f6e56136 100644 --- a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh @@ -11,7 +11,7 @@ crossAddCVars () { fi } -crossEnvHooks=(${crossEnvHooks[@]} crossAddCVars) +crossEnvHooks+=(crossAddCVars) crossStripDirs() { local dirs="$1" diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh index ea762e9b405..a3ada9e984f 100644 --- a/pkgs/build-support/gcc-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh @@ -14,7 +14,7 @@ addCVars () { fi } -envHooks=(${envHooks[@]} addCVars) +envHooks+=(addCVars) # Note: these come *after* $out in the PATH (see setup.sh). diff --git a/pkgs/build-support/setup-hooks/set-java-classpath.sh b/pkgs/build-support/setup-hooks/set-java-classpath.sh index 76e8e42ca26..047da91bc97 100644 --- a/pkgs/build-support/setup-hooks/set-java-classpath.sh +++ b/pkgs/build-support/setup-hooks/set-java-classpath.sh @@ -10,4 +10,4 @@ addPkgToClassPath () { done } -envHooks=(''${envHooks[@]} addPkgToClassPath) +envHooks+=(addPkgToClassPath) diff --git a/pkgs/desktops/e17/e_dbus/setup-hook.sh b/pkgs/desktops/e17/e_dbus/setup-hook.sh index d98f24b4c04..33e3a6b0f18 100644 --- a/pkgs/desktops/e17/e_dbus/setup-hook.sh +++ b/pkgs/desktops/e17/e_dbus/setup-hook.sh @@ -5,4 +5,4 @@ addDbusIncludePath () { fi } -envHooks=(${envHooks[@]} addDbusIncludePath) +envHooks+=(addDbusIncludePath) diff --git a/pkgs/development/interpreters/guile/setup-hook-2.0.sh b/pkgs/development/interpreters/guile/setup-hook-2.0.sh index 6994c4cd8dc..fd1dc944ed4 100644 --- a/pkgs/development/interpreters/guile/setup-hook-2.0.sh +++ b/pkgs/development/interpreters/guile/setup-hook-2.0.sh @@ -10,4 +10,4 @@ addGuileLibPath () { fi } -envHooks=(${envHooks[@]} addGuileLibPath) +envHooks+=(addGuileLibPath) diff --git a/pkgs/development/interpreters/guile/setup-hook.sh b/pkgs/development/interpreters/guile/setup-hook.sh index 87cb5118506..c1d19e579ed 100644 --- a/pkgs/development/interpreters/guile/setup-hook.sh +++ b/pkgs/development/interpreters/guile/setup-hook.sh @@ -5,4 +5,4 @@ addGuileLibPath () { fi } -envHooks=(${envHooks[@]} addGuileLibPath) +envHooks+=(addGuileLibPath) diff --git a/pkgs/development/interpreters/perl/5.10/setup-hook.sh b/pkgs/development/interpreters/perl/5.10/setup-hook.sh index 6a144a7f780..a8656b8531d 100644 --- a/pkgs/development/interpreters/perl/5.10/setup-hook.sh +++ b/pkgs/development/interpreters/perl/5.10/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/perl5/site_perl } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/perl/5.14/setup-hook.sh b/pkgs/development/interpreters/perl/5.14/setup-hook.sh index 6a144a7f780..a8656b8531d 100644 --- a/pkgs/development/interpreters/perl/5.14/setup-hook.sh +++ b/pkgs/development/interpreters/perl/5.14/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/perl5/site_perl } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/perl/5.16/setup-hook.sh b/pkgs/development/interpreters/perl/5.16/setup-hook.sh index 6a144a7f780..a8656b8531d 100644 --- a/pkgs/development/interpreters/perl/5.16/setup-hook.sh +++ b/pkgs/development/interpreters/perl/5.16/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/perl5/site_perl } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/perl/5.20/setup-hook.sh b/pkgs/development/interpreters/perl/5.20/setup-hook.sh index 6a144a7f780..a8656b8531d 100644 --- a/pkgs/development/interpreters/perl/5.20/setup-hook.sh +++ b/pkgs/development/interpreters/perl/5.20/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/perl5/site_perl } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/perl/5.8/setup-hook.sh b/pkgs/development/interpreters/perl/5.8/setup-hook.sh index d61ec82f4f0..75a394c3c0a 100644 --- a/pkgs/development/interpreters/perl/5.8/setup-hook.sh +++ b/pkgs/development/interpreters/perl/5.8/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/site_perl } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/perl/sys-perl/setup-hook.sh b/pkgs/development/interpreters/perl/sys-perl/setup-hook.sh index a46a19602e7..7b03c15ec5a 100644 --- a/pkgs/development/interpreters/perl/sys-perl/setup-hook.sh +++ b/pkgs/development/interpreters/perl/sys-perl/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/@libPrefix@ } -envHooks=(${envHooks[@]} addPerlLibPath) +envHooks+=(addPerlLibPath) diff --git a/pkgs/development/interpreters/pypy/2.3/setup-hook.sh b/pkgs/development/interpreters/pypy/2.3/setup-hook.sh index 67c71bf0081..7d325828d0e 100644 --- a/pkgs/development/interpreters/pypy/2.3/setup-hook.sh +++ b/pkgs/development/interpreters/pypy/2.3/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/interpreters/python/2.6/setup-hook.sh b/pkgs/development/interpreters/python/2.6/setup-hook.sh index 290525c3571..4caff9c9d84 100644 --- a/pkgs/development/interpreters/python/2.6/setup-hook.sh +++ b/pkgs/development/interpreters/python/2.6/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/interpreters/python/2.7/setup-hook.sh b/pkgs/development/interpreters/python/2.7/setup-hook.sh index a393b70afe1..4770eea886f 100644 --- a/pkgs/development/interpreters/python/2.7/setup-hook.sh +++ b/pkgs/development/interpreters/python/2.7/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/interpreters/python/3.2/setup-hook.sh b/pkgs/development/interpreters/python/3.2/setup-hook.sh index e6fa34bf54b..e8215ef9877 100644 --- a/pkgs/development/interpreters/python/3.2/setup-hook.sh +++ b/pkgs/development/interpreters/python/3.2/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/interpreters/python/3.3/setup-hook.sh b/pkgs/development/interpreters/python/3.3/setup-hook.sh index c272c87daf1..82a8c0abd32 100644 --- a/pkgs/development/interpreters/python/3.3/setup-hook.sh +++ b/pkgs/development/interpreters/python/3.3/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/interpreters/python/3.4/setup-hook.sh b/pkgs/development/interpreters/python/3.4/setup-hook.sh index ae71b4147ab..fddcc0b73fe 100644 --- a/pkgs/development/interpreters/python/3.4/setup-hook.sh +++ b/pkgs/development/interpreters/python/3.4/setup-hook.sh @@ -12,4 +12,4 @@ toPythonPath() { echo $result } -envHooks=(${envHooks[@]} addPythonPath) +envHooks+=(addPythonPath) diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh index 04863ab3b61..3dd7812ece6 100644 --- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh @@ -5,5 +5,5 @@ addGstreamer1LibPath () { fi } -envHooks=(${envHooks[@]} addGstreamer1LibPath) +envHooks+=(addGstreamer1LibPath) diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh index 10671f9d227..e89aeda5bc1 100644 --- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh @@ -5,4 +5,4 @@ addGstreamerLibPath () { fi } -envHooks=(${envHooks[@]} addGstreamerLibPath) +envHooks+=(addGstreamerLibPath) diff --git a/pkgs/development/libraries/libxml2/setup-hook.sh b/pkgs/development/libraries/libxml2/setup-hook.sh index 112dbe0c513..f9fc633c7da 100644 --- a/pkgs/development/libraries/libxml2/setup-hook.sh +++ b/pkgs/development/libraries/libxml2/setup-hook.sh @@ -23,5 +23,5 @@ if test -z "$libxmlHookDone"; then # xmllint and xsltproc from looking in /etc/xml/catalog. export XML_CATALOG_FILES if test -z "$XML_CATALOG_FILES"; then XML_CATALOG_FILES=" "; fi - envHooks=(${envHooks[@]} addXMLCatalogs) + envHooks+=(addXMLCatalogs) fi diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh index 32dde7d1f7a..62b72d6dc0a 100644 --- a/pkgs/development/libraries/slib/setup-hook.sh +++ b/pkgs/development/libraries/slib/setup-hook.sh @@ -10,4 +10,4 @@ addSlibPath () { fi } -envHooks=(${envHooks[@]} addSlibPath) +envHooks+=(addSlibPath) diff --git a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh index e5deb47fd5d..b48f916ac7a 100644 --- a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh +++ b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh @@ -33,7 +33,7 @@ collectNixLispLDLP () { export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF -envHooks=(envHooks[@] addASDFPaths setLisp collectNixLispLDLP) +envHooks+=(addASDFPaths setLisp collectNixLispLDLP) mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-$USER-home" mkdir -p "$HOME"/.cache/common-lisp diff --git a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh index 876556a7b92..a93a7250beb 100644 --- a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh +++ b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh @@ -2,4 +2,4 @@ addOcamlMakefile () { export OCAMLMAKEFILE="@out@/include/OCamlMakefile" } -envHooks=(${envHooks[@]} addOcamlMakefile) +envHooks+=(addOcamlMakefile) diff --git a/pkgs/development/tools/misc/automake/setup-hook.sh b/pkgs/development/tools/misc/automake/setup-hook.sh index 6f34f0d0ae1..5cd8c6229f6 100644 --- a/pkgs/development/tools/misc/automake/setup-hook.sh +++ b/pkgs/development/tools/misc/automake/setup-hook.sh @@ -2,4 +2,4 @@ addAclocals () { addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal } -envHooks=(${envHooks[@]} addAclocals) +envHooks+=(addAclocals) diff --git a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh index 77a69fb1878..1c153976a34 100644 --- a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh +++ b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh @@ -4,7 +4,7 @@ addPkgConfigPath () { } if test -n "$crossConfig"; then - crossEnvHooks=(${crossEnvHooks[@]} addPkgConfigPath) + crossEnvHooks+=(addPkgConfigPath) else - envHooks=(${envHooks[@]} addPkgConfigPath) + envHooks+=(addPkgConfigPath) fi diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 4c0176de7e8..cfbabad72cc 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -42,8 +42,8 @@ stdenv.mkDerivation { mkdir -p $OCAMLFIND_DESTDIR fi } - - envHooks=(''${envHooks[@]} addOCamlPath) + + envHooks+=(addOCamlPath) ''; meta = { diff --git a/pkgs/development/web/nodejs/setup-hook.sh b/pkgs/development/web/nodejs/setup-hook.sh index 41a9746ba42..e1f4d9089f3 100644 --- a/pkgs/development/web/nodejs/setup-hook.sh +++ b/pkgs/development/web/nodejs/setup-hook.sh @@ -2,4 +2,4 @@ addNodePath () { addToSearchPath NODE_PATH $1/lib/node_modules } -envHooks=(${envHooks[@]} addNodePath) +envHooks+=(addNodePath) diff --git a/pkgs/tools/text/sgml/opensp/setup-hook.sh b/pkgs/tools/text/sgml/opensp/setup-hook.sh index 2c9142da101..52da517a8cb 100644 --- a/pkgs/tools/text/sgml/opensp/setup-hook.sh +++ b/pkgs/tools/text/sgml/opensp/setup-hook.sh @@ -18,5 +18,5 @@ if test -z "$sgmlHookDone"; then export ftp_proxy=http://nodtd.invalid/ export SGML_CATALOG_FILES - envHooks=(${envHooks[@]} addSGMLCatalogs) + envHooks+=(addSGMLCatalogs) fi diff --git a/pkgs/tools/typesetting/tex/tetex/setup-hook.sh b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh index d79c4fae419..9c5424e881e 100644 --- a/pkgs/tools/typesetting/tex/tetex/setup-hook.sh +++ b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh @@ -4,4 +4,4 @@ addTeXMFPath () { fi } -envHooks=(${envHooks[@]} addTeXMFPath) +envHooks+=(addTeXMFPath) diff --git a/pkgs/tools/typesetting/tex/texlive/setup-hook.sh b/pkgs/tools/typesetting/tex/texlive/setup-hook.sh index d79c4fae419..9c5424e881e 100644 --- a/pkgs/tools/typesetting/tex/texlive/setup-hook.sh +++ b/pkgs/tools/typesetting/tex/texlive/setup-hook.sh @@ -4,4 +4,4 @@ addTeXMFPath () { fi } -envHooks=(${envHooks[@]} addTeXMFPath) +envHooks+=(addTeXMFPath) From 9e31c66d1b4e71c5e09719931d77c794a9608acb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 14:26:35 +0200 Subject: [PATCH 0023/3123] stdenv: Put moving docs to $out/share in a separate setup hook --- pkgs/build-support/setup-hooks/move-docs.sh | 24 +++++++++++++++++++++ pkgs/stdenv/generic/default.nix | 3 ++- pkgs/stdenv/generic/setup.sh | 19 ---------------- 3 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 pkgs/build-support/setup-hooks/move-docs.sh diff --git a/pkgs/build-support/setup-hooks/move-docs.sh b/pkgs/build-support/setup-hooks/move-docs.sh new file mode 100644 index 00000000000..b3b93193550 --- /dev/null +++ b/pkgs/build-support/setup-hooks/move-docs.sh @@ -0,0 +1,24 @@ +# This setup hook automatically moves $out/{man,doc,info} to +# $out/share. + +preFixupHooks+=(_moveDocs) + +_moveDocs() { + forceShare=${forceShare:=man doc info} + if [ -z "$forceShare" ]; then return; fi + + for d in $forceShare; do + if [ -d "$prefix/$d" ]; then + if [ -d "$prefix/share/$d" ]; then + echo "both $d/ and share/$d/ exist!" + else + echo "moving $prefix/$d to $prefix/share/$d" + mkdir -p $prefix/share + if [ -w $prefix/share ]; then + mv $prefix/$d $prefix/share + ln -s share/$d $prefix + fi + fi + fi + done +} diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 0ff0bcebbd4..5b3cfdc2c44 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -30,7 +30,8 @@ let unsafeGetAttrPos = builtins.unsafeGetAttrPos or (n: as: null); extraBuildInputs' = extraBuildInputs ++ - [ ../../build-support/setup-hooks/compress-man-pages.sh + [ ../../build-support/setup-hooks/move-docs.sh + ../../build-support/setup-hooks/compress-man-pages.sh ../../build-support/setup-hooks/strip.sh ../../build-support/setup-hooks/patch-shebangs.sh gcc diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index ebacb9952fc..ea2ea947b50 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -701,25 +701,6 @@ fixupPhase() { runHook preFixup - # Put man/doc/info under $out/share. - forceShare=${forceShare:=man doc info} - if [ -n "$forceShare" ]; then - for d in $forceShare; do - if [ -d "$prefix/$d" ]; then - if [ -d "$prefix/share/$d" ]; then - echo "both $d/ and share/$d/ exists!" - else - echo "fixing location of $d/ subdirectory" - mkdir -p $prefix/share - if [ -w $prefix/share ]; then - mv -v $prefix/$d $prefix/share - ln -sv share/$d $prefix - fi - fi - fi - done; - fi - # Apply fixup to each output. local output for output in $outputs; do From a8fc68a5c02488a2228a1dc4984a3fa6351002eb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2014 15:33:15 +0200 Subject: [PATCH 0024/3123] Move share/{man,info,doc} to the corresponding output --- pkgs/build-support/setup-hooks/move-docs.sh | 50 ++++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/pkgs/build-support/setup-hooks/move-docs.sh b/pkgs/build-support/setup-hooks/move-docs.sh index b3b93193550..c819ee12a9c 100644 --- a/pkgs/build-support/setup-hooks/move-docs.sh +++ b/pkgs/build-support/setup-hooks/move-docs.sh @@ -1,24 +1,50 @@ -# This setup hook automatically moves $out/{man,doc,info} to -# $out/share. +# This setup hook moves $out/{man,doc,info} to $out/share; moves +# $out/share/man to $man/share/man; and moves $out/share/doc to +# $man/share/doc. preFixupHooks+=(_moveDocs) -_moveDocs() { +_moveToShare() { forceShare=${forceShare:=man doc info} - if [ -z "$forceShare" ]; then return; fi + if [ -z "$forceShare" -o -z "$out" ]; then return; fi for d in $forceShare; do - if [ -d "$prefix/$d" ]; then - if [ -d "$prefix/share/$d" ]; then + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then echo "both $d/ and share/$d/ exist!" else - echo "moving $prefix/$d to $prefix/share/$d" - mkdir -p $prefix/share - if [ -w $prefix/share ]; then - mv $prefix/$d $prefix/share - ln -s share/$d $prefix - fi + echo "moving $out/$d to $out/share/$d" + mkdir -p $out/share + mv $out/$d $out/share/ fi fi done } + +_moveToOutput() { + local d="$1" + local dst="$2" + if [ -z "$dst" -a ! -e $dst/$d ]; then return; fi + local output + for output in $outputs; do + if [ "${!output}" = "$dst" ]; then continue; fi + if [ -d "${!output}/$d" ]; then + echo "moving ${!output}/$d to $dst/$d" + mkdir -p $dst/share + mv ${!output}/$d $dst/$d + break + fi + done +} + +_moveDocs() { + _moveToShare + _moveToOutput share/man "$man" + _moveToOutput share/info "$info" + _moveToOutput share/doc "$doc" + + # Remove empty share directory. + if [ -d "$out/share" ]; then + rmdir $out/share 2> /dev/null || true + fi +} From c23bf4ec746b03e66730f9ca3ddb5957923ca9c1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 23 Aug 2014 23:28:03 +0200 Subject: [PATCH 0025/3123] systemd: Update to 216 --- nixos/modules/system/boot/systemd.nix | 1 + pkgs/os-specific/linux/systemd/default.nix | 34 +++- pkgs/os-specific/linux/systemd/fixes.patch | 196 ++++----------------- 3 files changed, 66 insertions(+), 165 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index e353e9246b0..366faf1b73d 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -81,6 +81,7 @@ let "systemd-journal-flush.service" "systemd-journal-gatewayd.socket" "systemd-journal-gatewayd.service" + "systemd-journald-dev-log.socket" "syslog.socket" # SysV init compatibility. diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 3445c3cd2dd..7084ebc5e62 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -3,7 +3,6 @@ , glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl , kexectools, libmicrohttpd, linuxHeaders , pythonPackages ? null, pythonSupport ? false -, autoreconfHook }: assert stdenv.isLinux; @@ -11,17 +10,17 @@ assert stdenv.isLinux; assert pythonSupport -> pythonPackages != null; stdenv.mkDerivation rec { - version = "212"; + version = "216"; name = "systemd-${version}"; src = fetchurl { url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz"; - sha256 = "1hpjcc42svrs06q3isjm3m5aphgkpfdylmvpnif71zh46ys0cab5"; + sha256 = "1wr8jxhp2rmbzabm743rmrhp2c8kir1990x6iblzzmj0v2vkspcl"; }; patches = [ # These are all changes between upstream and - # https://github.com/edolstra/systemd/tree/nixos-v212. + # https://github.com/edolstra/systemd/tree/nixos-v216. ./fixes.patch ]; @@ -29,7 +28,6 @@ stdenv.mkDerivation rec { [ pkgconfig intltool gperf libcap kmod xz pam acl /* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl libmicrohttpd linuxHeaders - autoreconfHook ] ++ stdenv.lib.optionals pythonSupport [pythonPackages.python pythonPackages.lxml]; configureFlags = @@ -45,9 +43,24 @@ stdenv.mkDerivation rec { "--with-dbussessionservicedir=$(out)/share/dbus-1/services" "--with-firmware-path=/root/test-firmware:/run/current-system/firmware" "--with-tty-gid=3" # tty in NixOS has gid 3 - "--disable-networkd" # enable/use eventually "--enable-compat-libs" # get rid of this eventually "--disable-tests" + "--disable-manpages" # FIXME + + "--disable-hostnamed" + "--disable-networkd" # enable/use eventually + "--disable-sysusers" + "--disable-timedated" + "--disable-timesyncd" + "--disable-readahead" + "--disable-firstboot" + "--disable-localed" + "--disable-resolved" + "--disable-split-usr" + + "--with-sysvinit-path=" + "--with-sysvrcnd-path=" + "--with-rc-local-script-path-stop=/etc/halt.local" ]; preConfigure = @@ -88,6 +101,8 @@ stdenv.mkDerivation rec { # currently running systemd (/run/current-system/systemd) so # that we don't use an obsolete/garbage-collected release agent. "-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\"" + + "-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\"" ]; # Use /var/lib/udev rather than /etc/udev for the generated hardware @@ -104,9 +119,14 @@ stdenv.mkDerivation rec { "pamconfdir=$(out)/etc/pam.d" ]; - # Get rid of configuration-specific data. postInstall = '' + # sysinit.target: Don't depend on + # systemd-tmpfiles-setup.service. This interferes with NixOps's + # send-keys feature (since sshd.service depends indirectly on + # sysinit.target). + mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/ + mkdir -p $out/example/systemd mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example mv $out/lib/systemd/{system,user} $out/example/systemd diff --git a/pkgs/os-specific/linux/systemd/fixes.patch b/pkgs/os-specific/linux/systemd/fixes.patch index 7410c87e277..416be6248c7 100644 --- a/pkgs/os-specific/linux/systemd/fixes.patch +++ b/pkgs/os-specific/linux/systemd/fixes.patch @@ -1,20 +1,5 @@ -diff --git a/Makefile.am b/Makefile.am -index 3d9e5c1..4d43cb4 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1707,7 +1707,9 @@ dist_tmpfiles_DATA += \ - endif - - SYSINIT_TARGET_WANTS += \ -- systemd-tmpfiles-setup-dev.service \ -+ systemd-tmpfiles-setup-dev.service -+ -+MULTI_USER_TARGET_WANTS += \ - systemd-tmpfiles-setup.service - - dist_zshcompletion_DATA += \ diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in -index db72373..2fc12ca 100644 +index aa435c4..46a2cd4 100644 --- a/rules/99-systemd.rules.in +++ b/rules/99-systemd.rules.in @@ -14,10 +14,6 @@ KERNEL=="vport*", TAG+="systemd" @@ -28,79 +13,11 @@ index db72373..2fc12ca 100644 # Ignore raid devices that are not yet assembled and started SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" -diff --git a/src/core/main.c b/src/core/main.c -index 41605ee..8517369 100644 ---- a/src/core/main.c -+++ b/src/core/main.c -@@ -1883,7 +1883,7 @@ finish: - char_array_0(sfd); - - i = 0; -- args[i++] = SYSTEMD_BINARY_PATH; -+ args[i++] = "/run/current-system/systemd/lib/systemd/systemd"; - if (switch_root_dir) - args[i++] = "--switched-root"; - args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user"; -diff --git a/src/core/service.c b/src/core/service.c -index ae3695a..6b3aa45 100644 ---- a/src/core/service.c -+++ b/src/core/service.c -@@ -1096,11 +1096,6 @@ static int service_verify(Service *s) { - return -EINVAL; - } - -- if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) { -- log_error_unit(UNIT(s)->id, "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id); -- return -EINVAL; -- } -- - if (s->type == SERVICE_DBUS && !s->bus_name) { - log_error_unit(UNIT(s)->id, "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id); - return -EINVAL; -diff --git a/src/core/socket.c b/src/core/socket.c -index 7c18a2b..eba67d5 100644 ---- a/src/core/socket.c -+++ b/src/core/socket.c -@@ -663,16 +663,25 @@ static int instance_from_socket(int fd, unsigned nr, char **instance) { - int k; - - k = getpeercred(fd, &ucred); -- if (k < 0) -+ if (k == -ENODATA) { -+ /* This handles the case where somebody is -+ * connecting from another pid/uid namespace -+ * (e.g. from outside of our container). */ -+ if (asprintf(&r, -+ "%u-unknown", -+ nr) < 0) -+ return -ENOMEM; -+ } -+ else if (k < 0) - return k; -- -- if (asprintf(&r, -- "%u-%lu-%lu", -- nr, -- (unsigned long) ucred.pid, -- (unsigned long) ucred.uid) < 0) -- return -ENOMEM; -- -+ else { -+ if (asprintf(&r, -+ "%u-%lu-%lu", -+ nr, -+ (unsigned long) ucred.pid, -+ (unsigned long) ucred.uid) < 0) -+ return -ENOMEM; -+ } - break; - } - diff --git a/src/core/umount.c b/src/core/umount.c -index d1258f0..0311812 100644 +index cffa453..4d1a9ff 100644 --- a/src/core/umount.c +++ b/src/core/umount.c -@@ -404,6 +404,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e +@@ -385,6 +385,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e * anyway, since we are running from it. They have * already been remounted ro. */ if (path_equal(m->path, "/") @@ -110,32 +27,24 @@ index d1258f0..0311812 100644 || path_equal(m->path, "/usr") #endif diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c -index 18f2aca..2a2b1ea 100644 +index dfe97bc..71cd8f4 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c -@@ -285,7 +285,7 @@ int main(int argc, char *argv[]) { - - type = udev_device_get_property_value(udev_device, "ID_FS_TYPE"); - if (type) { -- const char *checker = strappenda("/sbin/fsck.", type); -+ const char *checker = strappenda("/run/current-system/sw/sbin/fsck.", type); - r = access(checker, X_OK); - if (r < 0) { - if (errno == ENOENT) { -@@ -302,7 +302,7 @@ int main(int argc, char *argv[]) { +@@ -315,8 +315,7 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - cmdline[i++] = "/sbin/fsck"; +- cmdline[i++] = arg_repair; + cmdline[i++] = "/run/current-system/sw/sbin/fsck"; - cmdline[i++] = "-a"; cmdline[i++] = "-T"; - cmdline[i++] = "-l"; + + /* diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c -index 9a9ed9d..9e46e18 100644 +index d01da45..4976f9a 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c -@@ -2667,6 +2667,7 @@ int main(int argc, char *argv[]) { +@@ -2985,6 +2985,7 @@ int main(int argc, char *argv[]) { goto finish; } } else { @@ -143,7 +52,7 @@ index 9a9ed9d..9e46e18 100644 const char *p; p = strappenda(arg_directory, -@@ -2676,6 +2677,7 @@ int main(int argc, char *argv[]) { +@@ -2994,6 +2995,7 @@ int main(int argc, char *argv[]) { goto finish; } @@ -151,39 +60,11 @@ index 9a9ed9d..9e46e18 100644 } } else { char template[] = "/tmp/nspawn-root-XXXXXX"; -diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c -index d61ecdf..228a3a4 100644 ---- a/src/nss-myhostname/netlink.c -+++ b/src/nss-myhostname/netlink.c -@@ -112,6 +112,10 @@ static int read_reply(int fd, struct address **list, unsigned *n_list) { - ifaddrmsg->ifa_scope == RT_SCOPE_NOWHERE) - continue; - -+ if (ifaddrmsg->ifa_family == AF_INET6 && -+ ifaddrmsg->ifa_scope == RT_SCOPE_LINK) -+ continue; -+ - if (ifaddrmsg->ifa_flags & IFA_F_DEPRECATED) - continue; - -diff --git a/src/shared/generator.c b/src/shared/generator.c -index 6110303..e679cb1 100644 ---- a/src/shared/generator.c -+++ b/src/shared/generator.c -@@ -48,7 +48,7 @@ int generator_write_fsck_deps( - const char *checker; - int r; - -- checker = strappenda("/sbin/fsck.", fstype); -+ checker = strappenda("/run/current-system/sw/sbin/fsck.", fstype); - r = access(checker, X_OK); - if (r < 0) { - log_warning("Checking was requested for %s, but %s cannot be used: %m", what, checker); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c -index 0887bc3..6b502ce 100644 +index 36db652..b1ba6e9 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c -@@ -2561,7 +2561,7 @@ static int start_unit_one( +@@ -2607,7 +2607,7 @@ static int start_unit_one( log_debug("Adding %s to the set", p); r = set_consume(s, p); @@ -217,7 +98,7 @@ index 4f7794b..bad2a9a 100644 Restart=always RestartSec=0 diff --git a/units/emergency.service.in b/units/emergency.service.in -index 94c090f..0d20640 100644 +index 91fc1bb..6a37434 100644 --- a/units/emergency.service.in +++ b/units/emergency.service.in @@ -15,7 +15,6 @@ Before=shutdown.target @@ -226,10 +107,10 @@ index 94c090f..0d20640 100644 WorkingDirectory=/root -ExecStartPre=-/bin/plymouth quit ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.' - ExecStart=-/sbin/sulogin - ExecStopPost=@SYSTEMCTL@ --fail --no-block default + ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" + Type=idle diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 -index aa853b8..8bcc647 100644 +index 46164ab..f194a31 100644 --- a/units/getty@.service.m4 +++ b/units/getty@.service.m4 @@ -23,11 +23,12 @@ IgnoreOnIsolate=yes @@ -248,23 +129,23 @@ index aa853b8..8bcc647 100644 Restart=always RestartSec=0 diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in -index 368f980..d0c1bd2 100644 +index 0934a87..7e30c9e 100644 --- a/units/kmod-static-nodes.service.in +++ b/units/kmod-static-nodes.service.in @@ -10,7 +10,6 @@ Description=Create list of required static device nodes for the current kernel DefaultDependencies=no Before=sysinit.target systemd-tmpfiles-setup-dev.service - ConditionCapability=CAP_MKNOD + ConditionCapability=CAP_SYS_MODULE -ConditionPathExists=/lib/modules/%v/modules.devname [Service] Type=oneshot diff --git a/units/local-fs.target b/units/local-fs.target -index ae3cedc..0e36840 100644 +index d2e5429..d26984b 100644 --- a/units/local-fs.target +++ b/units/local-fs.target -@@ -13,3 +13,5 @@ DefaultDependencies=no - Conflicts=shutdown.target +@@ -13,3 +13,5 @@ Conflicts=shutdown.target + After=local-fs-pre.target OnFailure=emergency.target OnFailureJobMode=replace-irreversibly + @@ -282,7 +163,7 @@ index 43ffa5c..156a681 100644 [Install] WantedBy=multi-user.target diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in -index 552ef89..af3915f 100644 +index ef54369..0c841b3 100644 --- a/units/rescue.service.m4.in +++ b/units/rescue.service.m4.in @@ -16,7 +16,6 @@ Before=shutdown.target @@ -291,10 +172,10 @@ index 552ef89..af3915f 100644 WorkingDirectory=/root -ExecStartPre=-/bin/plymouth quit ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.' - ExecStart=-/sbin/sulogin - ExecStopPost=-@SYSTEMCTL@ --fail --no-block default + ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" + Type=idle diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 -index 4ac51e7..86a3b59 100644 +index 4522d0d..96daa5c 100644 --- a/units/serial-getty@.service.m4 +++ b/units/serial-getty@.service.m4 @@ -22,7 +22,6 @@ Before=getty.target @@ -304,19 +185,18 @@ index 4ac51e7..86a3b59 100644 -ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM Type=idle Restart=always - RestartSec=0 + UtmpIdentifier=%I diff --git a/units/sysinit.target b/units/sysinit.target -index 8f4fb8f..e0f0147 100644 +index ec33503..4ac47b9 100644 --- a/units/sysinit.target +++ b/units/sysinit.target -@@ -9,6 +9,5 @@ +@@ -9,5 +9,4 @@ Description=System Initialization Documentation=man:systemd.special(7) Conflicts=emergency.service emergency.target -Wants=local-fs.target swap.target -After=local-fs.target swap.target emergency.service emergency.target +After=emergency.service emergency.target - RefuseManualStart=yes diff --git a/units/systemd-backlight@.service.in b/units/systemd-backlight@.service.in index e945d87..77728f2 100644 --- a/units/systemd-backlight@.service.in @@ -342,10 +222,10 @@ index 503e8a6..fe23b8b 100644 [Service] ExecStart=@rootbindir@/systemctl kill --kill-who=main --signal=SIGUSR1 systemd-journald.service diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in -index de93879..c9a49f3 100644 +index 7013979..5241d08 100644 --- a/units/systemd-journald.service.in +++ b/units/systemd-journald.service.in -@@ -25,3 +25,8 @@ WatchdogSec=1min +@@ -26,3 +26,8 @@ WatchdogSec=1min # Increase the default a bit in order to allow many simultaneous # services being run since we keep one fd open per service. LimitNOFILE=16384 @@ -373,18 +253,18 @@ index 9d264a2..c505535 100644 ExecStop=@rootlibexecdir@/systemd-rfkill save %I +X-RestartIfChanged=false diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in -index 01043b7..507f820 100644 +index 72ab083..4f77e8f 100644 --- a/units/systemd-tmpfiles-setup.service.in +++ b/units/systemd-tmpfiles-setup.service.in -@@ -12,7 +12,7 @@ DefaultDependencies=no - Wants=local-fs.target +@@ -11,7 +11,7 @@ Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) + DefaultDependencies=no Conflicts=shutdown.target - After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target + After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target systemd-sysusers.service -Before=sysinit.target shutdown.target +Before=shutdown.target - ConditionDirectoryNotEmpty=|/usr/lib/tmpfiles.d - ConditionDirectoryNotEmpty=|/lib/tmpfiles.d - ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d + RefuseManualStop=yes + + [Service] diff --git a/units/systemd-update-utmp.service.in b/units/systemd-update-utmp.service.in index da7dda7..e638145 100644 --- a/units/systemd-update-utmp.service.in From 84fa62b4f3fe4a912174897468b31b0380a85c3a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 09:59:26 +0200 Subject: [PATCH 0026/3123] systemd: Build manpages --- pkgs/os-specific/linux/systemd/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 7084ebc5e62..d2144188cc6 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -45,7 +45,6 @@ stdenv.mkDerivation rec { "--with-tty-gid=3" # tty in NixOS has gid 3 "--enable-compat-libs" # get rid of this eventually "--disable-tests" - "--disable-manpages" # FIXME "--disable-hostnamed" "--disable-networkd" # enable/use eventually From 891657b634092a110e15947623e750f1e7200ce4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 10:04:55 +0200 Subject: [PATCH 0027/3123] systemd: Drop unnecessary dependency --- pkgs/os-specific/linux/systemd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index d2144188cc6..87faae0467f 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod , xz, pam, acl, cryptsetup, libuuid, m4, utillinux -, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl +, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools , kexectools, libmicrohttpd, linuxHeaders , pythonPackages ? null, pythonSupport ? false }: @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig intltool gperf libcap kmod xz pam acl - /* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl + /* cryptsetup */ libuuid m4 glib libxslt libgcrypt libmicrohttpd linuxHeaders ] ++ stdenv.lib.optionals pythonSupport [pythonPackages.python pythonPackages.lxml]; From 0263a8f86064a9d02e8b4eb8fa8839dfec2b087f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 12:27:32 +0200 Subject: [PATCH 0028/3123] NixOS containers: Use exit status 133 for reboots --- nixos/modules/virtualisation/containers.nix | 5 ++++- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 292b96e6eb2..ca3de4089d2 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -267,9 +267,12 @@ in NotifyAccess = "all"; - # Note that on reboot, systemd-nspawn returns 10, so this + # Note that on reboot, systemd-nspawn returns 133, so this # unit will be restarted. On poweroff, it returns 0, so the # unit won't be restarted. + RestartForceExitStatus = "133"; + SuccessExitStatus = "133"; + Restart = "on-failure"; # Hack: we don't want to kill systemd-nspawn, since we call diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a4f275e3c6e..e2f11d0b135 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7785,6 +7785,10 @@ let linuxHeaders = linuxHeaders_3_14; }; + systemd_test = callPackage ../os-specific/linux/systemd/test.nix { + linuxHeaders = linuxHeaders_3_14; + }; + systemtap = callPackage ../development/tools/profiling/systemtap { inherit (gnome) libglademm; }; From 9237e86d9979e6e6d510bade6ab87f5707c54ffc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 15:55:12 +0200 Subject: [PATCH 0029/3123] Doh --- pkgs/top-level/all-packages.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2f11d0b135..a4f275e3c6e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7785,10 +7785,6 @@ let linuxHeaders = linuxHeaders_3_14; }; - systemd_test = callPackage ../os-specific/linux/systemd/test.nix { - linuxHeaders = linuxHeaders_3_14; - }; - systemtap = callPackage ../development/tools/profiling/systemtap { inherit (gnome) libglademm; }; From d73025a5fe56e765bcb82c0f3740958debeaf3ce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 17:08:55 +0200 Subject: [PATCH 0030/3123] Enable systemd's mymachines NSS module It makes every local container registered with machined resolvable. --- nixos/modules/config/nsswitch.nix | 42 ++++++++++++-------------- nixos/modules/services/system/nscd.nix | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix index 45695d9cb89..549e731f3b0 100644 --- a/nixos/modules/config/nsswitch.nix +++ b/nixos/modules/config/nsswitch.nix @@ -35,29 +35,27 @@ in config = { - environment.etc = - [ # Name Service Switch configuration file. Required by the C library. - # !!! Factor out the mdns stuff. The avahi module should define - # an option used by this module. - { source = pkgs.writeText "nsswitch.conf" - '' - passwd: files ldap - group: files ldap - shadow: files ldap - hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} ${optionalString nsswins "wins"} myhostname - networks: files dns - ethers: files - services: files - protocols: files - ''; - target = "nsswitch.conf"; - } - ]; + # Name Service Switch configuration file. Required by the C + # library. !!! Factor out the mdns stuff. The avahi module + # should define an option used by this module. + environment.etc."nsswitch.conf".text = + '' + passwd: files ldap + group: files ldap + shadow: files ldap + hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} ${optionalString nsswins "wins"} myhostname mymachines + networks: files dns + ethers: files + services: files + protocols: files + ''; - # Use nss-myhostname to ensure that our hostname always resolves to - # a valid IP address. It returns all locally configured IP - # addresses, or ::1 and 127.0.0.2 as fallbacks. - system.nssModules = [ pkgs.systemd ]; + # Systemd provides nss-myhostname to ensure that our hostname + # always resolves to a valid IP address. It returns all locally + # configured IP addresses, or ::1 and 127.0.0.2 as + # fallbacks. Systemd also provides nss-mymachines to return IP + # addresses of local containers. + system.nssModules = [ config.systemd.package ]; }; } diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix index 5460e962ea2..0879d9b85bd 100644 --- a/nixos/modules/services/system/nscd.nix +++ b/nixos/modules/services/system/nscd.nix @@ -62,7 +62,7 @@ in mkdir -m 0755 -p /var/db/nscd ''; - restartTriggers = [ config.environment.etc.hosts.source ]; + restartTriggers = [ config.environment.etc.hosts.source config.environment.etc."nsswitch.conf".source ]; serviceConfig = { ExecStart = "@${pkgs.glibc}/sbin/nscd nscd -f ${cfgFile}"; From 84b87af15a00be0c9094038ac63fdc631211593a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Aug 2014 09:48:01 +0200 Subject: [PATCH 0031/3123] polkit: Add docbook DTD --- pkgs/development/libraries/polkit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index 6da928a6a23..7fe16cec56b 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, spidermonkey -, gobjectIntrospection, libxslt, docbook_xsl +, gobjectIntrospection, libxslt, docbook_xsl, docbook_xml_dtd_412 , useSystemd ? stdenv.isLinux, systemd }: let @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig glib expat pam intltool spidermonkey gobjectIntrospection ] - ++ [ libxslt docbook_xsl ] # man pages + ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ] # man pages ++ stdenv.lib.optional useSystemd systemd; # Ugly hack to overwrite hardcoded directories From e4e39f26baf47de7aec1577a6c7c2fcc6f4e2b7d Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Mon, 8 Sep 2014 16:02:22 +0200 Subject: [PATCH 0032/3123] Change default from gnome 3.10 to gnome 3.12 --- nixos/modules/services/x11/desktop-managers/gnome3.nix | 2 +- nixos/tests/{gnome3_12.nix => gnome3_10.nix} | 4 ++-- pkgs/applications/audio/gtkpod/default.nix | 7 ++----- pkgs/desktops/gnome-3/3.10/default.nix | 1 + pkgs/top-level/all-packages.nix | 5 ++++- 5 files changed, 10 insertions(+), 9 deletions(-) rename nixos/tests/{gnome3_12.nix => gnome3_10.nix} (90%) diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 049c96c54e7..633b6f4960a 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -45,7 +45,7 @@ in { environment.gnome3.packageSet = mkOption { default = pkgs.gnome3; - example = literalExample "pkgs.gnome3_12"; + example = literalExample "pkgs.gnome3_10"; description = "Which Gnome 3 package set to use."; }; diff --git a/nixos/tests/gnome3_12.nix b/nixos/tests/gnome3_10.nix similarity index 90% rename from nixos/tests/gnome3_12.nix rename to nixos/tests/gnome3_10.nix index 723d1bc4522..d081c8b5fc0 100644 --- a/nixos/tests/gnome3_12.nix +++ b/nixos/tests/gnome3_10.nix @@ -1,5 +1,5 @@ import ./make-test.nix { - name = "gnome3_12"; + name = "gnome3"; machine = { config, pkgs, ... }: @@ -11,7 +11,7 @@ import ./make-test.nix { services.xserver.displayManager.auto.enable = true; services.xserver.displayManager.auto.user = "alice"; services.xserver.desktopManager.gnome3.enable = true; - environment.gnome3.packageSet = pkgs.gnome3_12; + environment.gnome3.packageSet = pkgs.gnome3_10; }; testScript = diff --git a/pkgs/applications/audio/gtkpod/default.nix b/pkgs/applications/audio/gtkpod/default.nix index 80a7cf52cd8..9c08b2ab6d7 100644 --- a/pkgs/applications/audio/gtkpod/default.nix +++ b/pkgs/applications/audio/gtkpod/default.nix @@ -1,11 +1,8 @@ { stdenv, fetchurl, pkgconfig, makeWrapper, intltool, libgpod, curl, flac, - gnome3_12, gtk3, glib, gettext, perl, perlXMLParser , libglade, flex, libid3tag, + gnome, gtk3, glib, gettext, perl, perlXMLParser, flex, libglade, libid3tag, libvorbis, hicolor_icon_theme, gdk_pixbuf }: -let - gnome = gnome3_12; - -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { version = "2.1.4"; name = "gtkpod-${version}"; diff --git a/pkgs/desktops/gnome-3/3.10/default.nix b/pkgs/desktops/gnome-3/3.10/default.nix index 89e16490df9..08a7fee4dd7 100644 --- a/pkgs/desktops/gnome-3/3.10/default.nix +++ b/pkgs/desktops/gnome-3/3.10/default.nix @@ -2,6 +2,7 @@ rec { inherit (pkgs) glib gtk2 gtk3 gnome2 upower glib_networking; + gnome3 = pkgs.gnome3_10 // { recurseForDerivations = false; }; gtk = gtk3; # just to be sure libcanberra = pkgs.libcanberra_gtk3; # just to be sure inherit (pkgs.gnome2) ORBit2; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eda61a0c606..145236569f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9069,6 +9069,7 @@ let }; gtkpod = callPackage ../applications/audio/gtkpod { + gnome = gnome3; inherit (gnome) libglade; }; @@ -10827,7 +10828,7 @@ let inherit (pkgs) libsoup libwnck gtk_doc gnome_doc_utils; }; - gnome3 = recurseIntoAttrs (callPackage ../desktops/gnome-3/3.10 { + gnome3_10 = recurseIntoAttrs (callPackage ../desktops/gnome-3/3.10 { callPackage = pkgs.newScope pkgs.gnome3; self = pkgs.gnome3; }); @@ -10836,6 +10837,8 @@ let callPackage = pkgs.newScope pkgs.gnome3_12; }); + gnome3 = gnome3_12; + gnome = recurseIntoAttrs gnome2; hsetroot = callPackage ../tools/X11/hsetroot { }; From 42ee2261841c754c44e04f7ec9fee4fd62a69696 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 8 Sep 2014 22:32:37 +0200 Subject: [PATCH 0033/3123] Fix unzip setup hook --- pkgs/tools/archivers/unzip/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/archivers/unzip/setup-hook.sh b/pkgs/tools/archivers/unzip/setup-hook.sh index 4cad0fe7e91..4055d2fab51 100644 --- a/pkgs/tools/archivers/unzip/setup-hook.sh +++ b/pkgs/tools/archivers/unzip/setup-hook.sh @@ -1,5 +1,5 @@ unpackCmdHooks+=(_tryUnzip) _tryUnzip() { - if ! [[ "foo.zip" =~ \.zip$ ]]; then return 1; fi + if ! [[ "$curSrc" =~ \.zip$ ]]; then return 1; fi unzip -qq "$curSrc" } From 3e8344d334d42824ac3061a919ac15b19a1bf21d Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Sun, 17 Aug 2014 13:17:13 -0700 Subject: [PATCH 0034/3123] suitable clang stdenv --- pkgs/applications/editors/vim/default.nix | 6 +- pkgs/applications/editors/vim/macvim.nix | 5 +- .../version-management/subversion/default.nix | 13 +-- pkgs/build-support/cabal/default.nix | 5 + pkgs/build-support/clang-wrapper/builder.sh | 40 +++++--- pkgs/build-support/clang-wrapper/default.nix | 2 + .../compilers/gcc/4.2-apple64/default.nix | 1 + .../compilers/ghc/7.4.2-binary.nix | 3 +- .../compilers/ghc/7.8.3-binary.nix | 93 +++++++++++++++++++ pkgs/development/compilers/ghc/7.8.3.nix | 2 - pkgs/development/compilers/llvm/3.3/clang.nix | 4 + .../interpreters/guile/clang.patch | 14 +++ .../interpreters/guile/default.nix | 6 +- pkgs/development/interpreters/lua-5/5.1.nix | 2 +- .../interpreters/perl/5.16/default.nix | 1 - .../development/interpreters/ruby/ruby-19.nix | 2 + pkgs/development/libraries/aspell/clang.patch | 18 ++++ pkgs/development/libraries/aspell/default.nix | 4 + pkgs/development/libraries/db/generic.nix | 4 + pkgs/development/libraries/db/osx.patch | 20 ++++ pkgs/development/libraries/gmp/5.1.x.nix | 3 + .../development/libraries/libedit/default.nix | 2 +- pkgs/development/libraries/libffi/default.nix | 2 +- .../libraries/libgcrypt/default.nix | 2 + .../libraries/libunistring/clang.patch | 14 +++ .../libraries/libunistring/default.nix | 2 + .../libraries/mesa-darwin/default.nix | 2 +- .../development/libraries/ncurses/clang.patch | 42 +++++++++ .../development/libraries/ncurses/default.nix | 4 +- .../libraries/readline/clang.patch | 13 +++ .../libraries/readline/readline6.nix | 5 + pkgs/development/libraries/serf/default.nix | 6 +- pkgs/development/libraries/zlib/default.nix | 4 +- pkgs/development/tools/misc/distcc/masq.nix | 4 + pkgs/servers/http/nginx/default.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 1 + pkgs/stdenv/darwin/default.nix | 47 ++++++++++ pkgs/stdenv/default.nix | 8 +- pkgs/stdenv/generic/default.nix | 3 +- pkgs/tools/archivers/sharutils/default.nix | 6 +- pkgs/tools/misc/getopt/default.nix | 2 + pkgs/tools/security/gnupg/clang.patch | 13 +++ pkgs/tools/security/gnupg/default.nix | 1 + pkgs/tools/system/tree/default.nix | 1 + pkgs/tools/typesetting/tex/tetex/clang.patch | 13 +++ pkgs/tools/typesetting/tex/tetex/default.nix | 2 +- pkgs/top-level/all-packages.nix | 33 ++----- pkgs/top-level/haskell-defaults.nix | 4 +- 48 files changed, 415 insertions(+), 71 deletions(-) create mode 100644 pkgs/development/compilers/ghc/7.8.3-binary.nix create mode 100644 pkgs/development/interpreters/guile/clang.patch create mode 100644 pkgs/development/libraries/aspell/clang.patch create mode 100644 pkgs/development/libraries/db/osx.patch create mode 100644 pkgs/development/libraries/libunistring/clang.patch create mode 100644 pkgs/development/libraries/ncurses/clang.patch create mode 100644 pkgs/development/libraries/readline/clang.patch create mode 100644 pkgs/stdenv/darwin/default.nix create mode 100644 pkgs/tools/security/gnupg/clang.patch create mode 100644 pkgs/tools/typesetting/tex/tetex/clang.patch diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 95f654eb8ca..8f27f540997 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -3,12 +3,12 @@ stdenv.mkDerivation rec { name = "vim-${version}"; - version = "7.4.335"; + version = "7.4.410"; src = fetchhg { url = "https://vim.googlecode.com/hg/"; - rev = "v7-4-335"; - sha256 = "0qnpzfcbi6fhz82pj68l4vrnigca1akq2ksrxz6krwlfhns6jhhj"; + rev = "v7-4-410"; + sha256 = "145llhj6gq2bh9b7p8xkxc388krrximq80b87f3cn4w4d4k9fhqp"; }; enableParallelBuilding = true; diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix index feafa7b9977..ad40344f19f 100644 --- a/pkgs/applications/editors/vim/macvim.nix +++ b/pkgs/applications/editors/vim/macvim.nix @@ -1,9 +1,8 @@ -{ stdenv, stdenvAdapters, gccApple, fetchFromGitHub, ncurses, gettext, +{ stdenv, stdenvAdapters, fetchFromGitHub, ncurses, gettext, pkgconfig, cscope, python, ruby, tcl, perl, luajit }: -let inherit (stdenvAdapters.overrideGCC stdenv gccApple) mkDerivation; -in mkDerivation rec { +stdenv.mkDerivation rec { name = "macvim-${version}"; version = "7.4.355"; diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix index 283ea759153..30283ad387c 100644 --- a/pkgs/applications/version-management/subversion/default.nix +++ b/pkgs/applications/version-management/subversion/default.nix @@ -15,7 +15,7 @@ assert httpServer -> httpd != null; assert pythonBindings -> swig != null && python != null; assert javahlBindings -> jdk != null && perl != null; -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { version = "1.8.10"; @@ -73,14 +73,15 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # Hack to build on Mac OS X. The system header files use C99-style - # comments, but Subversion passes -std=c90. - NIX_CFLAGS_COMPILE = "-std=c99"; - meta = { description = "A version control system intended to be a compelling replacement for CVS in the open source community"; homepage = http://subversion.apache.org/; maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ]; hydraPlatforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; }; -} +} // stdenv.lib.optionalAttrs stdenv.isDarwin { + CXX = "clang++"; + CC = "clang"; + CPP = "clang -E"; + CXXCPP = "clang++ -E"; +}) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index d73b4a1f364..bf91de0bd50 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -214,6 +214,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; configureFlags+=" --ghc-option=-j$NIX_BUILD_CORES" ''} + ${optionalString self.stdenv.isDarwin '' + configureFlags+=" --with-gcc=clang" + ''} + echo "configure flags: $extraConfigureFlags $configureFlags" ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \ @@ -236,6 +240,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; export GHC_PACKAGE_PATH=$(${ghc.GHCPackages}) test -n "$noHaddock" || ./Setup haddock --html --hoogle \ + --ghc-options=-optP-P \ ${optionalString self.hyperlinkSource "--hyperlink-source"} eval "$postBuild" diff --git a/pkgs/build-support/clang-wrapper/builder.sh b/pkgs/build-support/clang-wrapper/builder.sh index 0cdb2b96135..2dec6c59933 100644 --- a/pkgs/build-support/clang-wrapper/builder.sh +++ b/pkgs/build-support/clang-wrapper/builder.sh @@ -28,20 +28,32 @@ if test -z "$nativeLibc"; then fi if test -n "$nativeTools"; then - clangPath="$nativePrefix/bin" + if [ -n "$isDarwin" ]; then + clangPath="$clang/bin" + else + clangPath="$nativePrefix/bin" + fi ldPath="$nativePrefix/bin" else - basePath=`echo $gcc/lib/*/*/*` - # Need libgcc until the llvm compiler-rt library is complete - clangLDFlags="$clangLDFlags -L$basePath" - if test -e "$gcc/lib64"; then - clangLDFlags="$clangLDFlags -L$gcc/lib64" - else - clangLDFlags="$clangLDFlags -L$gcc/lib" + clangLDFlags="" + if test -d "$gcc/lib"; then + basePath=`echo $gcc/lib/*/*/*` + # Need libgcc until the llvm compiler-rt library is complete + clangLDFlags="$clangLDFlags -L$basePath" + if test -e "$gcc/lib64"; then + clangLDFlags="$clangLDFlags -L$gcc/lib64" + else + clangLDFlags="$clangLDFlags -L$gcc/lib" + fi fi - clangLDFlags="$clangLDFlags -L$clang/lib" - echo "$clangLDFlags" > $out/nix-support/clang-ldflags + if test -d "$clang/lib"; then + clangLDFlags="$clangLDFlags -L$clang/lib" + fi + + if [ -n "$clangLDFlags" ]; then + echo "$clangLDFlags" > $out/nix-support/clang-ldflags + fi # Need files like crtbegin.o from gcc # It's unclear if these will ever be provided by an LLVM project @@ -49,9 +61,9 @@ else clangCFlags="$clangCFlags -isystem$clang/lib/clang/$clangVersion/include" echo "$clangCFlags" > $out/nix-support/clang-cflags - - clangPath="$clang/bin" + ldPath="$binutils/bin" + clangPath="$clang/bin" fi @@ -125,6 +137,10 @@ test -n "$libc" && echo $libc > $out/nix-support/orig-libc doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" doSubstitute "$setupHook" "$out/nix-support/setup-hook" +cat >> "$out/nix-support/setup-hook" << EOF +export CC=clang +export CXX=clang++ +EOF cp -p $utils $out/nix-support/utils.sh diff --git a/pkgs/build-support/clang-wrapper/default.nix b/pkgs/build-support/clang-wrapper/default.nix index 7a5d87127d9..e61c07ca9d2 100644 --- a/pkgs/build-support/clang-wrapper/default.nix +++ b/pkgs/build-support/clang-wrapper/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation { (if name != "" then name else clangName + "-wrapper") + (if clang != null && clangVersion != "" then "-" + clangVersion else ""); + isDarwin = stdenv.isDarwin; + builder = ./builder.sh; setupHook = ./setup-hook.sh; clangWrapper = ./clang-wrapper.sh; diff --git a/pkgs/development/compilers/gcc/4.2-apple64/default.nix b/pkgs/development/compilers/gcc/4.2-apple64/default.nix index b2444ebb9bf..42d9f29e2b5 100644 --- a/pkgs/development/compilers/gcc/4.2-apple64/default.nix +++ b/pkgs/development/compilers/gcc/4.2-apple64/default.nix @@ -4,6 +4,7 @@ , gmp ? null, mpfr ? null, bison ? null, flex ? null }: +assert false; assert stdenv.isDarwin; assert langF77 -> gmp != null; diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix index 7000081e5db..f6dc974227c 100644 --- a/pkgs/development/compilers/ghc/7.4.2-binary.nix +++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix @@ -62,7 +62,8 @@ stdenv.mkDerivation rec { '' else ""); configurePhase = '' - ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include + ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include \ + --with-clang ''; # Stripping combined with patchelf breaks the executables (they die diff --git a/pkgs/development/compilers/ghc/7.8.3-binary.nix b/pkgs/development/compilers/ghc/7.8.3-binary.nix new file mode 100644 index 00000000000..f2c65c6ad05 --- /dev/null +++ b/pkgs/development/compilers/ghc/7.8.3-binary.nix @@ -0,0 +1,93 @@ +{stdenv, fetchurl, perl, ncurses, gmp}: + +stdenv.mkDerivation rec { + version = "7.8.3"; + + name = "ghc-${version}-binary"; + + src = + if stdenv.system == "i686-linux" then + fetchurl { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; + sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; + } + else if stdenv.system == "x86_64-linux" then + fetchurl { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; + sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; + } + else if stdenv.system == "i686-darwin" then + fetchurl { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; + sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; + } + else if stdenv.system == "x86_64-darwin" then + fetchurl { + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; + sha256 = "1ja0cq5xyjcvjpvjmm4nzhkpmwfs2kjlldbc48lxcs9rmqi7rnay"; + } + else throw "cannot bootstrap GHC on this platform"; + + buildInputs = [perl]; + + postUnpack = + # Strip is harmful, see also below. It's important that this happens + # first. The GHC Cabal build system makes use of strip by default and + # has hardcoded paths to /usr/bin/strip in many places. We replace + # those below, making them point to our dummy script. + '' + mkdir "$TMP/bin" + for i in strip; do + echo '#! ${stdenv.shell}' > "$TMP/bin/$i" + chmod +x "$TMP/bin/$i" + done + PATH="$TMP/bin:$PATH" + '' + + # We have to patch the GMP paths for the integer-gmp package. + '' + find . -name integer-gmp.buildinfo \ + -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \; + '' + + # On Linux, use patchelf to modify the executables so that they can + # find editline/gmp. + (if stdenv.isLinux then '' + find . -type f -perm +100 \ + -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath "${ncurses}/lib:${gmp}/lib" {} \; + sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 + sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 + for prog in ld ar gcc strip ranlib; do + find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; + done + '' else ""); + + configurePhase = '' + ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib \ + --with-gmp-includes=${gmp}/include + ''; + + # Stripping combined with patchelf breaks the executables (they die + # with a segfault or the kernel even refuses the execve). (NIXPKGS-85) + dontStrip = true; + + # No building is necessary, but calling make without flags ironically + # calls install-strip ... + buildPhase = "true"; + + postInstall = + '' + # Sanity check, can ghc create executables? + cd $TMP + mkdir test-ghc; cd test-ghc + cat > main.hs << EOF + module Main where + main = putStrLn "yes" + EOF + $out/bin/ghc --make main.hs + echo compilation ok + [ $(./main) == "yes" ] + ''; + + meta.license = stdenv.lib.licenses.bsd3; + meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"]; +} diff --git a/pkgs/development/compilers/ghc/7.8.3.nix b/pkgs/development/compilers/ghc/7.8.3.nix index dbcba36fa8f..0971cbb1f93 100644 --- a/pkgs/development/compilers/ghc/7.8.3.nix +++ b/pkgs/development/compilers/ghc/7.8.3.nix @@ -26,8 +26,6 @@ stdenv.mkDerivation rec { export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" ''; - configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc"; - # required, because otherwise all symbols from HSffi.o are stripped, and # that in turn causes GHCi to abort stripDebugFlags = [ "-S" "--keep-file-symbols" ]; diff --git a/pkgs/development/compilers/llvm/3.3/clang.nix b/pkgs/development/compilers/llvm/3.3/clang.nix index 262e0bff248..72287560b24 100644 --- a/pkgs/development/compilers/llvm/3.3/clang.nix +++ b/pkgs/development/compilers/llvm/3.3/clang.nix @@ -1,5 +1,9 @@ { stdenv, fetchurl, perl, groff, llvm, cmake, libxml2, python }: +# be sure not to rebuild clang on darwin; some packages request it specifically +# we need to fix those +assert stdenv.isDarwin -> stdenv.gcc.nativeTools; + let version = "3.3"; gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc; diff --git a/pkgs/development/interpreters/guile/clang.patch b/pkgs/development/interpreters/guile/clang.patch new file mode 100644 index 00000000000..4d0f342b211 --- /dev/null +++ b/pkgs/development/interpreters/guile/clang.patch @@ -0,0 +1,14 @@ +diff --git a/lib/stdint.in.h b/lib/stdint.in.h +index 889bca7..15d39b0 100644 +--- a/lib/stdint.in.h ++++ b/lib/stdint.in.h +@@ -74,7 +74,8 @@ + in would reinclude us, skipping our contents because + _@GUARD_PREFIX@_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +-# @INCLUDE_NEXT@ @NEXT_STDINT_H@ ++# include ++// # @INCLUDE_NEXT@ @NEXT_STDINT_H@ + #endif + + #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 2ddad5cde67..ad5d2f1cc58 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -7,11 +7,11 @@ else stdenv.mkDerivation) (rec { - name = "guile-2.0.9"; + name = "guile-2.0.11"; src = fetchurl { url = "mirror://gnu/guile/${name}.tar.xz"; - sha256 = "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"; + sha256 = "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"; }; nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; @@ -29,7 +29,7 @@ enableParallelBuilding = true; - patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ] ++ + patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch ] ++ (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); # Explicitly link against libgcc_s, to work around the infamous diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix index 444ecbc787a..b2ccc7fd642 100644 --- a/pkgs/development/interpreters/lua-5/5.1.nix +++ b/pkgs/development/interpreters/lua-5/5.1.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { configurePhase = if stdenv.isDarwin then '' - makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" ) + makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC=clang ) installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' ) '' else '' makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" ) diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index c1a5374c92e..344f91b2980 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -32,7 +32,6 @@ stdenv.mkDerivation rec { # Miniperl needs -lm. perl needs -lrt. configureFlags = [ "-de" - "-Dcc=gcc" "-Uinstallusrbinperl" "-Dinstallstyle=lib/perl5" "-Duseshrplib" diff --git a/pkgs/development/interpreters/ruby/ruby-19.nix b/pkgs/development/interpreters/ruby/ruby-19.nix index d18718184ba..963d462dc00 100644 --- a/pkgs/development/interpreters/ruby/ruby-19.nix +++ b/pkgs/development/interpreters/ruby/ruby-19.nix @@ -49,6 +49,8 @@ stdenv.mkDerivation rec { installFlags = stdenv.lib.optionalString docSupport "install-doc"; + CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.7"; + postInstall = '' # Bundler tries to create this directory mkdir -pv $out/${passthru.gemPath} diff --git a/pkgs/development/libraries/aspell/clang.patch b/pkgs/development/libraries/aspell/clang.patch new file mode 100644 index 00000000000..c4cfa426588 --- /dev/null +++ b/pkgs/development/libraries/aspell/clang.patch @@ -0,0 +1,18 @@ +--- interfaces/cc/aspell.h 2013-10-13 20:29:33.000000000 +0200 ++++ interfaces/cc/aspell.h 2013-10-13 20:30:01.000000000 +0200 +@@ -237,6 +237,7 @@ + /******************************** errors ********************************/ + + ++#ifndef __cplusplus + extern const struct AspellErrorInfo * const aerror_other; + extern const struct AspellErrorInfo * const aerror_operation_not_supported; + extern const struct AspellErrorInfo * const aerror_cant_copy; +@@ -322,6 +323,7 @@ + extern const struct AspellErrorInfo * const aerror_bad_magic; + extern const struct AspellErrorInfo * const aerror_expression; + extern const struct AspellErrorInfo * const aerror_invalid_expression; ++#endif + + + /******************************* speller *******************************/ diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix index 734bcc0797c..a8d660e89a7 100644 --- a/pkgs/development/libraries/aspell/default.nix +++ b/pkgs/development/libraries/aspell/default.nix @@ -8,6 +8,10 @@ stdenv.mkDerivation rec { sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm"; }; + patchPhase = '' + patch interfaces/cc/aspell.h < ${./clang.patch} + ''; + buildInputs = [ perl ]; doCheck = true; diff --git a/pkgs/development/libraries/db/generic.nix b/pkgs/development/libraries/db/generic.nix index 6217bc46124..9d3f87ad5cb 100644 --- a/pkgs/development/libraries/db/generic.nix +++ b/pkgs/development/libraries/db/generic.nix @@ -18,6 +18,10 @@ stdenv.mkDerivation rec { patches = extraPatches; + patchPhase = '' + patch src/dbinc/atomic.h < ${./osx.patch} + ''; + configureFlags = [ (if cxxSupport then "--enable-cxx" else "--disable-cxx") (if compat185 then "--enable-compat185" else "--disable-compat185") diff --git a/pkgs/development/libraries/db/osx.patch b/pkgs/development/libraries/db/osx.patch new file mode 100644 index 00000000000..398aa1d3700 --- /dev/null +++ b/pkgs/development/libraries/db/osx.patch @@ -0,0 +1,20 @@ +--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400 ++++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400 +@@ -144,7 +144,7 @@ + #define atomic_inc(env, p) __atomic_inc(p) + #define atomic_dec(env, p) __atomic_dec(p) + #define atomic_compare_exchange(env, p, o, n) \ +- __atomic_compare_exchange((p), (o), (n)) ++ __atomic_compare_exchange_db((p), (o), (n)) + static inline int __atomic_inc(db_atomic_t *p) + { + int temp; +@@ -176,7 +176,7 @@ + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html + * which configure could be changed to use. + */ +-static inline int __atomic_compare_exchange( ++static inline int __atomic_compare_exchange_db( + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) + { + atomic_value_t was; diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index 14a6d34d932..5bee2fe4336 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -16,10 +16,13 @@ stdenv.mkDerivation (rec { # Build a "fat binary", with routines for several sub-architectures # (x86), except on Solaris where some tests crash with "Memory fault". # See , for instance. + # + # no darwin because gmp uses ASM that clang doesn't like optional (!stdenv.isSunOS) "--enable-fat" ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]) ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" + ++ optional stdenv.isDarwin "ABI=64 CC=clang" ++ optional stdenv.is64bit "--with-pic" ; diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix index 1382af16484..659f22b9b3b 100644 --- a/pkgs/development/libraries/libedit/default.nix +++ b/pkgs/development/libraries/libedit/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { NROFF = "${groff}/bin/nroff"; postInstall = '' - sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc + sed -i ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.gcc.nativeTools) "''"} s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc ''; # taken from gentoo http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libedit/files/ diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index da5a080521c..20b697144a0 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { postInstall = # Install headers in the right place. - '' ln -s${if stdenv.isFreeBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" + '' ln -s${if stdenv.isBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" ''; meta = { diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix index ed267e23c87..8cc5b924cce 100644 --- a/pkgs/development/libraries/libgcrypt/default.nix +++ b/pkgs/development/libraries/libgcrypt/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation (rec { propagatedBuildInputs = [ libgpgerror ]; + configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-asm"; + doCheck = stdenv.system != "i686-linux"; # "basic" test fails after stdenv+glibc-2.18 # For some reason the tests don't find `libgpg-error.so'. diff --git a/pkgs/development/libraries/libunistring/clang.patch b/pkgs/development/libraries/libunistring/clang.patch new file mode 100644 index 00000000000..fdcbc0d528d --- /dev/null +++ b/pkgs/development/libraries/libunistring/clang.patch @@ -0,0 +1,14 @@ +diff --git a/lib/stdint.in.h b/lib/stdint.in.h +index 997e406..e0827f5 100644 +--- a/lib/stdint.in.h ++++ b/lib/stdint.in.h +@@ -53,7 +53,8 @@ + in would reinclude us, skipping our contents because + _GL_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +-# @INCLUDE_NEXT@ @NEXT_STDINT_H@ ++# include ++// # @INCLUDE_NEXT@ @NEXT_STDINT_H@ + #endif + + #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index 2a87d7a3249..9470240fc14 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation (rec { sha256 = "18q620269xzpw39dwvr9zpilnl2dkw5z5kz3mxaadnpv4k3kw3b1"; }; + patches = stdenv.lib.optional stdenv.isDarwin [ ./clang.patch ]; + propagatedBuildInputs = stdenv.lib.optional ((! (stdenv ? glibc)) || (stdenv ? cross && diff --git a/pkgs/development/libraries/mesa-darwin/default.nix b/pkgs/development/libraries/mesa-darwin/default.nix index 98936904be5..f259a397c84 100644 --- a/pkgs/development/libraries/mesa-darwin/default.nix +++ b/pkgs/development/libraries/mesa-darwin/default.nix @@ -1,4 +1,4 @@ -{ stdenv, stdenvAdapters, gccApple, fetchurl, pkgconfig, intltool, flex, bison +{ stdenv, stdenvAdapters, fetchurl, pkgconfig, intltool, flex, bison , python, libxml2Python, file, expat, makedepend, xorg, llvm, libffi, libvdpau , enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt , enableExtraFeatures ? false # not maintained diff --git a/pkgs/development/libraries/ncurses/clang.patch b/pkgs/development/libraries/ncurses/clang.patch new file mode 100644 index 00000000000..ce33049bf40 --- /dev/null +++ b/pkgs/development/libraries/ncurses/clang.patch @@ -0,0 +1,42 @@ +diff -ruNp ncurses-5.8.orig/c++/cursesf.h ncurses-5.8/c++/cursesf.h +--- ncurses-5.8.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 ++++ ncurses-5.8/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 +@@ -681,7 +681,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, with_frame, autoDelete_Fields) { ++ : NCursesForm (&Fields, with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); + }; +@@ -694,7 +694,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, ++ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, + with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); +diff -ruNp ncurses-5.8.orig/c++/cursesm.h ncurses-5.8/c++/cursesm.h +--- ncurses-5.8.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 ++++ ncurses-5.8/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 +@@ -639,7 +639,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) +- : NCursesMenu (Items, with_frame, autoDelete_Items) { ++ : NCursesMenu (&Items, with_frame, autoDelete_Items) { + if (menu) + set_user (const_cast(p_UserData)); + }; +@@ -651,7 +651,7 @@ public: + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE) +- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { ++ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { + if (menu) + set_user (const_cast(p_UserData)); + }; diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 631199bf87c..3aa27480a0f 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"; }; - patches = [ ./patch-ac ]; + patches = [ ./patch-ac ./clang.patch ]; configureFlags = '' --with-shared --without-debug --enable-pc-files --enable-symlinks @@ -35,8 +35,6 @@ stdenv.mkDerivation rec { export configureFlags="$configureFlags --includedir=$out/include" export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" mkdir -p "$PKG_CONFIG_LIBDIR" - '' + lib.optionalString stdenv.isDarwin '' - substituteInPlace configure --replace -no-cpp-precomp "" ''; selfNativeBuildInput = true; diff --git a/pkgs/development/libraries/readline/clang.patch b/pkgs/development/libraries/readline/clang.patch new file mode 100644 index 00000000000..42bb0be09c3 --- /dev/null +++ b/pkgs/development/libraries/readline/clang.patch @@ -0,0 +1,13 @@ +diff --git a/support/shobj-conf b/support/shobj-conf +index 5a63e80..4b2a741 100644 +--- support/shobj-conf ++++ support/shobj-conf +@@ -189,7 +189,7 @@ darwin*|macosx*) + darwin[789]*|darwin10*) SHOBJ_LDFLAGS='' + SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; +- *) SHOBJ_LDFLAGS='-dynamic' ++ *) SHOBJ_LDFLAGS='-dynamiclib' + SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; + esac diff --git a/pkgs/development/libraries/readline/readline6.nix b/pkgs/development/libraries/readline/readline6.nix index d72d6566bbc..bffa838d2b3 100644 --- a/pkgs/development/libraries/readline/readline6.nix +++ b/pkgs/development/libraries/readline/readline6.nix @@ -10,10 +10,15 @@ stdenv.mkDerivation (rec { propagatedBuildInputs = [ncurses]; + preConfigure = '' + export CC=clang + ''; + patchFlags = "-p0"; patches = [ ./link-against-ncurses.patch ./no-arch_only.patch + ./clang.patch ] ++ (let diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 1e8eec6ae45..033e53e521d 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { buildPhase = '' scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \ - APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${stdenv.gcc}/bin/gcc" + APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${ + if stdenv.isDarwin then "clang" else "${stdenv.gcc}/bin/gcc" + }" ''; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib"; + installPhase = '' scons install ''; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 0938e2a17a7..1b46c959448 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -15,7 +15,9 @@ stdenv.mkDerivation rec { configureFlags = if static then "" else "--shared"; - preConfigure = '' + preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' + export CC=clang + '' + '' if test -n "$crossConfig"; then export CC=$crossConfig-gcc configureFlags=${if static then "" else "--shared"} diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix index 753c35b5d3a..28b31cbb48d 100644 --- a/pkgs/development/tools/misc/distcc/masq.nix +++ b/pkgs/development/tools/misc/distcc/masq.nix @@ -3,6 +3,10 @@ stdenv.mkDerivation { name = "distcc-masq-${gccRaw.name}"; + meta = { + platforms = stdenv.lib.platforms.linux; + }; + phases = [ "installPhase" ]; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/servers/http/nginx/default.nix b/pkgs/servers/http/nginx/default.nix index 700317bc799..204a33cd4a5 100644 --- a/pkgs/servers/http/nginx/default.nix +++ b/pkgs/servers/http/nginx/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation rec { ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"; - additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; + additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized"; preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags" diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 93afa06a7f2..66f74f30549 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -75,6 +75,7 @@ in # Remove useless DocBook XML files. rm -rf $out/share/doc ''; + CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; }; libXfont = attrs: attrs // { diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix new file mode 100644 index 00000000000..5c2044386c6 --- /dev/null +++ b/pkgs/stdenv/darwin/default.nix @@ -0,0 +1,47 @@ +{ stdenv, pkgs, config }: + +import ../generic rec { + inherit config; + + preHook = + '' + export NIX_ENFORCE_PURITY= + export NIX_IGNORE_LD_THROUGH_GCC=1 + export NIX_DONT_SET_RPATH=1 + export NIX_NO_SELF_RPATH=1 + dontFixLibtool=1 + stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" + xargsFlags=" " + export MACOSX_DEPLOYMENT_TARGET=10.6 + export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true) + export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" + export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib" + ''; + + initialPath = (import ../common-path.nix) {pkgs = pkgs;}; + + system = stdenv.system; + + gcc = import ../../build-support/clang-wrapper { + nativeTools = false; + nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; + nativeLibc = true; + inherit stdenv; + binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; + clang = pkgs.clang_34; + coreutils = pkgs.coreutils; + shell = pkgs.bash + "/bin/sh"; + }; + + shell = pkgs.bash + "/bin/sh"; + + fetchurlBoot = stdenv.fetchurlBoot; + + overrides = pkgs_: { + inherit gcc; + inherit (gcc) binutils; + inherit (pkgs) + gzip bzip2 xz bash coreutils diffutils findutils gawk + gnumake gnused gnutar gnugrep gnupatch perl; + }; +} diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 47d1fb6d9f7..8e8be748795 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -33,6 +33,12 @@ rec { pkgs = stdenvNativePkgs; }; + stdenvDarwin = import ./darwin { + inherit config; + stdenv = stdenvNative; + pkgs = stdenvNativePkgs; + }; + # Linux standard environment. stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux; @@ -47,7 +53,7 @@ rec { if system == "armv7l-linux" then stdenvLinux else if system == "mips64el-linux" then stdenvLinux else if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else - if system == "x86_64-darwin" then stdenvNix else + if system == "x86_64-darwin" then stdenvDarwin else if system == "x86_64-solaris" then stdenvNix else stdenvNative; } diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 29e4455f7cb..b126e7bf36b 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -163,7 +163,8 @@ let isBSD = system == "i686-freebsd" || system == "x86_64-freebsd" || system == "i686-openbsd" - || system == "x86_64-openbsd"; + || system == "x86_64-openbsd" + || system == "x86_64-darwin"; isi686 = system == "i686-linux" || system == "i686-gnu" || system == "i686-freebsd" diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix index f19564e4ad9..281a148a5ca 100644 --- a/pkgs/tools/archivers/sharutils/default.nix +++ b/pkgs/tools/archivers/sharutils/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, gettext }: +{ stdenv, fetchurl, gettext, coreutils }: stdenv.mkDerivation rec { name = "sharutils-4.11.1"; @@ -12,11 +12,11 @@ stdenv.mkDerivation rec { '' # Fix for building on Glibc 2.16. Won't be needed once the # gnulib in sharutils is updated. - sed -i '/gets is a security hole/d' lib/stdio.in.h + sed -i ${stdenv.lib.optionalString (stdenv.isBSD && stdenv.gcc.nativeTools) "''"} '/gets is a security hole/d' lib/stdio.in.h ''; # GNU Gettext is needed on non-GNU platforms. - buildInputs = [ gettext ]; + buildInputs = [ gettext coreutils ]; doCheck = true; diff --git a/pkgs/tools/misc/getopt/default.nix b/pkgs/tools/misc/getopt/default.nix index 41bc2ffc99d..84d15a18747 100644 --- a/pkgs/tools/misc/getopt/default.nix +++ b/pkgs/tools/misc/getopt/default.nix @@ -7,4 +7,6 @@ stdenv.mkDerivation { url = http://tarballs.nixos.org/getopt-1.1.4.tar.gz; md5 = "02188ca68da27c4175d6e9f3da732101"; }; + + buildFlags = stdenv.lib.optional stdenv.isDarwin [ "CC=clang" ]; } diff --git a/pkgs/tools/security/gnupg/clang.patch b/pkgs/tools/security/gnupg/clang.patch new file mode 100644 index 00000000000..842785e5c93 --- /dev/null +++ b/pkgs/tools/security/gnupg/clang.patch @@ -0,0 +1,13 @@ +diff --git a/gl/stdint_.h b/gl/stdint_.h +index bc27595..303e81a 100644 +--- a/gl/stdint_.h ++++ b/gl/stdint_.h +@@ -62,7 +62,7 @@ + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. + also defines intptr_t and uintptr_t. */ + # define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H +-# include ++// # include + # undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H + #elif @HAVE_SYS_INTTYPES_H@ + /* Solaris 7 has the types except the *_fast*_t types, and diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index 64e2be90d30..e00985b16ed 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -31,6 +31,7 @@ stdenv.mkDerivation rec { patchPhase = '' find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/' + patch gl/stdint_.h < ${./clang.patch} ''; checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check"; diff --git a/pkgs/tools/system/tree/default.nix b/pkgs/tools/system/tree/default.nix index e108589aaef..51de5998069 100644 --- a/pkgs/tools/system/tree/default.nix +++ b/pkgs/tools/system/tree/default.nix @@ -37,6 +37,7 @@ stdenv.mkDerivation { prefix=$out MANDIR=$out/share/man/man1 ${systemFlags} + CC=clang ) ''; diff --git a/pkgs/tools/typesetting/tex/tetex/clang.patch b/pkgs/tools/typesetting/tex/tetex/clang.patch new file mode 100644 index 00000000000..50d83f62443 --- /dev/null +++ b/pkgs/tools/typesetting/tex/tetex/clang.patch @@ -0,0 +1,13 @@ +diff --git a/texk/ps2pkm/type1.c b/texk/ps2pkm/type1.c +index 027bf1f..4dcbad0 100644 +--- a/texk/ps2pkm/type1.c ++++ b/texk/ps2pkm/type1.c +@@ -800,7 +800,7 @@ static void PSFakePush(Num) + static DOUBLE PSFakePop () + { + if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]); +- else Error0("PSFakePop : Stack empty\n"); ++ else { CC; IfTrace0(TRUE, "PSFakePop : Stack empty\n"); errflag = TRUE; return 0; } + /*NOTREACHED*/ + } + diff --git a/pkgs/tools/typesetting/tex/tetex/default.nix b/pkgs/tools/typesetting/tex/tetex/default.nix index 5cd3228aced..173571eda23 100644 --- a/pkgs/tools/typesetting/tex/tetex/default.nix +++ b/pkgs/tools/typesetting/tex/tetex/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { sed -i 57d texk/kpathsea/c-std.h ''; - patches = [ ./environment.patch ./getline.patch ]; + patches = [ ./environment.patch ./getline.patch ./clang.patch ]; setupHook = ./setup-hook.sh; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 49fc5f5658f..d4995b0e1d7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -231,8 +231,6 @@ let else defaultStdenv; - stdenvApple = stdenvAdapters.overrideGCC allStdenvs.stdenvNative gccApple; - forceNativeDrv = drv : if crossSystem == null then drv else (drv // { crossDrv = drv.nativeDrv; }); @@ -2686,8 +2684,7 @@ let }; clangUnwrapped = llvm: pkg: callPackage pkg { - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; - inherit llvm; + inherit stdenv llvm; }; clangSelf = clangWrapSelf llvmPackagesSelf.clang; @@ -2704,7 +2701,7 @@ let }; #Use this instead of stdenv to build with clang - clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang); + clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideGCC stdenv clang); libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang); clean = callPackage ../development/compilers/clean { }; @@ -2912,16 +2909,6 @@ let else null; })); - gccApple = - assert stdenv.isDarwin; - wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) { - inherit fetchurl noSysDirs; - profiledCompiler = true; - # Since it fails to build with GCC 4.6, build it with the "native" - # Apple-GCC. - stdenv = allStdenvs.stdenvNative; - }); - gfortran = gfortran48; gfortran48 = wrapGCC (gcc48.gcc.override { @@ -3216,9 +3203,7 @@ let llvm_34 = llvmPackages_34.llvm; llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix; - llvm_v = path: callPackage path { - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; - }; + llvm_v = path: callPackage path { }; llvmPackages = if !stdenv.isDarwin then llvmPackages_34 else llvmPackages_34 // { # until someone solves build problems with _34 @@ -3956,7 +3941,7 @@ let bam = callPackage ../development/tools/build-managers/bam {}; binutils = if stdenv.isDarwin - then stdenv.gcc.binutils + then import ../build-support/native-darwin-cctools-wrapper {inherit stdenv;} else callPackage ../development/tools/misc/binutils { inherit noSysDirs; }; @@ -4097,10 +4082,12 @@ let wrapGCC (distcc.links extraConfig)) {}; distccStdenv = lowPrio (overrideGCC stdenv distccWrapper); - distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix { - gccRaw = gcc.gcc; - binutils = binutils; - }; + distccMasquerade = if stdenv.isDarwin + then null + else callPackage ../development/tools/misc/distcc/masq.nix { + gccRaw = gcc.gcc; + binutils = binutils; + }; docutils = builderDefsPackage (import ../development/tools/documentation/docutils) { inherit python pil makeWrapper; diff --git a/pkgs/top-level/haskell-defaults.nix b/pkgs/top-level/haskell-defaults.nix index 9a064212a40..93d8431b8d0 100644 --- a/pkgs/top-level/haskell-defaults.nix +++ b/pkgs/top-level/haskell-defaults.nix @@ -204,6 +204,8 @@ gmp = pkgs.gmp4; }); + ghc783Binary = lowPrio (callPackage ../development/compilers/ghc/7.8.3-binary.nix {}); + ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary; ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary; @@ -224,7 +226,7 @@ packages_ghc783 = packages { ghcPath = ../development/compilers/ghc/7.8.3.nix; - ghcBinary = ghc742Binary; + ghcBinary = ghc783Binary; prefFun = ghc783Prefs; }; From 7da056233f8436d361528d0eb20bec8286445a51 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Wed, 20 Aug 2014 19:30:50 -0700 Subject: [PATCH 0035/3123] wip libc++ --- .../version-management/subversion/default.nix | 2 -- pkgs/development/compilers/llvm/3.4/llvm.nix | 2 +- .../libraries/libc++abi/default.nix | 9 ++++---- .../libraries/libunwind/native.nix | 22 +++++++++++++++++++ pkgs/development/libraries/mpc/default.nix | 2 ++ pkgs/development/libraries/mpfr/default.nix | 2 ++ pkgs/development/libraries/serf/default.nix | 8 +++---- pkgs/stdenv/darwin/default.nix | 5 +++++ pkgs/tools/package-management/nix/default.nix | 4 +++- .../tools/package-management/nix/unstable.nix | 5 +++-- pkgs/tools/text/sgml/opensp/default.nix | 5 +++++ pkgs/top-level/all-packages.nix | 2 ++ 12 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 pkgs/development/libraries/libunwind/native.nix diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix index 30283ad387c..af9827ef4b8 100644 --- a/pkgs/applications/version-management/subversion/default.nix +++ b/pkgs/applications/version-management/subversion/default.nix @@ -46,8 +46,6 @@ stdenv.mkDerivation (rec { preBuild = '' makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) - '' + stdenv.lib.optionalString stdenv.isDarwin '' - substituteInPlace configure --replace "-no-cpp-precomp" "" ''; postInstall = '' diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix index fbc881fc8e0..dfd7b5570ea 100644 --- a/pkgs/development/compilers/llvm/3.4/llvm.nix +++ b/pkgs/development/compilers/llvm/3.4/llvm.nix @@ -65,6 +65,6 @@ in stdenv.mkDerivation rec { license = stdenv.lib.licenses.bsd3; maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ]; platforms = stdenv.lib.platforms.all; - broken = stdenv.isDarwin; + # broken = stdenv.isDarwin; }; } diff --git a/pkgs/development/libraries/libc++abi/default.nix b/pkgs/development/libraries/libc++abi/default.nix index 8218cbb966f..aae3027fd62 100644 --- a/pkgs/development/libraries/libc++abi/default.nix +++ b/pkgs/development/libraries/libc++abi/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchsvn, libcxx, libunwind }: +{ stdenv, fetchsvn, libcxx, libunwind, gnused }: let rev = "199626"; in stdenv.mkDerivation { @@ -15,17 +15,16 @@ in stdenv.mkDerivation { postUnpack = '' unpackFile ${libcxx.src} export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" + export TRIPLE=x86_64-apple-darwin ''; installPhase = '' install -d -m 755 $out/include $out/lib - install -m 644 lib/libc++abi.so.1.0 $out/lib + install -m 644 lib/libc++abi.dylib $out/lib install -m 644 include/cxxabi.h $out/include - ln -s libc++abi.so.1.0 $out/lib/libc++abi.so - ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - patchPhase = "sed -e s,-lstdc++,, -i lib/buildit"; + patchPhase = "${gnused}/bin/sed -e s,-lstdc++,, -i lib/buildit"; buildPhase = "(cd lib; ./buildit)"; diff --git a/pkgs/development/libraries/libunwind/native.nix b/pkgs/development/libraries/libunwind/native.nix new file mode 100644 index 00000000000..dd2ebb6a642 --- /dev/null +++ b/pkgs/development/libraries/libunwind/native.nix @@ -0,0 +1,22 @@ +{ stdenv }: + +stdenv.mkDerivation { + name = "libunwind-native"; + + unpackPhase = ":"; + dontBuild = true; + + installPhase = '' + mkdir -p $out/lib + cat ${/usr/lib/system/libunwind.dylib} > $out/lib/libunwind.dylib + /usr/bin/install_name_tool \ + -change /usr/lib/system/libunwind.dylib ${/usr/lib/system/libunwind.dylib} \ + -change /usr/lib/system/libsystem_malloc.dylib ${/usr/lib/system/libsystem_malloc.dylib} \ + -change /usr/lib/system/libsystem_pthread.dylib ${/usr/lib/system/libsystem_pthread.dylib} \ + -change /usr/lib/system/libsystem_platform.dylib ${/usr/lib/system/libsystem_platform.dylib} \ + -change /usr/lib/system/libsystem_c.dylib ${/usr/lib/system/libsystem_c.dylib} \ + -change /usr/lib/system/libdyld.dylib ${/usr/lib/system/libdyld.dylib} \ + -change /usr/lib/system/libkeymgr.dylib ${/usr/lib/system/libkeymgr.dylib} \ + $out/lib/libunwind.dylib + ''; +} diff --git a/pkgs/development/libraries/mpc/default.nix b/pkgs/development/libraries/mpc/default.nix index 3d05fa2e040..dd132cfb5b7 100644 --- a/pkgs/development/libraries/mpc/default.nix +++ b/pkgs/development/libraries/mpc/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { buildInputs = [ gmp mpfr ]; + CFLAGS = "-I${gmp}/include"; + doCheck = true; meta = { diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index 653481aeccd..d999ba0cda5 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { buildInputs = [ gmp ]; + CFLAGS = "-I${gmp}/include"; + configureFlags = /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite: http://hydra.bordeaux.inria.fr/build/34862 diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 033e53e521d..49d7cec9590 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig }: +{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig, gnused }: stdenv.mkDerivation rec { name = "serf-1.3.7"; @@ -11,9 +11,9 @@ stdenv.mkDerivation rec { buildInputs = [ apr scons openssl aprutil zlib krb5 pkgconfig ]; configurePhase = '' - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct ''; buildPhase = '' diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 5c2044386c6..d9668d0972c 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -27,6 +27,11 @@ import ../generic rec { nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; nativeLibc = true; inherit stdenv; + libcxx = pkgs.libcxx.override { + libcxxabi = pkgs.libcxxabi.override { + libunwind = pkgs.libunwindNative; + }; + }; binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; clang = pkgs.clang_34; coreutils = pkgs.coreutils; diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 6631214f39a..e64bc329393 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { postUnpack = '' export CPATH="${bzip2}/include" export LIBRARY_PATH="${bzip2}/lib" + export CXX=/usr/bin/clang++ + export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" ''; configureFlags = @@ -32,7 +34,7 @@ stdenv.mkDerivation rec { --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} --disable-init-state --enable-gc - CFLAGS=-O3 CXXFLAGS=-O3 + CFLAGS=-O3 ''; makeFlags = "profiledir=$(out)/etc/profile.d"; diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix index 5c20c7eb72a..514924325e4 100644 --- a/pkgs/tools/package-management/nix/unstable.nix +++ b/pkgs/tools/package-management/nix/unstable.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, perl, curl, bzip2, sqlite, openssl ? null -, pkgconfig, boehmgc, perlPackages +, pkgconfig, boehmgc, perlPackages, bash , storeDir ? "/nix/store" , stateDir ? "/nix/var" }: @@ -24,6 +24,7 @@ stdenv.mkDerivation rec { postUnpack = '' export CPATH="${bzip2}/include" export LIBRARY_PATH="${bzip2}/lib" + export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" ''; configureFlags = @@ -34,7 +35,7 @@ stdenv.mkDerivation rec { --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} --disable-init-state --enable-gc - CFLAGS=-O3 CXXFLAGS=-O3 + CFLAGS=-O3 ''; makeFlags = "profiledir=$(out)/etc/profile.d"; diff --git a/pkgs/tools/text/sgml/opensp/default.nix b/pkgs/tools/text/sgml/opensp/default.nix index 59b9b7bc13d..71901b20ff1 100644 --- a/pkgs/tools/text/sgml/opensp/default.nix +++ b/pkgs/tools/text/sgml/opensp/default.nix @@ -13,6 +13,11 @@ stdenv.mkDerivation { docsrc/*.xml ''; + configureFlags = [ + "--with-libintl-prefix=/usr" + "--with-libiconv-prefix=/usr" + ]; + setupHook = ./setup-hook.sh; buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d4995b0e1d7..8e130d8c1b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5699,6 +5699,8 @@ let libunwind = callPackage ../development/libraries/libunwind { }; + libunwindNative = callPackage ../development/libraries/libunwind/native.nix {}; + libuvVersions = callPackage ../development/libraries/libuv { }; libv4l = lowPrio (v4l_utils.override { From 2e26f7bef14678667c87dcb1f9e76dcf1e47ec3d Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:15:31 -0700 Subject: [PATCH 0036/3123] livcxx build --- pkgs/development/libraries/libc++/default.nix | 2 +- pkgs/development/libraries/libc++abi/default.nix | 2 +- pkgs/development/libraries/readline/readline6.nix | 4 ---- pkgs/stdenv/darwin/default.nix | 6 +++--- pkgs/stdenv/default.nix | 8 ++++++++ pkgs/top-level/all-packages.nix | 6 +++++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/libc++/default.nix b/pkgs/development/libraries/libc++/default.nix index 32035709d8f..1ec1a61716d 100644 --- a/pkgs/development/libraries/libc++/default.nix +++ b/pkgs/development/libraries/libc++/default.nix @@ -26,6 +26,6 @@ in stdenv.mkDerivation rec { description = "A new implementation of the C++ standard library, targeting C++11"; license = "BSD"; maintainers = stdenv.lib.maintainers.shlevy; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; }; } diff --git a/pkgs/development/libraries/libc++abi/default.nix b/pkgs/development/libraries/libc++abi/default.nix index aae3027fd62..141802d1616 100644 --- a/pkgs/development/libraries/libc++abi/default.nix +++ b/pkgs/development/libraries/libc++abi/default.nix @@ -33,6 +33,6 @@ in stdenv.mkDerivation { description = "A new implementation of low level support for a standard C++ library"; license = "BSD"; maintainers = stdenv.lib.maintainers.shlevy; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; }; } diff --git a/pkgs/development/libraries/readline/readline6.nix b/pkgs/development/libraries/readline/readline6.nix index bffa838d2b3..1555f255c51 100644 --- a/pkgs/development/libraries/readline/readline6.nix +++ b/pkgs/development/libraries/readline/readline6.nix @@ -10,10 +10,6 @@ stdenv.mkDerivation (rec { propagatedBuildInputs = [ncurses]; - preConfigure = '' - export CC=clang - ''; - patchFlags = "-p0"; patches = [ ./link-against-ncurses.patch diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index d9668d0972c..28c863b63b0 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs, config }: +{ stdenv, pkgs, config, haveLibCxx }: import ../generic rec { inherit config; @@ -27,11 +27,11 @@ import ../generic rec { nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; nativeLibc = true; inherit stdenv; - libcxx = pkgs.libcxx.override { + libcxx = if haveLibCxx then pkgs.libcxx.override { libcxxabi = pkgs.libcxxabi.override { libunwind = pkgs.libunwindNative; }; - }; + } else null; binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; clang = pkgs.clang_34; coreutils = pkgs.coreutils; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 8e8be748795..665cefbfc43 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -37,6 +37,14 @@ rec { inherit config; stdenv = stdenvNative; pkgs = stdenvNativePkgs; + haveLibCxx = true; + }; + + stdenvDarwinNaked = import ./darwin { + inherit config; + stdenv = stdenvNative; + pkgs = stdenvNativePkgs; + haveLibCxx = false; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8e130d8c1b8..49b1cd9b180 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1800,7 +1800,11 @@ let openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; }); - opensp = callPackage ../tools/text/sgml/opensp { }; + opensp = callPackage ../tools/text/sgml/opensp { + stdenv = if stdenv.isDarwin + then allStdenvs.stdenvDarwinNaked + else stdenv; + }; spCompat = callPackage ../tools/text/sgml/opensp/compat.nix { }; From 374648deaab5e8cacaa21b7d514375f6d8c42695 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:40:14 -0700 Subject: [PATCH 0037/3123] X11 build purity --- pkgs/servers/x11/xorg/overrides.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 66f74f30549..7073adb85dd 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -69,7 +69,9 @@ in }; libX11 = attrs: attrs // { - preConfigure = setMalloc0ReturnsNullCrossCompiling; + preConfigure = setMalloc0ReturnsNullCrossCompiling + '' + sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure + ''; postInstall = '' # Remove useless DocBook XML files. From c5cb8aab31a9b0bd3f48595e0e70f9ec91c2f068 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:42:52 -0700 Subject: [PATCH 0038/3123] build ghc with older binary where possible --- pkgs/top-level/haskell-defaults.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/haskell-defaults.nix b/pkgs/top-level/haskell-defaults.nix index 93d8431b8d0..0d1ddc6cbfb 100644 --- a/pkgs/top-level/haskell-defaults.nix +++ b/pkgs/top-level/haskell-defaults.nix @@ -226,7 +226,7 @@ packages_ghc783 = packages { ghcPath = ../development/compilers/ghc/7.8.3.nix; - ghcBinary = ghc783Binary; + ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary; prefFun = ghc783Prefs; }; From f3f6acc9f8e963c460e1bb971c2606160cac7294 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:47:29 -0700 Subject: [PATCH 0039/3123] mark nixUnstable as broken on darwin --- pkgs/tools/package-management/nix/unstable.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix index 514924325e4..d5aebe45dd6 100644 --- a/pkgs/tools/package-management/nix/unstable.nix +++ b/pkgs/tools/package-management/nix/unstable.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { postUnpack = '' export CPATH="${bzip2}/include" export LIBRARY_PATH="${bzip2}/lib" - export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" ''; configureFlags = @@ -69,6 +68,9 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; meta = { + # due to builder args bug; see + # https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6 + broken = stdenv.isDarwin; description = "The Nix Deployment System"; homepage = http://nixos.org/; license = stdenv.lib.licenses.lgpl2Plus; From 6920b0066c1724784599aaad5cae4fd53157e814 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:49:36 -0700 Subject: [PATCH 0040/3123] stick darwin-specifics in a conditional --- .../libraries/libc++abi/default.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libc++abi/default.nix b/pkgs/development/libraries/libc++abi/default.nix index 141802d1616..a2e333313b8 100644 --- a/pkgs/development/libraries/libc++abi/default.nix +++ b/pkgs/development/libraries/libc++abi/default.nix @@ -15,14 +15,23 @@ in stdenv.mkDerivation { postUnpack = '' unpackFile ${libcxx.src} export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" + '' + stdenv.lib.optionalString '' export TRIPLE=x86_64-apple-darwin ''; - installPhase = '' - install -d -m 755 $out/include $out/lib - install -m 644 lib/libc++abi.dylib $out/lib - install -m 644 include/cxxabi.h $out/include - ''; + installPhase = if stdenv.isDarwin + then '' + install -d -m 755 $out/include $out/lib + install -m 644 lib/libc++abi.dylib $out/lib + install -m 644 include/cxxabi.h $out/include + '' + else '' + install -d -m 755 $out/include $out/lib + install -m 644 lib/libc++abi.so.1.0 $out/lib + install -m 644 include/cxxabi.h $out/include + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 + ''; patchPhase = "${gnused}/bin/sed -e s,-lstdc++,, -i lib/buildit"; From 799f4444778dc804f950e9559c46144bd7f7f0be Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:50:34 -0700 Subject: [PATCH 0041/3123] libunwindNative for darwin only --- pkgs/development/libraries/libunwind/native.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/libunwind/native.nix b/pkgs/development/libraries/libunwind/native.nix index dd2ebb6a642..10e552a2810 100644 --- a/pkgs/development/libraries/libunwind/native.nix +++ b/pkgs/development/libraries/libunwind/native.nix @@ -6,6 +6,7 @@ stdenv.mkDerivation { unpackPhase = ":"; dontBuild = true; + # TODO: figure out if these are different in Mavericks + older installPhase = '' mkdir -p $out/lib cat ${/usr/lib/system/libunwind.dylib} > $out/lib/libunwind.dylib @@ -19,4 +20,6 @@ stdenv.mkDerivation { -change /usr/lib/system/libkeymgr.dylib ${/usr/lib/system/libkeymgr.dylib} \ $out/lib/libunwind.dylib ''; + + meta.platforms = stdenv.lib.platforms.darwin; } From e961c0621542d65abb0280b0daea25d4258c6aaf Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Thu, 21 Aug 2014 16:57:30 -0700 Subject: [PATCH 0042/3123] missing an argument --- pkgs/development/libraries/libc++abi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libc++abi/default.nix b/pkgs/development/libraries/libc++abi/default.nix index a2e333313b8..cedd4bc6dba 100644 --- a/pkgs/development/libraries/libc++abi/default.nix +++ b/pkgs/development/libraries/libc++abi/default.nix @@ -15,7 +15,7 @@ in stdenv.mkDerivation { postUnpack = '' unpackFile ${libcxx.src} export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" - '' + stdenv.lib.optionalString '' + '' + stdenv.lib.optionalString stdenv.isDarwin '' export TRIPLE=x86_64-apple-darwin ''; From ed42a8c1387a4a642ea4656fd4c4b0eaba532810 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 21 Aug 2014 19:32:31 -0700 Subject: [PATCH 0043/3123] libcxxabi needs coreutils for `cp -d` --- pkgs/development/libraries/libc++abi/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libc++abi/default.nix b/pkgs/development/libraries/libc++abi/default.nix index cedd4bc6dba..4020856575b 100644 --- a/pkgs/development/libraries/libc++abi/default.nix +++ b/pkgs/development/libraries/libc++abi/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchsvn, libcxx, libunwind, gnused }: +{ stdenv, coreutils, fetchsvn, libcxx, libunwind, gnused }: let rev = "199626"; in stdenv.mkDerivation { @@ -12,6 +12,8 @@ in stdenv.mkDerivation { NIX_CFLAGS_LINK="-L${libunwind}/lib -lunwind"; + buildInputs = [ coreutils ]; + postUnpack = '' unpackFile ${libcxx.src} export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" From e22889064f82be3a7f841b87e7af63dd489e79e4 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 22 Aug 2014 09:06:19 -0700 Subject: [PATCH 0044/3123] fix boost build with clang --- pkgs/development/libraries/boost/1.55.nix | 6 +- .../libraries/boost/boost-155-clang.patch | 90 +++++++++++++++++++ 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/boost/boost-155-clang.patch diff --git a/pkgs/development/libraries/boost/1.55.nix b/pkgs/development/libraries/boost/1.55.nix index 1e9d2134d12..cdbf98f4483 100644 --- a/pkgs/development/libraries/boost/1.55.nix +++ b/pkgs/development/libraries/boost/1.55.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames -, toolset ? null +, toolset ? if stdenv.isDarwin then "clang" else null , enableRelease ? true , enableDebug ? false , enableSingleThreaded ? false @@ -57,6 +57,8 @@ stdenv.mkDerivation { sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z"; }; + patches = stdenv.lib.optional (toolset == "clang") [ ./boost-155-clang.patch ]; + enableParallelBuilding = true; buildInputs = @@ -66,7 +68,7 @@ stdenv.mkDerivation { configureScript = "./bootstrap.sh"; configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python" + withToolset; - buildPhase = "${stdenv.lib.optionalString (toolset == "clang") "unset NIX_ENFORCE_PURITY; "}./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install${withToolset}"; + buildPhase = "${stdenv.lib.optionalString (toolset == "clang") "unset NIX_ENFORCE_PURITY; "}./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install"; # normal install does not install bjam, this is a separate step installPhase = '' diff --git a/pkgs/development/libraries/boost/boost-155-clang.patch b/pkgs/development/libraries/boost/boost-155-clang.patch new file mode 100644 index 00000000000..9c4e3a74cd2 --- /dev/null +++ b/pkgs/development/libraries/boost/boost-155-clang.patch @@ -0,0 +1,90 @@ +diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp +index 906c13e..dcb4d7d 100644 +--- a/boost/atomic/detail/cas128strong.hpp ++++ b/boost/atomic/detail/cas128strong.hpp +@@ -196,15 +196,17 @@ class base_atomic + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void + store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type value_s = 0; ++ storage_type value_s; ++ memset(&value_s, 0, sizeof(value_s)); + memcpy(&value_s, &value, sizeof(value_type)); + platform_fence_before_store(order); + platform_store128(value_s, &v_); +@@ -247,7 +249,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + +diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp +index a130590..4af99a1 100644 +--- a/boost/atomic/detail/gcc-atomic.hpp ++++ b/boost/atomic/detail/gcc-atomic.hpp +@@ -958,14 +958,16 @@ class base_atomic + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + } +@@ -980,7 +982,8 @@ class base_atomic + + value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + value_type res; +@@ -994,7 +997,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, +@@ -1010,7 +1015,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true, From 0577499d74dda2bb77ba3649681c10cadbfed5f2 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 22 Aug 2014 14:16:38 -0700 Subject: [PATCH 0045/3123] fix some packages on darwin --- pkgs/development/compilers/llvm/3.4/llvm.nix | 1 - pkgs/development/compilers/ocaml/4.01.0.nix | 2 ++ .../ocaml/fix-clang-build-on-osx.diff | 20 +++++++++++++++++++ .../tools/misc/sloccount/default.nix | 1 + pkgs/shells/fish/default.nix | 2 +- pkgs/tools/compression/bzip2/default.nix | 2 ++ pkgs/tools/networking/isync/default.nix | 2 +- pkgs/tools/typesetting/tex/tex4ht/default.nix | 2 +- .../tools/typesetting/tex/texlive/default.nix | 1 - 9 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/compilers/ocaml/fix-clang-build-on-osx.diff diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix index dfd7b5570ea..f7f794f4f87 100644 --- a/pkgs/development/compilers/llvm/3.4/llvm.nix +++ b/pkgs/development/compilers/llvm/3.4/llvm.nix @@ -65,6 +65,5 @@ in stdenv.mkDerivation rec { license = stdenv.lib.licenses.bsd3; maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ]; platforms = stdenv.lib.platforms.all; - # broken = stdenv.isDarwin; }; } diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix index 2876bce9caf..5e3cb61c339 100644 --- a/pkgs/development/compilers/ocaml/4.01.0.nix +++ b/pkgs/development/compilers/ocaml/4.01.0.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a"; }; + patches = [ ./fix-clang-build-on-osx.diff ]; + prefixKey = "-prefix "; configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib "-x11include" x11inc ]; diff --git a/pkgs/development/compilers/ocaml/fix-clang-build-on-osx.diff b/pkgs/development/compilers/ocaml/fix-clang-build-on-osx.diff new file mode 100644 index 00000000000..d7d9c863858 --- /dev/null +++ b/pkgs/development/compilers/ocaml/fix-clang-build-on-osx.diff @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index d45e88f..25d872b 100755 +--- a/configure ++++ b/configure +@@ -322,7 +322,14 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" + mathlib="";; + *,*-*-darwin*) +- bytecccompopts="-fno-defer-pop $gcc_warnings" ++ # On recent version of OSX, gcc is a symlink to clang ++ if $bytecc --version | grep -q clang; then ++ # -fno-defer-pop is not supported by clang, and make recent ++ # versions of clang to fail ++ bytecccompopts="$gcc_warnings" ++ else ++ bytecccompopts="-fno-defer-pop $gcc_warnings" ++ fi + mathlib="" + mkexe="$mkexe -Wl,-no_compact_unwind" + # Tell gcc that we can use 32-bit code addresses for threaded code diff --git a/pkgs/development/tools/misc/sloccount/default.nix b/pkgs/development/tools/misc/sloccount/default.nix index 1aa9a2c058d..fffb8074748 100644 --- a/pkgs/development/tools/misc/sloccount/default.nix +++ b/pkgs/development/tools/misc/sloccount/default.nix @@ -31,6 +31,7 @@ stdenv.mkDerivation rec { configurePhase = '' sed -i "makefile" -"es|PREFIX[[:blank:]]*=.*$|PREFIX = $out|g" + sed -i "makefile" -"es|gcc|$CC|g" ''; doCheck = true; diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index adfe44b3bac..03ecc290d14 100644 --- a/pkgs/shells/fish/default.nix +++ b/pkgs/shells/fish/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { description = "Smart and user-friendly command line shell"; homepage = "http://fishshell.com/"; license = licenses.gpl2; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ ocharles ]; }; } diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index 55fca6ca3cb..256f574c2e0 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation { sharedLibrary = !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; + patchPhase = stdenv.lib.optionalString stdenv.isDarwin "substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'"; + preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'"; makeFlags = if linkStatic then "LDFLAGS=-static" else ""; diff --git a/pkgs/tools/networking/isync/default.nix b/pkgs/tools/networking/isync/default.nix index 2d3ffb2cb0a..021f470af24 100644 --- a/pkgs/tools/networking/isync/default.nix +++ b/pkgs/tools/networking/isync/default.nix @@ -16,6 +16,6 @@ stdenv.mkDerivation rec { license = [ "GPLv2+" ]; maintainers = with stdenv.lib.maintainers; [ the-kenny viric ]; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; }; } diff --git a/pkgs/tools/typesetting/tex/tex4ht/default.nix b/pkgs/tools/typesetting/tex/tex4ht/default.nix index 69d02a275b3..93d33439084 100644 --- a/pkgs/tools/typesetting/tex/tex4ht/default.nix +++ b/pkgs/tools/typesetting/tex/tex4ht/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { cd src for f in tex4ht t4ht htcmd ; do # -DENVFILE="$out/share/texmf-nix/tex4ht/base/unix/tex4ht.env" - gcc -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea + $CC -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea done cd - ''; diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index beb6a7f3a68..384768666de 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -22,7 +22,6 @@ rec { setupHook = ./setup-hook.sh; doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin '' - export MACOSX_DEPLOYMENT_TARGET=10.9 export DYLD_LIBRARY_PATH="${poppler}/lib" '' + '' mkdir -p $out From 6f949b2e872c8ef3d8c53c083506187c56afc85e Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Fri, 22 Aug 2014 23:51:25 -0700 Subject: [PATCH 0046/3123] get rid of nasty CC stuff --- pkgs/development/interpreters/lua-5/5.1.nix | 2 +- pkgs/development/libraries/gmp/5.1.x.nix | 2 +- .../development/libraries/qt-4.x/4.8/default.nix | 2 -- pkgs/development/libraries/zlib/default.nix | 4 +--- pkgs/tools/misc/getopt/default.nix | 5 +++-- pkgs/tools/package-management/nix/default.nix | 16 +++++----------- pkgs/tools/system/tree/default.nix | 2 +- 7 files changed, 12 insertions(+), 21 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix index b2ccc7fd642..adeaa9fae7b 100644 --- a/pkgs/development/interpreters/lua-5/5.1.nix +++ b/pkgs/development/interpreters/lua-5/5.1.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { configurePhase = if stdenv.isDarwin then '' - makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC=clang ) + makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC="$CC" ) installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' ) '' else '' makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" ) diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index 5bee2fe4336..e9495b796dd 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (rec { ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]) ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" - ++ optional stdenv.isDarwin "ABI=64 CC=clang" + ++ optional stdenv.isDarwin "ABI=64" ++ optional stdenv.is64bit "--with-pic" ; 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 1679b4953e7..6c534f4220d 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -78,8 +78,6 @@ stdenv.mkDerivation rec { -translationdir $out/share/${name}/translations " '' + optionalString stdenv.isDarwin '' - export CXX=clang++ - export CC=clang sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf ''; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 1b46c959448..0938e2a17a7 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -15,9 +15,7 @@ stdenv.mkDerivation rec { configureFlags = if static then "" else "--shared"; - preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' - export CC=clang - '' + '' + preConfigure = '' if test -n "$crossConfig"; then export CC=$crossConfig-gcc configureFlags=${if static then "" else "--shared"} diff --git a/pkgs/tools/misc/getopt/default.nix b/pkgs/tools/misc/getopt/default.nix index 84d15a18747..14bdb7889c9 100644 --- a/pkgs/tools/misc/getopt/default.nix +++ b/pkgs/tools/misc/getopt/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation { url = http://tarballs.nixos.org/getopt-1.1.4.tar.gz; md5 = "02188ca68da27c4175d6e9f3da732101"; }; - - buildFlags = stdenv.lib.optional stdenv.isDarwin [ "CC=clang" ]; + preBuild = '' + export buildFlags=CC="$CC" # for darwin + ''; } diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index e64bc329393..e659a1f1b03 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -22,8 +22,6 @@ stdenv.mkDerivation rec { postUnpack = '' export CPATH="${bzip2}/include" export LIBRARY_PATH="${bzip2}/lib" - export CXX=/usr/bin/clang++ - export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" ''; configureFlags = @@ -34,7 +32,7 @@ stdenv.mkDerivation rec { --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} --disable-init-state --enable-gc - CFLAGS=-O3 + CFLAGS=-O3 CXXFLAGS=-O3 ''; makeFlags = "profiledir=$(out)/etc/profile.d"; @@ -68,14 +66,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; meta = { - description = "Powerful package manager that makes package management reliable and reproducible"; - longDescription = '' - Nix is a powerful package manager for Linux and other Unix systems that - makes package management reliable and reproducible. It provides atomic - upgrades and rollbacks, side-by-side installation of multiple versions of - a package, multi-user package management and easy setup of build - environments. - ''; + # due to builder args bug; see + # https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6 + broken = stdenv.isDarwin; + description = "The Nix Deployment System"; homepage = http://nixos.org/; license = stdenv.lib.licenses.lgpl2Plus; maintainers = [ stdenv.lib.maintainers.eelco ]; diff --git a/pkgs/tools/system/tree/default.nix b/pkgs/tools/system/tree/default.nix index 51de5998069..eca8882643d 100644 --- a/pkgs/tools/system/tree/default.nix +++ b/pkgs/tools/system/tree/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation { prefix=$out MANDIR=$out/share/man/man1 ${systemFlags} - CC=clang + CC="$CC" ) ''; From fa9b1f9cda5e44795d02df54defc6e8b9a0b2132 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Sat, 23 Aug 2014 18:26:55 -0700 Subject: [PATCH 0047/3123] build nix head successfully --- pkgs/development/compilers/llvm/3.3/clang.nix | 4 ---- pkgs/development/compilers/llvm/3.4/clang.nix | 4 ++++ pkgs/stdenv/darwin/default.nix | 6 ++++-- pkgs/stdenv/default.nix | 8 +++++++- pkgs/tools/package-management/nix/unstable.nix | 4 +--- pkgs/top-level/all-packages.nix | 7 ++----- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.3/clang.nix b/pkgs/development/compilers/llvm/3.3/clang.nix index 72287560b24..262e0bff248 100644 --- a/pkgs/development/compilers/llvm/3.3/clang.nix +++ b/pkgs/development/compilers/llvm/3.3/clang.nix @@ -1,9 +1,5 @@ { stdenv, fetchurl, perl, groff, llvm, cmake, libxml2, python }: -# be sure not to rebuild clang on darwin; some packages request it specifically -# we need to fix those -assert stdenv.isDarwin -> stdenv.gcc.nativeTools; - let version = "3.3"; gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc; diff --git a/pkgs/development/compilers/llvm/3.4/clang.nix b/pkgs/development/compilers/llvm/3.4/clang.nix index 6ec3f7bf44a..fc33a7809a6 100644 --- a/pkgs/development/compilers/llvm/3.4/clang.nix +++ b/pkgs/development/compilers/llvm/3.4/clang.nix @@ -1,5 +1,9 @@ { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }: +# be sure not to rebuild clang on darwin; some packages request it specifically +# we need to fix those +assert stdenv.isDarwin -> stdenv.gcc.nativeTools; + stdenv.mkDerivation { name = "clang-${version}"; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 28c863b63b0..f42cd7139d9 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -1,4 +1,6 @@ -{ stdenv, pkgs, config, haveLibCxx }: +{ stdenv, pkgs, config +, haveLibCxx ? true +, useClang33 ? false }: import ../generic rec { inherit config; @@ -33,7 +35,7 @@ import ../generic rec { }; } else null; binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; - clang = pkgs.clang_34; + clang = if useClang33 then pkgs.clang_33 else pkgs.clang; coreutils = pkgs.coreutils; shell = pkgs.bash + "/bin/sh"; }; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 665cefbfc43..674f5585c0b 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -37,7 +37,6 @@ rec { inherit config; stdenv = stdenvNative; pkgs = stdenvNativePkgs; - haveLibCxx = true; }; stdenvDarwinNaked = import ./darwin { @@ -47,6 +46,13 @@ rec { haveLibCxx = false; }; + stdenvDarwin33 = import ./darwin { + inherit config; + stdenv = stdenvNative; + pkgs = stdenvNativePkgs; + useClang33 = true; + }; + # Linux standard environment. stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux; diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix index d5aebe45dd6..514924325e4 100644 --- a/pkgs/tools/package-management/nix/unstable.nix +++ b/pkgs/tools/package-management/nix/unstable.nix @@ -24,6 +24,7 @@ stdenv.mkDerivation rec { postUnpack = '' export CPATH="${bzip2}/include" export LIBRARY_PATH="${bzip2}/lib" + export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" ''; configureFlags = @@ -68,9 +69,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; meta = { - # due to builder args bug; see - # https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6 - broken = stdenv.isDarwin; description = "The Nix Deployment System"; homepage = http://nixos.org/; license = stdenv.lib.licenses.lgpl2Plus; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 49b1cd9b180..22d35e03d59 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3209,11 +3209,7 @@ let llvm_v = path: callPackage path { }; - llvmPackages = if !stdenv.isDarwin then llvmPackages_34 else llvmPackages_34 // { - # until someone solves build problems with _34 - llvm = llvm_33; - clang = clang_33; - }; + llvmPackages = llvmPackages_34; llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 { inherit stdenv newScope fetchurl; @@ -11455,6 +11451,7 @@ let }; nixUnstable = callPackage ../tools/package-management/nix/unstable.nix { + stdenv = if stdenv.isDarwin then allStdenvs.stdenvDarwin33 else stdenv; storeDir = config.nix.storeDir or "/nix/store"; stateDir = config.nix.stateDir or "/nix/var"; }; From afa1db198bc88abea65d61ef6761866ed490ba6b Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Sat, 23 Aug 2014 23:15:23 -0700 Subject: [PATCH 0048/3123] fix even more clang builds --- pkgs/development/libraries/libdevil/default.nix | 9 +++++++++ pkgs/servers/x11/xorg/overrides.nix | 5 ++++- pkgs/stdenv/adapters.nix | 5 +++++ pkgs/top-level/all-packages.nix | 8 ++++---- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libdevil/default.nix b/pkgs/development/libraries/libdevil/default.nix index d3053b4d2a5..6cbbddfdba8 100644 --- a/pkgs/development/libraries/libdevil/default.nix +++ b/pkgs/development/libraries/libdevil/default.nix @@ -16,6 +16,15 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-ILU" "--enable-ILUT" ]; + preConfigure = '' + sed -i 's, -std=gnu99,,g' configure + sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c + ''; + + postConfigure = '' + sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h + ''; + patches = [ ( fetchurl { url = http://patch-tracker.debian.org/patch/series/dl/devil/1.7.8-6.1/03_CVE-2009-3994.diff; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 7073adb85dd..4811659ac41 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -102,8 +102,11 @@ in # Note: most of these are in Requires.private, so maybe builder.sh # should propagate them automatically. libXt = attrs: attrs // { - preConfigure = setMalloc0ReturnsNullCrossCompiling; + preConfigure = setMalloc0ReturnsNullCrossCompiling + '' + sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure + ''; propagatedBuildInputs = [ xorg.libSM ]; + CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; }; # See https://bugs.freedesktop.org/show_bug.cgi?id=47792 diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 09c92b552d4..c57f1d00f0a 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -299,4 +299,9 @@ rec { ''; # */ in overrideGCC stdenv (stdenv.gcc.override { binutils = binutils'; }); + dropCxx = drv: drv.override { + stdenv = if pkgs.stdenv.isDarwin + then pkgs.allStdenvs.stdenvDarwinNaked + else pkgs.stdenv; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 22d35e03d59..623d464d30e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4574,7 +4574,7 @@ let coredumper = callPackage ../development/libraries/coredumper { }; - ctl = callPackage ../development/libraries/ctl { }; + ctl = dropCxx (callPackage ../development/libraries/ctl { }); cpp-netlib = callPackage ../development/libraries/cpp-netlib { }; @@ -5079,7 +5079,7 @@ let ilixi = callPackage ../development/libraries/ilixi { }; - ilmbase = callPackage ../development/libraries/ilmbase { }; + ilmbase = dropCxx (callPackage ../development/libraries/ilmbase { }); imlib = callPackage ../development/libraries/imlib { libpng = libpng12; @@ -5253,7 +5253,7 @@ let libdc1394avt = callPackage ../development/libraries/libdc1394avt { }; - libdevil = callPackage ../development/libraries/libdevil { }; + libdevil = dropCxx (callPackage ../development/libraries/libdevil { }); libdiscid = callPackage ../development/libraries/libdiscid { }; @@ -5994,7 +5994,7 @@ let # this ctl version is needed by openexr_viewers openexr_ctl = callPackage ../development/libraries/openexr_ctl { }; - openexr = callPackage ../development/libraries/openexr { }; + openexr = dropCxx (callPackage ../development/libraries/openexr { }); openldap = callPackage ../development/libraries/openldap { stdenv = if stdenv.isDarwin From 25b395bc8d8b1590723dc42edd97561611f8db68 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Wed, 3 Sep 2014 18:46:47 -0700 Subject: [PATCH 0049/3123] stop copying everything into the store --- pkgs/development/libraries/libunwind/native.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkgs/development/libraries/libunwind/native.nix b/pkgs/development/libraries/libunwind/native.nix index 10e552a2810..3220d20495e 100644 --- a/pkgs/development/libraries/libunwind/native.nix +++ b/pkgs/development/libraries/libunwind/native.nix @@ -6,19 +6,9 @@ stdenv.mkDerivation { unpackPhase = ":"; dontBuild = true; - # TODO: figure out if these are different in Mavericks + older installPhase = '' mkdir -p $out/lib cat ${/usr/lib/system/libunwind.dylib} > $out/lib/libunwind.dylib - /usr/bin/install_name_tool \ - -change /usr/lib/system/libunwind.dylib ${/usr/lib/system/libunwind.dylib} \ - -change /usr/lib/system/libsystem_malloc.dylib ${/usr/lib/system/libsystem_malloc.dylib} \ - -change /usr/lib/system/libsystem_pthread.dylib ${/usr/lib/system/libsystem_pthread.dylib} \ - -change /usr/lib/system/libsystem_platform.dylib ${/usr/lib/system/libsystem_platform.dylib} \ - -change /usr/lib/system/libsystem_c.dylib ${/usr/lib/system/libsystem_c.dylib} \ - -change /usr/lib/system/libdyld.dylib ${/usr/lib/system/libdyld.dylib} \ - -change /usr/lib/system/libkeymgr.dylib ${/usr/lib/system/libkeymgr.dylib} \ - $out/lib/libunwind.dylib ''; meta.platforms = stdenv.lib.platforms.darwin; From f2c5125e82f4c732d20ae245a9f535c554974903 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 11 Sep 2014 00:24:03 +0200 Subject: [PATCH 0050/3123] Fix testability of pkgs/stdenv/linux/default.nix The point here is that it's always possible to debug this staging logic by using `nix-repl pkgs/stdenv/linux'. The modular-stdenv change introduced the lib dependency, which we now default to ../../../lib. No derivation or out hashes of stdenvLinux is changed by this commit. --- pkgs/stdenv/linux/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 6b15808285b..e9de4abd7fa 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -7,7 +7,7 @@ # The function defaults are for easy testing. { system ? builtins.currentSystem , allPackages ? import ../../top-level/all-packages.nix -, platform ? null, config ? {}, lib }: +, platform ? null, config ? {}, lib ? (import ../../../lib) }: rec { From 18592c78fc21bddcb2a82e0a70de843d8ada9f1a Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 11 Sep 2014 00:38:12 +0200 Subject: [PATCH 0051/3123] Cosmetic fix in pkgs/stdenv/linux/default.nix Keep the rule that every stage only refers to the previous stage for clarity. This commit doesn't change derivation or output hashes. --- pkgs/stdenv/linux/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index e9de4abd7fa..8caadec3891 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -192,7 +192,7 @@ rec { name = "bootstrap-gcc-wrapper"; }; overrides = pkgs: { - inherit (stage2.pkgs) binutils glibc perl; + inherit (stage2.pkgs) binutils glibc perl patchelf; # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it # reduces the size of the stdenv closure. @@ -220,7 +220,7 @@ rec { coreutils = bootstrapTools; name = ""; }; - extraPath = [ stage2.pkgs.patchelf stage3.pkgs.xz ]; + extraPath = [ stage3.pkgs.patchelf stage3.pkgs.xz ]; overrides = pkgs: { inherit (stage3.pkgs) gettext gnum4 gmp perl glibc; }; From dd673de2a720d976edc0619e43c61f75c234de7a Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Tue, 1 Oct 2013 13:10:40 +0200 Subject: [PATCH 0052/3123] glibc: make compilation more pure Remove datetime from nscd. --- pkgs/development/libraries/glibc/2.19/common.nix | 8 ++++++++ .../glibc-remove-date-from-compilation-banner.patch | 12 ++++++++++++ .../glibc/2.19/glibc-remove-datetime-from-nscd.patch | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch create mode 100644 pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch diff --git a/pkgs/development/libraries/glibc/2.19/common.nix b/pkgs/development/libraries/glibc/2.19/common.nix index a828148c3d5..09f07d4e67b 100644 --- a/pkgs/development/libraries/glibc/2.19/common.nix +++ b/pkgs/development/libraries/glibc/2.19/common.nix @@ -61,6 +61,14 @@ stdenv.mkDerivation ({ ./cve-2014-0475.patch ./cve-2014-5119.patch + + /* Remove references to the compilation date. */ + ./glibc-remove-date-from-compilation-banner.patch + + /* Remove the date and time from nscd. It is used as a protocol + compatibility check, but we assume nix takes care of that for + us. */ + ./glibc-remove-datetime-from-nscd.patch ]; postPatch = '' diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch b/pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch new file mode 100644 index 00000000000..5d0b1a51762 --- /dev/null +++ b/pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch @@ -0,0 +1,12 @@ +diff -ur glibc-2.17.orig/csu/Makefile glibc-2.17/csu/Makefile +--- glibc-2.17.orig/csu/Makefile 2012-12-25 04:02:13.000000000 +0100 ++++ glibc-2.17/csu/Makefile 2013-08-19 16:01:57.132378550 +0200 +@@ -172,7 +172,7 @@ + os=Linux; \ + fi; \ + printf '"Compiled on a %s %s system on %s.\\n"\n' \ +- "$$os" "$$version" "`date +%Y-%m-%d`";; \ ++ "$$os" "$$version";; \ + *) ;; \ + esac; \ + files="$(all-Banner-files)"; \ diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch new file mode 100644 index 00000000000..83b61799c4c --- /dev/null +++ b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch @@ -0,0 +1,11 @@ +--- a/nscd/nscd_stat.c 2014-04-08 20:35:24.253715420 +0200 ++++ b/nscd/nscd_stat.c 2014-04-08 20:38:32.526634400 +0200 +@@ -37,7 +37,7 @@ + + + /* We use this to make sure the receiver is the same. */ +-static const char compilation[21] = __DATE__ " " __TIME__; ++static const char compilation[21] = "Thu 1 1970 00:00:01"; /* __DATE__ " " __TIME__; */ + + /* Statistic data for one database. */ + struct dbstat From e316672dcb9b5adf57f2e3317d4db4ae9466a0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 13 Sep 2014 14:06:27 +0200 Subject: [PATCH 0053/3123] glibc: put back the nscd check, by $out instead of date I don't know why they feel they need to check the compatibility by build date, so I would keep check against $out, which is a better nix equivalent. Also, expression refactoring (put comments out of hash-changing bash). --- .../libraries/glibc/2.19/common.nix | 23 +++++++++++-------- .../glibc-remove-datetime-from-nscd.patch | 6 ++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/glibc/2.19/common.nix b/pkgs/development/libraries/glibc/2.19/common.nix index 09f07d4e67b..23efc01a397 100644 --- a/pkgs/development/libraries/glibc/2.19/common.nix +++ b/pkgs/development/libraries/glibc/2.19/common.nix @@ -64,22 +64,25 @@ stdenv.mkDerivation ({ /* Remove references to the compilation date. */ ./glibc-remove-date-from-compilation-banner.patch - - /* Remove the date and time from nscd. It is used as a protocol - compatibility check, but we assume nix takes care of that for - us. */ - ./glibc-remove-datetime-from-nscd.patch ]; - postPatch = '' + postPatch = # Needed for glibc to build with the gnumake 3.82 # http://comments.gmane.org/gmane.linux.lfs.support/31227 - sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile - + '' + sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile + '' # nscd needs libgcc, and we don't want it dynamically linked # because we don't want it to depend on bootstrap-tools libs. - echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile - ''; + + '' + echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile + '' + # Replace the date and time in nscd by $out. + # It is used as a protocol compatibility check. + + '' + cat ${./glibc-remove-datetime-from-nscd.patch} \ + | sed "s,@out@,$out," | patch -p1 + ''; configureFlags = [ "-C" diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch index 83b61799c4c..0a5456ea5c4 100644 --- a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch +++ b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch @@ -1,11 +1,11 @@ ---- a/nscd/nscd_stat.c 2014-04-08 20:35:24.253715420 +0200 -+++ b/nscd/nscd_stat.c 2014-04-08 20:38:32.526634400 +0200 +--- a/nscd/nscd_stat.c ++++ b/nscd/nscd_stat.c @@ -37,7 +37,7 @@ /* We use this to make sure the receiver is the same. */ -static const char compilation[21] = __DATE__ " " __TIME__; -+static const char compilation[21] = "Thu 1 1970 00:00:01"; /* __DATE__ " " __TIME__; */ ++static const char compilation[21] = "@out@"; /* Statistic data for one database. */ struct dbstat From 3196d4f7c7900e188e4c956c5fbf23e75d140313 Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Mon, 7 Apr 2014 08:04:26 +0200 Subject: [PATCH 0054/3123] perl-5.16: make it binary deterministic --- .../interpreters/perl/5.16/default.nix | 29 +++++++++++++++++++ .../perl/5.16/fixed-man-page-date.patch | 11 +++++++ .../perl/5.16/no-date-in-perl-binary.patch | 11 +++++++ .../perl/5.16/no-impure-config-time.patch | 11 +++++++ 4 files changed, 62 insertions(+) create mode 100644 pkgs/development/interpreters/perl/5.16/fixed-man-page-date.patch create mode 100644 pkgs/development/interpreters/perl/5.16/no-date-in-perl-binary.patch create mode 100644 pkgs/development/interpreters/perl/5.16/no-impure-config-time.patch diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index c1a5374c92e..087411c02ea 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -21,6 +21,9 @@ stdenv.mkDerivation rec { patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch + ./no-impure-config-time.patch + ./fixed-man-page-date.patch + ./no-date-in-perl-binary.patch ] ++ optional stdenv.isSunOS ./ld-shared.patch ++ stdenv.lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ; @@ -70,5 +73,31 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; + doCheck = !stdenv.isDarwin; + + # some network-related tests don't work, mostly probably due to our sandboxing + # man-heading.t is skipped due to output determinism (no dates) + testsToSkip = '' + lib/Net/hostent.t \ + dist/IO/t/{io_multihomed.t,io_sock.t} \ + dist/Net-Ping/t/*.t \ + cpan/autodie/t/truncate.t \ + t/porting/{maintainers.t,regen.t} \ + cpan/Socket/t/get{name,addr}info.t \ + cpan/podlators/t/man-heading.t \ + '' + optionalString stdenv.isFreeBSD '' + cpan/CPANPLUS/t/04_CPANPLUS-Module.t \ + cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t \ + '' + " "; + + postPatch = optionalString (!stdenv.isDarwin) /* this failed on Darwin, no idea why */ '' + for test in ${testsToSkip}; do + echo "Removing test" $test + rm "$test" + pat=`echo "$test" | sed 's,/,\\\\/,g'` # just escape slashes + sed "/^$pat/d" -i MANIFEST + done + ''; + passthru.libPrefix = "lib/perl5/site_perl"; } diff --git a/pkgs/development/interpreters/perl/5.16/fixed-man-page-date.patch b/pkgs/development/interpreters/perl/5.16/fixed-man-page-date.patch new file mode 100644 index 00000000000..79f9bc3658e --- /dev/null +++ b/pkgs/development/interpreters/perl/5.16/fixed-man-page-date.patch @@ -0,0 +1,11 @@ +--- a/cpan/podlators/lib/Pod/Man.pm 2014-04-07 06:25:23.730505243 +0200 ++++ b/cpan/podlators/lib/Pod/Man.pm 2014-04-07 06:26:40.816552603 +0200 +@@ -768,7 +768,7 @@ + } else { + ($name, $section) = $self->devise_title; + } +- my $date = $$self{date} || $self->devise_date; ++ my $date = "1970-01-01"; # Fixed date for NixOS, orig: $$self{date} || $self->devise_date; + $self->preamble ($name, $section, $date) + unless $self->bare_output or DEBUG > 9; + diff --git a/pkgs/development/interpreters/perl/5.16/no-date-in-perl-binary.patch b/pkgs/development/interpreters/perl/5.16/no-date-in-perl-binary.patch new file mode 100644 index 00000000000..00ea47ae45f --- /dev/null +++ b/pkgs/development/interpreters/perl/5.16/no-date-in-perl-binary.patch @@ -0,0 +1,11 @@ +--- a/perl.c 2014-04-07 07:58:01.402831615 +0200 ++++ b/perl.c 2014-04-07 07:59:38.556945298 +0200 +@@ -1754,7 +1754,7 @@ + PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options, + sizeof(non_bincompat_options) - 1, SVs_TEMP)); + +-#ifdef __DATE__ ++#if 0 + # ifdef __TIME__ + PUSHs(Perl_newSVpvn_flags(aTHX_ + STR_WITH_LEN("Compiled at " __DATE__ " " __TIME__), diff --git a/pkgs/development/interpreters/perl/5.16/no-impure-config-time.patch b/pkgs/development/interpreters/perl/5.16/no-impure-config-time.patch new file mode 100644 index 00000000000..2bf1841e9dd --- /dev/null +++ b/pkgs/development/interpreters/perl/5.16/no-impure-config-time.patch @@ -0,0 +1,11 @@ +--- a/Configure 2014-04-05 20:21:33.714635700 +0200 ++++ b/Configure 2014-04-05 20:23:23.377441026 +0200 +@@ -3609,6 +3609,8 @@ + + : who configured the system + cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` ++cf_time='Thu Jan 1 00:00:00 UTC 1970' ++ + case "$cf_by" in + "") + cf_by=`(logname) 2>/dev/null` From 3bf436238189e8acf6044dd16e1cf705cffe30ee Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Wed, 9 Apr 2014 01:04:50 +0200 Subject: [PATCH 0055/3123] python: improve library determinism 1) Make the core python libraries deterministic. 2) Make the python libraries created by glib deterministic. @vcunat put back the removal of share/gtk-doc in glib. --- pkgs/development/interpreters/python/2.7/default.nix | 1 + pkgs/development/libraries/glib/default.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index c19430862c2..05fb8134f85 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -72,6 +72,7 @@ let ''; NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; + DETERMINISTIC_BUILD = 1; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 839ba7cfa95..0e41082bcbf 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -77,6 +77,7 @@ stdenv.mkDerivation rec { ''; enableParallelBuilding = true; + DETERMINISTIC_BUILD = 1; inherit doCheck; preCheck = optionalString doCheck From bee22ab79e4853e65b819ec2f0f966b01c1359e1 Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Wed, 9 Apr 2014 01:15:38 +0200 Subject: [PATCH 0056/3123] libgcrypt, libgpg-error, busybox: improve determinism --- pkgs/development/libraries/libgcrypt/default.nix | 2 ++ .../libraries/libgcrypt/no-build-timestamp.patch | 12 ++++++++++++ pkgs/development/libraries/libgpg-error/default.nix | 2 ++ .../libraries/libgpg-error/no-build-timestamp.patch | 11 +++++++++++ pkgs/os-specific/linux/busybox/default.nix | 1 + 5 files changed, 28 insertions(+) create mode 100644 pkgs/development/libraries/libgcrypt/no-build-timestamp.patch create mode 100644 pkgs/development/libraries/libgpg-error/no-build-timestamp.patch diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix index ed267e23c87..b47709940dd 100644 --- a/pkgs/development/libraries/libgcrypt/default.nix +++ b/pkgs/development/libraries/libgcrypt/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation (rec { make check ''; + patches = [ ./no-build-timestamp.patch ]; + meta = { description = "General-pupose cryptographic library"; diff --git a/pkgs/development/libraries/libgcrypt/no-build-timestamp.patch b/pkgs/development/libraries/libgcrypt/no-build-timestamp.patch new file mode 100644 index 00000000000..6ae708f059d --- /dev/null +++ b/pkgs/development/libraries/libgcrypt/no-build-timestamp.patch @@ -0,0 +1,12 @@ +diff -ur libgcrypt-1.5.3.orig/configure libgcrypt-1.5.3/configure +--- libgcrypt-1.5.3.orig/configure 2013-07-25 11:22:47.000000000 +0200 ++++ libgcrypt-1.5.3/configure 2014-04-09 00:17:58.659147199 +0200 +@@ -16520,6 +16520,7 @@ + + + BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` ++BUILD_TIMESTAMP=1970-01-01T00:00+0000 + + + cat >>confdefs.h <<_ACEOF +Only in libgcrypt-1.5.3: out diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix index 663bd944fb9..03662571ade 100644 --- a/pkgs/development/libraries/libgpg-error/default.nix +++ b/pkgs/development/libraries/libgpg-error/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation (rec { doCheck = true; + patches = [ ./no-build-timestamp.patch ]; + meta = { description = "Libgpg-error, a small library that defines common error values for all GnuPG components"; diff --git a/pkgs/development/libraries/libgpg-error/no-build-timestamp.patch b/pkgs/development/libraries/libgpg-error/no-build-timestamp.patch new file mode 100644 index 00000000000..c8350a278ec --- /dev/null +++ b/pkgs/development/libraries/libgpg-error/no-build-timestamp.patch @@ -0,0 +1,11 @@ +diff -ur libgpg-error-1.12.orig/configure libgpg-error-1.12/configure +--- libgpg-error-1.12.orig/configure 2013-06-24 06:42:28.000000000 +0200 ++++ libgpg-error-1.12/configure 2014-04-09 00:12:47.867856520 +0200 +@@ -14585,6 +14585,7 @@ + + + BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` ++BUILD_TIMESTAMP=1970-01-01T00:00+0000 + + + cat >>confdefs.h <<_ACEOF diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 98fedb2d3f4..34eb19380d4 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -49,6 +49,7 @@ stdenv.mkDerivation rec { }; configurePhase = '' + export KCONFIG_NOTIMESTAMP=1 make defconfig ${configParser} cat << EOF | parseconfig From e431a3e0b592b772c81cde81be09d47b1c9b4622 Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Wed, 9 Apr 2014 15:05:48 +0200 Subject: [PATCH 0057/3123] openssl: make it deterministic --- pkgs/development/libraries/openssl/default.nix | 2 ++ .../libraries/openssl/no-date-in-library.patch | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 pkgs/development/libraries/openssl/no-date-in-library.patch diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index c972635c9c7..396eaa88fbf 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -19,6 +19,8 @@ let # cannot be overriden per-process. For security, the # environment variable is ignored for setuid binaries. ./cert-file.patch + # Remove the compilation time from the library + ./no-date-in-library.patch ] ++ stdenv.lib.optionals (isCross && opensslCrossSystem == "hurd-x86") diff --git a/pkgs/development/libraries/openssl/no-date-in-library.patch b/pkgs/development/libraries/openssl/no-date-in-library.patch new file mode 100644 index 00000000000..3eb501dfa02 --- /dev/null +++ b/pkgs/development/libraries/openssl/no-date-in-library.patch @@ -0,0 +1,12 @@ +diff -ur openssl-1.0.1f.orig/crypto/Makefile openssl-1.0.1f/crypto/Makefile +--- openssl-1.0.1f.orig/crypto/Makefile 2014-01-06 15:35:56.000000000 +0100 ++++ openssl-1.0.1f/crypto/Makefile 2014-04-09 13:05:28.071346204 +0200 +@@ -57,7 +57,7 @@ + echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \ + echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \ + echo ' #define PLATFORM "$(PLATFORM)"'; \ +- echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \ ++ echo " #define DATE \"Thu Jan 1 00:00:01 UTC 1970\""; \ + echo '#endif' ) >buildinf.h + + x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl From 7141303c998942f04dec761555c5944f309658d2 Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Wed, 9 Apr 2014 15:09:06 +0200 Subject: [PATCH 0058/3123] groff, opensp: make deterministic --- pkgs/tools/text/groff/default.nix | 8 ++++++++ pkgs/tools/text/sgml/opensp/default.nix | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 97cc3c61173..cd1d719bdaf 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -28,6 +28,14 @@ stdenv.mkDerivation rec { ''; }; + postInstall = '' + # Remove example output with (random?) colors to + # avoid non-determinism in the output + rm $out/share/doc/${name}/examples/hdtbl/*color*ps + # Remove creation date + find $out/share/doc/${name} -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' + ''; + meta = { homepage = "http://www.gnu.org/software/groff/"; description = "GNU Troff, a typesetting package that reads plain text and produces formatted output"; diff --git a/pkgs/tools/text/sgml/opensp/default.nix b/pkgs/tools/text/sgml/opensp/default.nix index 59b9b7bc13d..23ce8ccc5a8 100644 --- a/pkgs/tools/text/sgml/opensp/default.nix +++ b/pkgs/tools/text/sgml/opensp/default.nix @@ -13,8 +13,16 @@ stdenv.mkDerivation { docsrc/*.xml ''; + setupHook = ./setup-hook.sh; + postFixup = '' + # Remove random ids in the release notes + sed -i -e 's/href="#idm.*"//g' $out/share/doc/OpenSP/releasenotes.html + sed -i -e 's/name="idm.*"//g' $out/share/doc/OpenSP/releasenotes.html + ''; + + buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ]; meta = { From aa119e1106fa5cf67f1d34e1361e6b9e83f269a1 Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Wed, 9 Apr 2014 17:12:33 +0200 Subject: [PATCH 0059/3123] gcc-wrapper: make __DATE__/__TIME__ deterministic ...when NIX_ENFORCE_PURITY=1. @vcunat corrected the date according to docs. https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html In order to handle the spaces well, the extraAfter array had to be quoted more properly and appended by +=. --- pkgs/build-support/gcc-wrapper/gcc-wrapper.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh index 2ad7783a442..d6e91ebc666 100644 --- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh @@ -84,11 +84,20 @@ fi extraAfter=($NIX_CFLAGS_COMPILE) extraBefore=() +# When enforcing purity, pretend gcc can't find the current date and +# time +if test "$NIX_ENFORCE_PURITY" = "1"; then + extraAfter+=('-D__DATE__=??? ?? ????' + '-D__TIME__=??:??:??' + -Wno-builtin-macro-redefined) +fi + + if test "$dontLink" != "1"; then # Add the flags that should only be passed to the compiler when # linking. - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK) + extraAfter+=($NIX_CFLAGS_LINK) # Add the flags that should be passed to the linker (and prevent # `ld-wrapper' from adding NIX_LDFLAGS again). @@ -97,9 +106,9 @@ if test "$dontLink" != "1"; then done for i in $NIX_LDFLAGS; do if test "${i:0:3}" = "-L/"; then - extraAfter=(${extraAfter[@]} "$i") + extraAfter+=("$i") else - extraAfter=(${extraAfter[@]} "-Wl,$i") + extraAfter+=("-Wl,$i") fi done export NIX_LDFLAGS_SET=1 @@ -139,9 +148,9 @@ fi # `-B' flags, since they confuse some programs. Deep bash magic to # apply grep to stderr (by swapping stdin/stderr twice). if test -z "$NIX_GCC_NEEDS_GREP"; then - @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} + @gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" else - (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ + (@gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" 3>&2 2>&1 1>&3- \ | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- exit $? fi From 23697f2db2bb673147ecdeb109f986c0bea3e230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 24 Aug 2014 15:12:42 +0200 Subject: [PATCH 0060/3123] poppler: maintenance update --- pkgs/development/libraries/poppler/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index 083c9bae6b5..b8af18f8dd6 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -4,8 +4,8 @@ }: let - version = "0.26.3"; # even major numbers are stable - sha256 = "1ca2lrwvhxzq0g4blbvq099vyydfjyz839jki301p1jgazrimjw8"; + version = "0.26.4"; # even major numbers are stable + sha256 = "0raw35nkd6mkp0pk1gdr385nvrhsxvflcf3glln1srfnb8m51pky"; qtcairo_patches = let qtcairo = fetchgit { # the version for poppler-0.24 From ead6603b6037a8ea6d6898241c7ae50888288bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 13 Sep 2014 21:05:16 +0200 Subject: [PATCH 0061/3123] libav: update all branches, probably with security fixes --- pkgs/development/libraries/libav/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index 264868e4a97..ce0b0d5d755 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -26,17 +26,17 @@ with { inherit (stdenv.lib) optional optionals; }; let result = { - libav_0_8 = libavFun "0.8.13" "1fr3rzykrlm1cla0csm9hqa3gcqp19hf5rgn70nyb9w92r67v685"; - libav_9 = libavFun "9.16" "18378gdgzqsxaacc9vl7ligwndbdvy95wbn50hs8xvdqn1rn916a"; - libav_10 = libavFun "10.4" "1zzvjfdlv9swhq7dzvli1pk8cn02q1076ax9m3cx9ipilbg21639"; + libav_0_8 = libavFun "0.8.16" "df88b8f7d04d47edea8b19d80814227f0c058e57"; + libav_9 = libavFun "9.17" "5899d51947b62f6b0cf9795ec2330d5ed59a3273"; + libav_10 = libavFun "10.5" "925a45d2700a436c28e0b663510fc8df5bb7e861"; }; - libavFun = version : sha256 : stdenv.mkDerivation rec { + libavFun = version : sha1 : stdenv.mkDerivation rec { name = "libav-${version}"; src = fetchurl { url = "${meta.homepage}/releases/${name}.tar.xz"; - inherit sha256; + inherit sha1; # upstream directly provides sha1 of releases over https }; configureFlags = assert stdenv.lib.all (x: x!=null) buildInputs; From e90e423a26937d150f44c1a8ae1e54d70ad27923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 13 Sep 2014 21:06:49 +0200 Subject: [PATCH 0062/3123] mesa: maintenance update --- pkgs/development/libraries/mesa/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 54fd8d3810e..5cc5fadc70b 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -24,7 +24,7 @@ else */ let - version = "10.2.6"; + version = "10.2.7"; # this is the default search path for DRI drivers driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32"; in @@ -35,7 +35,7 @@ stdenv.mkDerivation { src = fetchurl { url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2"; - sha256 = "01n8ib190s12m8hiiyi4wfm9jhkbqjd769npjwvf965smp918cqr"; + sha256 = "27b958063a4c002071f14ed45c7d2a1ee52cd85e4ac8876e8a1c273495a7d43f"; }; prePatch = "patchShebangs ."; From 6a63d1e1e107c0a7c8fe77cdc2bf62155ca88d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 13 Sep 2014 21:43:12 +0200 Subject: [PATCH 0063/3123] libav: replace default 10 branch by the new 11 Upstream claims the upgrade is API-compatible. That is why I decided to drop the 10 branch completely. --- pkgs/development/libraries/libav/default.nix | 2 +- pkgs/top-level/all-packages.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index ce0b0d5d755..1313bc3feeb 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -28,7 +28,7 @@ let result = { libav_0_8 = libavFun "0.8.16" "df88b8f7d04d47edea8b19d80814227f0c058e57"; libav_9 = libavFun "9.17" "5899d51947b62f6b0cf9795ec2330d5ed59a3273"; - libav_10 = libavFun "10.5" "925a45d2700a436c28e0b663510fc8df5bb7e861"; + libav_11 = libavFun "11" "21f3c7c2154c0ad703872f2faa65ef20d6b7a14f"; }; libavFun = version : sha1 : stdenv.mkDerivation rec { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47953749272..be4cf627dbc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4894,7 +4894,7 @@ let gperftools = callPackage ../development/libraries/gperftools { }; gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer { - callPackage = pkgs.newScope (pkgs // { libav = pkgs.libav_10; }); + callPackage = pkgs.newScope (pkgs // { inherit (pkgs) libav; }); }); gst_all = { @@ -5194,9 +5194,9 @@ let libatomic_ops = callPackage ../development/libraries/libatomic_ops {}; - libav = libav_10; + libav = libav_11; # branch 11 is API-compatible with branch 10 libav_all = callPackage ../development/libraries/libav { }; - inherit (libav_all) libav_0_8 libav_9 libav_10; + inherit (libav_all) libav_0_8 libav_9 libav_11; libavc1394 = callPackage ../development/libraries/libavc1394 { }; From d957b4bd78335b845eb5d405be40fa36951b5bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 13 Sep 2014 21:44:45 +0200 Subject: [PATCH 0064/3123] Merge recent master into staging Hydra nixpkgs: ?compare=1151601 --- doc/language-support.xml | 11 + lib/licenses.nix | 5 + lib/maintainers.nix | 2 + nixos/doc/manual/default.nix | 4 +- nixos/lib/test-driver/log2html.xsl | 4 +- nixos/lib/testing.nix | 2 + nixos/modules/config/users-groups.nix | 2 +- .../modules/installer/tools/nixos-rebuild.sh | 8 +- nixos/modules/module-list.nix | 2 + nixos/modules/programs/ssh.nix | 9 +- .../modules/services/computing/torque/mom.nix | 63 + .../services/computing/torque/server.nix | 96 + .../jenkins/default.nix | 29 +- .../continuous-integration/jenkins/slave.nix | 6 +- nixos/modules/services/monitoring/statsd.nix | 32 +- .../modules/services/networking/ssh/sshd.nix | 8 +- nixos/modules/services/web-servers/tomcat.nix | 11 +- nixos/modules/virtualisation/containers.nix | 6 - .../modules/virtualisation/nixos-container.pl | 23 +- nixos/tests/containers.nix | 30 + pkgs/applications/audio/musescore/default.nix | 33 + pkgs/applications/editors/idea/default.nix | 4 +- .../graphics/panotools/default.nix | 4 +- pkgs/applications/misc/calibre/default.nix | 4 +- pkgs/applications/misc/fme/default.nix | 11 +- pkgs/applications/misc/galculator/default.nix | 10 +- pkgs/applications/misc/lilyterm/default.nix | 10 +- pkgs/applications/misc/spacefm/default.nix | 4 +- pkgs/applications/misc/tilda/default.nix | 3 +- pkgs/applications/misc/vym/default.nix | 8 +- pkgs/applications/misc/xiphos/default.nix | 18 +- .../networking/browsers/dillo/default.nix | 12 +- .../instant-messengers/ekiga/default.nix | 6 +- .../networking/linssid/default.nix | 34 + .../mailreaders/mailpile/default.nix | 2 +- pkgs/applications/science/logic/coq/HEAD.nix | 6 +- pkgs/applications/science/math/R/default.nix | 4 +- .../version-management/meld/default.nix | 2 +- .../version-management/smartgithg/default.nix | 59 + pkgs/applications/video/aegisub/default.nix | 4 +- pkgs/applications/video/mpv/default.nix | 17 +- pkgs/applications/video/wxcam/default.nix | 11 +- .../virtualization/8086tiny/default.nix | 3 +- .../virtualization/bochs/default.nix | 17 +- .../window-managers/fluxbox/default.nix | 19 +- .../window-managers/jwm/default.nix | 2 +- .../build-fhs-chrootenv/destroy.sh.in | 5 +- .../build-fhs-chrootenv/init.sh.in | 3 +- .../build-fhs-chrootenv/mount.sh.in | 3 + .../build-fhs-chrootenv/umount.sh.in | 2 +- pkgs/build-support/grsecurity/default.nix | 2 +- pkgs/data/fonts/arkpandora/default.nix | 1 + .../gnome-2/desktop/scrollkeeper/default.nix | 4 +- .../files/kdelibs-cve-2014-5033.patch | 36 + pkgs/desktops/kde-4.12/kdelibs/kdelibs.nix | 9 +- pkgs/development/compilers/agda/default.nix | 2 +- pkgs/development/compilers/agda/stdlib.nix | 11 +- pkgs/development/compilers/scala/default.nix | 4 +- .../interpreters/elixir/default.nix | 4 +- .../interpreters/jimtcl/default.nix | 32 + pkgs/development/interpreters/lua-5/5.1.nix | 10 +- pkgs/development/interpreters/lua-5/sec.nix | 2 +- .../interpreters/lua-5/sockets.nix | 4 +- pkgs/development/interpreters/php/5.4.nix | 4 +- .../interpreters/ruby/generated.nix | 379 +- .../interpreters/ruby/rubygems.nix | 8 +- .../libraries/agda/AgdaSheaves/default.nix | 23 + .../libraries/agda/bitvector/default.nix | 23 + pkgs/development/libraries/cimg/default.nix | 3 +- .../libraries/directfb/src-for-default.nix | 10 +- pkgs/development/libraries/flite/default.nix | 9 +- pkgs/development/libraries/gecode/default.nix | 21 + .../libraries/gtkspellmm/default.nix | 35 + .../haskell/functor-infix/default.nix | 15 + .../haskell/hoogle/hoogle-local-wrapper.sh | 6 + .../haskell/hoogle/hoogle-local.diff | 28 - .../libraries/haskell/hoogle/local.nix | 106 +- .../libraries/haskell/managed/default.nix | 13 + .../libraries/libgpg-error/default.nix | 2 +- .../libraries/libmicrohttpd/default.nix | 4 +- .../libraries/liboauth/default.nix | 4 +- .../readline/{readline5.nix => 5.x.nix} | 0 .../readline/{readline6.nix => 6.2.nix} | 0 .../readline/{readline6.3.nix => 6.3.nix} | 33 +- .../readline/readline-6.3-patches.nix | 12 + pkgs/development/libraries/sword/default.nix | 10 +- .../libraries/vaapi-vdpau/default.nix | 8 +- pkgs/development/mobile/xpwn/default.nix | 22 +- .../python-modules/dbus/default.nix | 4 +- .../python-modules/pycairo/default.nix | 4 +- .../python-modules/rbtools/default.nix | 8 +- .../python-modules/wxPython/2.8.nix | 4 +- .../python-modules/wxPython/3.0.nix | 4 +- .../tools/analysis/pmd/default.nix | 6 +- .../{simple-build-tool => sbt}/default.nix | 3 +- .../jenkins/default.nix | 16 +- .../tools/ocaml/merlin/default.nix | 2 +- pkgs/development/tools/vagrant/default.nix | 4 +- .../web/nodejs/build-node-package.nix | 193 +- pkgs/games/chocolate-doom/default.nix | 23 + pkgs/games/chocolate-doom/master.nix | 24 + pkgs/games/gtypist/default.nix | 24 +- pkgs/misc/emulators/mednafen/default.nix | 11 +- pkgs/misc/emulators/mednafen/server.nix | 8 +- pkgs/misc/emulators/stella/default.nix | 5 +- pkgs/misc/themes/gtk3/oxygen-gtk3/default.nix | 23 + pkgs/os-specific/linux/gradm/default.nix | 4 +- pkgs/os-specific/linux/iw/default.nix | 4 +- pkgs/os-specific/linux/kernel/linux-3.10.nix | 4 +- pkgs/os-specific/linux/kernel/linux-3.12.nix | 4 +- pkgs/os-specific/linux/kernel/linux-3.14.nix | 4 +- pkgs/os-specific/linux/kernel/linux-3.16.nix | 4 +- pkgs/os-specific/linux/kernel/patches.nix | 12 +- pkgs/os-specific/linux/paxctl/default.nix | 4 +- pkgs/os-specific/linux/smem/default.nix | 33 + pkgs/servers/computing/torque/default.nix | 41 + pkgs/servers/consul/default.nix | 34 +- pkgs/servers/consul/deps.nix | 164 +- pkgs/servers/consul/ui.nix | 17 - pkgs/servers/diod/default.nix | 4 +- pkgs/servers/irc/ircd-hybrid/default.nix | 6 +- pkgs/servers/nosql/influxdb/default.nix | 10 +- pkgs/test/openftd/default.nix | 2 +- pkgs/tools/audio/volumeicon/default.nix | 23 + pkgs/tools/cd-dvd/unetbootin/default.nix | 4 +- pkgs/tools/graphics/qrencode/default.nix | 4 +- pkgs/tools/misc/pv/default.nix | 4 +- pkgs/tools/networking/openssh/default.nix | 5 +- pkgs/tools/networking/sshpass/default.nix | 18 + .../package-management/gem-nix/default.nix | 23 + pkgs/tools/package-management/nox/default.nix | 2 +- pkgs/top-level/all-packages.nix | 84 +- pkgs/top-level/haskell-packages.nix | 8 +- pkgs/top-level/node-packages-generated.nix | 13615 +++++++++------- pkgs/top-level/node-packages.json | 1 + pkgs/top-level/perl-packages.nix | 8 +- pkgs/top-level/python-packages.nix | 202 +- pkgs/top-level/release.nix | 74 - 138 files changed, 9314 insertions(+), 7050 deletions(-) create mode 100644 nixos/modules/services/computing/torque/mom.nix create mode 100644 nixos/modules/services/computing/torque/server.nix create mode 100644 pkgs/applications/audio/musescore/default.nix create mode 100644 pkgs/applications/networking/linssid/default.nix create mode 100644 pkgs/applications/version-management/smartgithg/default.nix create mode 100644 pkgs/desktops/kde-4.12/files/kdelibs-cve-2014-5033.patch create mode 100644 pkgs/development/interpreters/jimtcl/default.nix create mode 100644 pkgs/development/libraries/agda/AgdaSheaves/default.nix create mode 100644 pkgs/development/libraries/agda/bitvector/default.nix create mode 100644 pkgs/development/libraries/gecode/default.nix create mode 100644 pkgs/development/libraries/gtkspellmm/default.nix create mode 100644 pkgs/development/libraries/haskell/functor-infix/default.nix create mode 100644 pkgs/development/libraries/haskell/hoogle/hoogle-local-wrapper.sh delete mode 100644 pkgs/development/libraries/haskell/hoogle/hoogle-local.diff create mode 100644 pkgs/development/libraries/haskell/managed/default.nix rename pkgs/development/libraries/readline/{readline5.nix => 5.x.nix} (100%) rename pkgs/development/libraries/readline/{readline6.nix => 6.2.nix} (100%) rename pkgs/development/libraries/readline/{readline6.3.nix => 6.3.nix} (68%) create mode 100644 pkgs/development/libraries/readline/readline-6.3-patches.nix rename pkgs/development/tools/build-managers/{simple-build-tool => sbt}/default.nix (87%) create mode 100644 pkgs/games/chocolate-doom/default.nix create mode 100644 pkgs/games/chocolate-doom/master.nix create mode 100644 pkgs/misc/themes/gtk3/oxygen-gtk3/default.nix create mode 100644 pkgs/os-specific/linux/smem/default.nix create mode 100644 pkgs/servers/computing/torque/default.nix delete mode 100644 pkgs/servers/consul/ui.nix create mode 100644 pkgs/tools/audio/volumeicon/default.nix create mode 100644 pkgs/tools/networking/sshpass/default.nix create mode 100644 pkgs/tools/package-management/gem-nix/default.nix diff --git a/doc/language-support.xml b/doc/language-support.xml index f5e89df57fc..117e1d93c15 100644 --- a/doc/language-support.xml +++ b/doc/language-support.xml @@ -233,6 +233,17 @@ twisted = buildPythonPackage { +
Ruby + For example, to package yajl-ruby package, use gem-nix: + + + $ nix-env -i gem-nix + $ gem-nix --no-user-install --nix-file=pkgs/development/interpreters/ruby/generated.nix yajl-ruby + $ nix-build -A rubyLibs.yajl-ruby + +
+ +
Java Ant-based Java packages are typically built from source as follows: diff --git a/lib/licenses.nix b/lib/licenses.nix index caffa7539d1..dadb9b07a08 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -72,6 +72,11 @@ rec { fullName = "Creative Commons Attribution 3.0"; }; + cc-by-40 = spdx { + shortName = "CC-BY-4.0"; + fullName = "Creative Commons Attribution 4.0"; + }; + cddl = spdx { shortName = "CDDL-1.0"; fullName = "Common Development and Distribution License 1.0"; diff --git a/lib/maintainers.nix b/lib/maintainers.nix index c52b6638039..1124d75d52a 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -41,6 +41,7 @@ cstrahan = "Charles Strahan "; DamienCassou = "Damien Cassou "; DerGuteMoritz = "Moritz Heidkamp "; + dbohdan = "Danyil Bohdan "; doublec = "Chris Double "; ederoyd46 = "Matthew Brown "; edwtjo = "Edward Tjörnhammar "; @@ -118,6 +119,7 @@ ttuegel = "Thomas Tuegel "; tv = "Tomislav Viljetić "; urkud = "Yury G. Kudryashov "; + vandenoever = "Jos van den Oever "; vbmithr = "Vincent Bernardoff "; vcunat = "Vladimír Čunát "; viric = "Lluís Batlle i Rossell "; diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index bd89ad4eb9c..68248081af6 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -57,7 +57,7 @@ let }; optionsDocBook = runCommand "options-db.xml" {} '' - optionsXML=${options'}/doc/share/nixos/options.xml + optionsXML=${options'}/share/doc/nixos/options.xml if grep /nixpkgs/nixos/modules $optionsXML; then echo "The manual appears to depend on the location of Nixpkgs, which is bad" echo "since this prevents sharing via the NixOS channel. This is typically" @@ -127,7 +127,7 @@ in rec { mkdir -p $out/nix-support echo "nix-build out $out" >> $out/nix-support/hydra-build-products - echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products + echo "doc manual $dst" >> $out/nix-support/hydra-build-products ''; # */ meta.description = "The NixOS manual in HTML format"; diff --git a/nixos/lib/test-driver/log2html.xsl b/nixos/lib/test-driver/log2html.xsl index ce8a9c6de2b..0485412b4c8 100644 --- a/nixos/lib/test-driver/log2html.xsl +++ b/nixos/lib/test-driver/log2html.xsl @@ -9,8 +9,8 @@ - - + +