nixpkgs/pkgs/build-support/gcc-cross-wrapper/default.nix
Eelco Dolstra baec8f5b38 * stdenv.mkDerivation now takes an optional attribute "meta" that
contains arbitrary information about a package, like this:

  meta = {
    homepage = "http://gcc.gnu.org/";
    license = "GPL/LGPL";
    description = "GNU Compiler Collection, 4.0.x";
  };

  The "meta" attribute is not passed to the actual derivation
  operation, so it's not a dependency --- changes to "meta" attributes
  don't trigger a recompilation.

  Now we have to standardise some useful attributes ;-)

svn path=/nixpkgs/branches/usability/; revision=5024
2006-03-10 16:12:46 +00:00

34 lines
1.3 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, shell ? "", cross ? ""
}:
assert nativeTools -> nativePrefix != "";
assert !nativeTools -> gcc != null && binutils != null;
assert !nativeGlibc -> glibc != null;
stdenv.mkDerivation {
builder = ./builder.sh;
substitute = ../substitute/substitute.sh;
setupHook = ./setup-hook.sh;
gccWrapper = ./gcc-wrapper.sh;
ldWrapper = ./ld-wrapper.sh;
utils = ./utils.sh;
addFlags = ./add-flags;
inherit nativeTools nativeGlibc nativePrefix gcc glibc binutils cross;
name = if name == "" then gcc.name else name;
langC = if nativeTools then true else gcc.langC;
langCC = if nativeTools then true else gcc.langCC;
langF77 = if nativeTools then false else gcc.langF77;
shell = if shell == "" then stdenv.shell else shell;
meta = if gcc != null then gcc.meta else
{ description = "System C compiler wrapper";
};
}