Commit graph

710 commits

Author SHA1 Message Date
Eelco Dolstra 9f822e5477 stdenv: Move paxmark function to paxctl's setup hook 2014-08-09 12:44:50 +02:00
Eelco Dolstra d7b356f73b stdenv: Move unzip support to unzip's setup hook 2014-08-09 12:44:50 +02:00
Eelco Dolstra 3e33c975fb stdenv: Make unpackFile extensible via the hook mechanism
unpackCmd is now a regular hook, so there can be multiple functions
hooking into it.
2014-08-09 12:44:49 +02:00
Eelco Dolstra 1a44dbbbb9 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.
2014-08-09 12:44:49 +02:00
Eelco Dolstra daa66b8b1c Factor out fixup phase stuff into separate setup hooks 2014-08-09 12:44:49 +02:00
Eelco Dolstra 83a41771ab Move RPATH shrinking from stdenv to a setup hook provided by patchelf 2014-08-09 12:44:49 +02:00
Eelco Dolstra b23dbb1a5d 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.
2014-08-09 12:44:49 +02:00
Eelco Dolstra 0a8605ded1 Formatting 2014-08-09 12:44:48 +02:00
Eelco Dolstra 37889e2b5e Provide a hook for per-output fixup 2014-08-09 12:44:48 +02:00
Eelco Dolstra b0f2d3419c Allow multiple hooks with the same name
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.
2014-08-09 12:44:48 +02:00
Michael Raskin 0769fc5b77 Set CONFIG_SHELL to stdenv.shell in the default builder, just like SHELL 2014-07-30 16:44:28 +02:00
Eelco Dolstra 3e4a382d67 Doh 2014-07-28 09:37:23 +02:00
Eelco Dolstra fb4e2e112f Export SDKROOT 2014-07-28 09:14:13 +02:00
Eelco Dolstra ac8775dd96 $xcodePath -> $SDKROOT
SDKROOT is standard. In particular, this fixes the cmake build on
Mac OS X 10.9.
2014-07-24 21:53:46 +02:00
Eelco Dolstra bf0d518c67 stdenv-darwin: Shut up some warnings from SDK headers
The Carbon headers spew out zillions of multichar / deprecations warnings,
which isn't very helpful. So turn them off.
2014-07-23 11:47:46 +02:00
Eelco Dolstra fd1a5d8531 Set MACOSX_DEPLOYMENT_TARGET
This variable sets the minimal Mac OS X version required for
running binaries produced by the Darwin toolchain. Since it
defaults to the version of the user's SDK, setting it explicitly
should make our builds more deterministic. It's now set to 10.6
because that's what hydra.nixos.org runs.
2014-07-02 19:52:25 +02:00
Eelco Dolstra 0da7fadce3 stdenv: Fix __ignoreNulls
Commit 262c21ed46 purported to enable
ignoreNulls, but it was bogus because it set the flag on the wrong
derivation (i.e. stdenv rather than the result of mkDerivation).
2014-07-01 16:56:36 +02:00
Eelco Dolstra 0d8014f6fc Darwin: Search for libraries in $sdk/usr/lib
This required adding a new environment variable NIX_LDFLAGS_AFTER
that ensures that the -L.../usr/lib flag happens last.
2014-07-01 15:56:09 +02:00
Eelco Dolstra 89f8af55f1 Darwin: Use xcrun to get the path to the SDK
Recent versions of Xcode don't install headers in /usr/include but
in a directory like

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include

So use that instead, falling back to /usr/include in case of an older
version of Xcode.
2014-07-01 11:01:36 +02:00
Eelco Dolstra b3b9c51b34 Add a deprecation warning to ensureDir 2014-06-30 14:57:12 +02:00
Eelco Dolstra 40f7b0f9df Another attempt to eradicate ensureDir
See c556a6ea46.
2014-06-30 14:56:10 +02:00
Eelco Dolstra 47075812ce Remove the unmaintained (and AFAIK unused) stdenv for mingw 2014-06-30 13:31:08 +02:00
Eelco Dolstra e5d63646a0 Don't suggest using --arg config '{ allowUnfree = true; }'
This doesn't work when using the Nixpkgs/NixOS channel.

