mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
12ae5363ea
* Make builders unexecutable by removing the hash-bang line and execute permission. * Convert calls to `derivation' to `mkDerivation'. * Remove `system' and `stdenv' attributes from calls to `mkDerivation'. These transformations were all done automatically, so it is quite possible I broke stuff. * Put the `mkDerivation' function in stdenv/generic. svn path=/nixpkgs/trunk/; revision=874
27 lines
1.0 KiB
Nix
27 lines
1.0 KiB
Nix
# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't
|
|
# know where the C library and standard header files are. Therefore
|
|
# the compiler produced by that package cannot be installed directly
|
|
# in a user environment and used from the command line. This
|
|
# stdenv.mkDerivation provides a wrapper that sets up the right environment
|
|
# variables so that the compiler and the linker just "work".
|
|
|
|
{ name, stdenv, nativeTools, nativeGlibc, nativePrefix ? ""
|
|
, gcc ? null, glibc ? null, binutils ? null
|
|
}:
|
|
|
|
assert nativeTools -> nativePrefix != "";
|
|
assert !nativeTools -> gcc != null && binutils != null;
|
|
assert !nativeGlibc -> glibc != null;
|
|
|
|
stdenv.mkDerivation {
|
|
builder = ./builder.sh;
|
|
setupHook = ./setup-hook.sh;
|
|
gccWrapper = ./gcc-wrapper.sh;
|
|
ldWrapper = ./ld-wrapper.sh;
|
|
utils = ./utils.sh;
|
|
inherit name nativeTools nativeGlibc nativePrefix gcc glibc binutils;
|
|
langC = if nativeTools then true else gcc.langC;
|
|
langCC = if nativeTools then true else gcc.langCC;
|
|
langF77 = if nativeTools then false else gcc.langF77;
|
|
}
|