Commit graph

128 commits

Author SHA1 Message Date
Thomas Tuegel e15fc83fc9 Don't split paths with spaces
setup.sh uses the anti-pattern `for f in $(find ...); do` in several
places. `find` returns one path per line, but `for` splits its arguments
by words, so paths which contain spaces are incorrectly split! The
correct way is `find ... | while read f; do`
2014-01-11 07:54:35 -06:00
Eelco Dolstra 10ab227126 stdenv: Prepend SHELL=... to makeFlags
If it's appended, the user cannot override SHELL.
2014-01-07 17:45:55 +01:00
Eelco Dolstra 320209a618 Merge deterministicStdenv into the default stdenv
This means that (on Linux) strip uses
"--enable-deterministic-archives" and ld uses the
BFD_DETERMINISTIC_OUTPUT flag.
2014-01-07 13:57:42 +01:00
Eelco Dolstra 2a0047bbef stdenv: Fix indentation 2014-01-07 09:49:45 +01:00
Eelco Dolstra 890461d8af stdenv: Update comment 2014-01-07 09:48:23 +01:00
Eelco Dolstra 369185288a stdenv: Revert special-casing of fixupPhase
Treating fixupPhase specially is really ugly.  Also, it collides with
the work in the multiple-outputs branch (which already has support for
fixing up all outputs).

Partial revert of 0a44a09121.
2014-01-07 09:48:01 +01:00
Bjørn Forsman f4f0d2ecb9 stdenv/setup.sh: fix breakage when shebang contains '\'
Some programs, e.g. guile-config, has a shebang that ends in '\':

  #!/usr/bin/guile-1.8 \
  -e main -s
  !#
  ;;;; guile-config --- utility for linking programs with Guile
  ;;;; Jim Blandy <jim@red-bean.com> --- September 1997

This currently breaks patchShebangs:

  $ read oldPath arg0 args <<< 'shebang \'; echo $?
  1
  $ echo $oldPath
  shebang
  $ echo $arg0

  $ echo $args

(And setup.sh/patchShebangs is run with 'set -e' so any command that
return non-zero aborts the build.)

Fix by telling 'read' to not interpret backslashes (with the -r flag):

  $ read -r oldPath arg0 args <<< 'shebang \'; echo $?
  0
  $ echo $oldPath
  shebang
  $ echo $arg0
  \
  $ echo $args