Issue #2998.
2014-06-17 15:00:24 -05:00
Vladimír Čunát 9757785295 Merge recent master 2014-06-15 17:55:35 +02:00
Michael Raskin a076a60735 Allow specifying allowUnfreePredicate instead of allowUnfree. The predicate will have access to the arguments of mkDerivation call. Should be an improvement for #2188 2014-06-14 13:01:12 +04:00
Vladimír Čunát 5a98b9f514 Merge recent master into p/stdenv
Merged just before the pypi update, as it seems to cause problems on Hydra.
2014-06-09 19:07:31 +02:00
John Wiegley 27ecc1c9e9 Change stdenv on darwin to not set NIX_ENFORCE_PURITY 2014-05-29 02:43:10 -05:00
Vladimír Čunát 3d3aea09b9 fix paxmark on non-linux (a bug in grsecurity PR #1187) 2014-05-15 13:25:49 +02:00
Ricardo M. Correia 8d5ce245a2 grsecurity: Add paxctl, paxmark and stdenv.needsPax to stdenv 2014-05-15 13:25:46 +02:00
Domen Kožar 73e82b9e07 s/config.allowUnfree = true/allowUnfree = true/ 2014-05-03 15:13:01 +02:00
Eelco Dolstra 5ba24cc8ea Typo/comment 2014-04-22 18:42:44 +02:00
Eelco Dolstra 4e8c2f0ff9 Merge branch 'systemd-update' 2014-04-20 19:31:01 +02:00
Eelco Dolstra b614ea22d4 Move files 2014-04-20 01:27:15 +02:00
Eelco Dolstra d4f44d6db3 Move stdenv bootstrap binaries out of the tree
Commit 986f361946 started to use
<nix/fetchurl.nix> to "download" the bootstrap binaries from the
Nixpkgs tree, using the file:/// scheme. This has really bad
consequences:

* It makes any derivation depend on the path of the Nixpkgs tree. So
  evaluating a package will produce a different .drv file when run
  from different locations. No wonder Hydra evaluation has been so
  slow lately: for every Nixpkgs evaluation, it had to create tens of
  thousands of .drv files, even if nothing had changed.

* It requires the builder to have file system access to the Nixpkgs
  tree. So if your tree is in your home directory, the stdenv
  bootstrap would probably fail.

So now the binaries are downloaded from tarballs.nixos.org.

Also dropped PowerPC "support".
2014-04-20 01:16:12 +02:00
Eelco Dolstra c49404547b Use <nix/fetchurl.nix> to download the bootstrap tools 2014-04-20 00:54:09 +02:00
Eelco Dolstra 1d6ac39d21 Fix indentation 2014-04-18 21:50:00 +02:00
Domen Kožar 753639e548 typo 2014-04-14 10:27:36 +02:00
Domen Kožar 722143a5d3 fix typo 2014-04-14 09:29:41 +02:00
Alexander Kjeldaas ebe8fab999 Make the user aware of the allowUnfree option. 2014-04-14 09:24:01 +02:00
Eelco Dolstra 331fa06c79 Add a flag ‘config.allowBroken’ 2014-04-09 00:13:52 +02:00
Eelco Dolstra 627923d5b7 Replace $HYDRA_DISALLOW_UNFREE with $NIXPKGS_ALLOW_UNFREE
We've never used this environment variable in Hydra (except for a few
days). This is also more consistent with $NIXPKGS_ALLOW_BROKEN.
2014-04-09 00:12:48 +02:00
Eelco Dolstra e09250d41c Disable allowUnfree by default
Fixes #2134.
2014-04-09 00:09:31 +02:00
Vladimír Čunát c4371afd06 stdenv/setup.sh: make substitute* not drop EOF newline
This should solve #1982.
2014-04-02 19:07:59 +02:00
Vladimír Čunát 1f6a15d7de Merge #1901: add preFixupPhases to stdenv; for gsettings
Without this stdenv change it seems difficult to fix some glib's gsettings issues,
as the folders in question may (not) be created in installPhase.
2014-04-02 19:06:41 +02:00
Eelco Dolstra 14af15dbff Explicitly require Nix 1.6
People using Nix < 1.6 previously got an unhelpful "infinite
recursion" error.
2014-03-17 11:33:36 +01:00
Eelco Dolstra 497997cc38 Move generation of coverage reports from nixos/lib/testing to releaseTools
Also, turn some stdenv adapters into setup hooks.
2014-03-03 13:57:08 +01:00
Eelco Dolstra 80647127a3 Turn the coverage analysis stdenv adapters into setup hooks
Stdenv adapters are kinda weird and un-idiomatic (especially when they
don't actually change stdenv).  It's more idiomatic to say

  buildInputs = [ makeCoverageAnalysisReport ];
2014-02-05 19:18:33 +01:00
Eelco Dolstra bea2b3c517 addCoverageInstrumentation: Set NIX_CFLAGS_COMPILE as an attribute
This allows it to show up in nix-shell.
2014-02-05 19:18:33 +01:00
Eelco Dolstra 58a863268a stdenv: Simplify 2014-02-05 19:18:33 +01:00
Eelco Dolstra c3d84d15ce Apply makeOverridable to stdenv
This removes the need for hacks like stdenv.regenerate.  It also
ensures that overrideGCC is now stackable (so ‘stdenv = useGoldLinker
clangStdenv’ works).
2014-02-05 19:18:33 +01:00