diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-01-19 09:55:31 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-01-19 09:55:31 +0100 |
commit | 716aac2519a7571e7f5fd984a886d579a4a051c5 (patch) | |
tree | 53cf89cf764d787f4dc8f08474479892b9733177 /pkgs/stdenv/generic | |
parent | f8472457a440de3c44f6f604142d678b6ae2a762 (diff) | |
parent | 53b389327e34de319dc0dbda2b6bcab1a69db69d (diff) |
Merge branch 'staging' into closure-size
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 41 |
2 files changed, 25 insertions, 17 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index de5a9404b65cd..8395394f5a873 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -85,6 +85,7 @@ let ../../build-support/setup-hooks/multiple-outputs.sh ../../build-support/setup-hooks/move-sbin.sh ../../build-support/setup-hooks/move-lib64.sh + ../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh cc ]; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 788973b0cb5cf..270f6cdb68f7e 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -193,6 +193,14 @@ _addRpathPrefix() { # Initialisation. +# Set a fallback default value for SOURCE_DATE_EPOCH, used by some +# build tools to provide a deterministic substitute for the "current" +# time. Note that 1 = 1970-01-01 00:00:01. We don't use 0 because it +# confuses some applications. +export SOURCE_DATE_EPOCH +: ${SOURCE_DATE_EPOCH:=1} + + # Wildcard expansions that don't match should expand to an empty list. # This ensures that, for instance, "for i in *; do ...; done" does the # right thing. @@ -612,12 +620,8 @@ fixLibtool() { configurePhase() { runHook preConfigure - if [ -z "$configureScript" ]; then + if [ -z "$configureScript" -a -x ./configure ]; then configureScript=./configure - if ! [ -x $configureScript ]; then - echo "no configure script, doing nothing" - return - fi fi if [ -z "$dontFixLibtool" ]; then @@ -645,8 +649,12 @@ configurePhase() { fi fi - echo "configure flags: $configureFlags ${configureFlagsArray[@]}" - $configureScript $configureFlags "${configureFlagsArray[@]}" + if [ -n "$configureScript" ]; then + echo "configure flags: $configureFlags ${configureFlagsArray[@]}" + $configureScript $configureFlags "${configureFlagsArray[@]}" + else + echo "no configure script, doing nothing" + fi runHook postConfigure } @@ -657,17 +665,16 @@ buildPhase() { if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then echo "no Makefile, doing nothing" - return - fi - - # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 - makeFlags="SHELL=$SHELL $makeFlags" + else + # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 + makeFlags="SHELL=$SHELL $makeFlags" - echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}" - make ${makefile:+-f $makefile} \ - ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ - $makeFlags "${makeFlagsArray[@]}" \ - $buildFlags "${buildFlagsArray[@]}" + echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}" + make ${makefile:+-f $makefile} \ + ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ + $makeFlags "${makeFlagsArray[@]}" \ + $buildFlags "${buildFlagsArray[@]}" + fi runHook postBuild } |