Also needed: escape the escape characters so that sed doesn't interpret
them.
2014-01-03 14:47:39 +01:00
Vladimír Čunát d978c35ff9 stdenv/setup.sh: fix previous change...
for the case that there is no makefile. CC #1354
2013-12-28 10:43:34 +01:00
Vladimír Čunát 3f4b14d793 stdenv/setup.sh: add SHELL to makeFlags (close #1354) 2013-12-27 21:03:16 +01:00
Bjørn Forsman 4e385fcda7 stdenv/patchShebangs: fix shebang check
patchShebangs has a bug that shows itself on files that have the
executable bit set but have no shebang (i.e. a blank/empty first line).
The shell would then evaluate this:

if [ != '#!' ]; then
  # not evaluated
fi

With proper quoting we get the correct behaviour:

if [ "" != '#!' ]; then
  # this will be evaluated
fi
2013-12-07 21:13:06 +01:00
Bjørn Forsman 88c7b4c7fe Fix bug introduced in previous commit
When building e.g. perl for the first time there is no perl in PATH yet,
so command -v perl will fail.

This brings back the previous behaviour of silently not patching
shebangs for which there is no available command in PATH.
2013-12-03 16:58:49 +01:00
Bjørn Forsman 7bf209db50 patchShebangs: rewrite ".../bin/env python" to /nix/store/.../python
Currently "/usr/bin/env python" is rewritten to "/nix/store/.../env
python". That doesn't really improve anything because the interpreter
still have to be located in $PATH at runtime. The result is that many
nix package expressions do .../bin/env fixup themselves.

Instead of everyone having to do this patching locally, add the
functionality to the standard environment patchShebangs function so that
everyone can benefit.
2013-12-02 13:02:42 +01:00
Eelco Dolstra 70edf15997 patchPhase: Handle xz compression 2013-08-07 15:46:25 +02:00
Vladimír Čunát 0a44a09121 stdenv: default builder fixes (merge #554)
With a minor fix.
I did some huge rebuilds with this on x86_64-linux, found no problems.
2013-06-30 09:00:12 +02:00
Vladimír Čunát 173c9cbb63 builder: fail if patch is missing or fails to unpack 2013-06-27 16:34:31 +02:00
Vladimír Čunát 7f1e09c35d Re-Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"
This reverts commit b08e12b37a.
2013-06-27 15:14:32 +02:00
Peter Simons b08e12b37a Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"
This reverts commit abc7591aaf, reversing changes
made to 6b1ebeccf2, because they broke half the
packages in stdenv-updates: http://hydra.nixos.org/eval/927013 has further
details.
2013-06-17 10:19:15 +02:00
Marc Weber f7ef08e5cd experimental/cmake-improvement
set CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH based on NIX_CFLAGS_COMPILE and
NIX_LDFLAGS so that cmake's find_library like functions find all the libraries
gcc knows about thanks to the gcc wrapper

This is particular useful with myEnvFun which then also sets those CMAKE_* env
variables.`

Because setup.sh has to change this causes many rebuilds - thus it should be
included in a stdenv-update like branch

Also cmake builds in parallel perfectly fine

update cmake to latest minor number, I didn't change the patches,
just reapplied them manually recordin a new patch
2013-05-28 16:22:45 +02:00
aszlig 82f94df719 stdenv/setup.sh: Always run postPatch hook.
I'm not sure whether this was by intention, but so far postPatch hooks were
silently skipped whenever the patches list was empty. This change could possibly
change the build results of the following packages:

 * gcc
 * cmake (264)
 * systemtap
 * quemu-kvm

These packages all have in common that they have a postPatch hook and the
patches list can be empty when certain conditions are met.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2013-02-27 15:26:18 +01:00
Eelco Dolstra ab3eeabfed Rename buildNativeInputs -> nativeBuildInputs
Likewise for propagatedBuildNativeInputs, etc.  "buildNativeInputs"
sounds like an imperative rather than a noun phrase.
2012-12-28 19:20:09 +01:00
Eelco Dolstra 5be0a9acd7 Rename hostDrv -> crossDrv, buildDrv -> nativeDrv
This is for consistency with terminology in stdenv (and the terms
"hostDrv" and "buildDrv" are not very intuitive, even if they're
consistent with GNU terminology).
2012-12-28 19:08:19 +01:00
Eelco Dolstra f4ed8a3b91 Remove trailing whitespace 2012-12-28 16:41:56 +01:00
Eelco Dolstra cf8daf6312 Add an option ‘stdenv.userHook’ to set a global stdenv setup hook
This allows various applications.  It allows users to set global
optimisation flags, e.g.

  stdenv.userHook = ''NIX_CFLAGS_COMPILE+=" -funroll-loops"'';

But the impetus is as an alternative to issue #229, allowing impure
stdenv setup for people who want to use distcc:

  stdenv.userHook = "source /my/impure/setup-script.sh";

This is probably a bad idea, but at least now it's a bad idea in
people's configuration and not in Nixpkgs. :-)
2012-12-28 16:36:09 +01:00
Eelco Dolstra 6fd4f63530 Revert "Merge pull request #229 from viric/niximpure2-stdenv-updates"
This reverts commit e04b17bfba, reversing
changes made to 1af2ada7d4.
2012-12-28 15:46:45 +01:00
Lluís Batlle i Rossell 095db9fe3f stdenv: Stripping out/lib32 too
If not, in mips64/n32, lib32/libiberty.a was left without stripping, and
it contained (debug) references to bootstrap-tools.
2012-12-27 23:36:01 +01:00
Lluís Batlle i Rossell 635880a17a 2nd approach at getting a check for /niximpure in stdenv-updates 2012-12-26 21:38:58 +01:00
Shea Levy 6d928ab684 Don't preserve timestamps when copying sources to the temporary build directory.
This should fix issues like "ZIP does not support timestamps before 1980"
2012-12-14 13:36:04 -05:00
Eelco Dolstra 0008138201 checkPhase: Pass VERBOSE=y so that failing tests show something useful 2012-10-16 15:00:51 -04:00
Eelco Dolstra b3d20690a1 For consistency, don't use the -v flag when copying a directory $src 2012-09-25 21:31:16 -04:00
Eelco Dolstra be901fa8be * Add an installCheckPhase.
svn path=/nixpkgs/branches/stdenv-updates/; revision=33967
2012-05-01 21:00:30 +00:00
Shea Levy 6f711ceb01 Revert r33547
svn path=/nixpkgs/branches/stdenv-updates/; revision=33583
2012-04-04 19:45:01 +00:00
Shea Levy 358e51bb6d tar doesn't need -f - to read from stdin
svn path=/nixpkgs/branches/stdenv-updates/; revision=33574
2012-04-04 16:27:04 +00:00
Shea Levy 4a84fd30b5 Don't do verbose unpacking, it's just log noise
svn path=/nixpkgs/branches/stdenv-updates/; revision=33573
2012-04-04 16:25:17 +00:00
Shea Levy 483f094acb Honor propagatedUserEnvPackages in setup.sh
svn path=/nixpkgs/branches/stdenv-updates/; revision=32369
2012-02-17 21:37:15 +00:00
Eelco Dolstra b27b5dfd75 * Doh.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31726
2012-01-19 22:18:34 +00:00
Eelco Dolstra 61d0c5d931 * Don't rely on tar knowing about .xz.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31708
2012-01-19 17:33:33 +00:00
Eelco Dolstra 698c4d296b * "test" -> "[ ... ]" (style cleanup).
svn path=/nixpkgs/branches/stdenv-updates/; revision=31704
2012-01-19 16:14:09 +00:00
Eelco Dolstra ee45e160b1 * Prepend the "prehook" rather than sourcing it.
* Don't call xargs with the -r flag in the Darwin bootstrap.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31703
2012-01-19 15:56:17 +00:00
Eelco Dolstra 6208059079 * The postHook substitution is not used anywhere, so get rid of it.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31702
2012-01-19 15:39:12 +00:00
Eelco Dolstra b31df26cea * Remove an unnecessary check.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31701
2012-01-19 15:31:56 +00:00
Eelco Dolstra 0d71e75222 * Get rid of params1-5, they're obsolete.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31700
2012-01-19 15:29:20 +00:00
Eelco Dolstra 0e6fa321bb * Don't use the "replace-literal" command in stdenv; instead use
bash's pattern replacement feature.  "replace-literal" is an
  uncommon command so it was a headache during the bootstrap.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31681
2012-01-19 13:47:26 +00:00
Eelco Dolstra fc89eefa50 * Seems that bash 3.2 on Mac OS X doesn't know the \e
escape, so use \033 instead.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31680
2012-01-19 10:24:26 +00:00
Eelco Dolstra c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00
Eelco Dolstra 3ea1c30846 * Remove the NIX_STRIP_DEBUG flag. It was undocumented and confusing
in its interaction with the ‘dontStrip’ attribute.

svn path=/nixpkgs/branches/stdenv-updates/; revision=30848
2011-12-12 14:02:12 +00:00
Eelco Dolstra fd394a7c4a * Only print "@ phase..." messages on demand since they're kind of
ugly and we already print phases (with start and end markers).
* Remove some stray tabs.

svn path=/nixpkgs/branches/stdenv-updates/; revision=30059
2011-10-27 16:32:46 +00:00
Shea Levy 1a43ce8e08 Add a substituteAllInPlace() function to stdenv
svn path=/nixpkgs/branches/stdenv-updates/; revision=27993
2011-07-28 20:28:37 +00:00
Lluís Batlle i Rossell c06046e5ef Improving a bit the manpage gzip code. I decided to gzip hard links and soft
links, as nix-store --optimise can care better later.


svn path=/nixpkgs/branches/stdenv-updates/; revision=26242
2011-03-09 22:17:18 +00:00
Lluís Batlle i Rossell 65c78a3222 Adding a manpage gzipping stage in the fixupPhase. This should go unnoticed,
but for the less disk space used.


svn path=/nixpkgs/branches/stdenv-updates/; revision=26241
2011-03-09 20:10:47 +00:00
Ludovic Courtès cff72e7a83 stdenv: Emit phase-started' and phase-succeeded' events.
These markers follow the format of those of `nix-store --print-build-trace',
which allows extraction of, say, phase durations in a similar way.

svn path=/nixpkgs/branches/stdenv-updates/; revision=26115
2011-02-25 15:28:11 +00:00