2003-11-02 18:42:19 +01:00
|
|
|
# This file evaluates to a function that, when supplied with a system
|
|
|
|
# identifier, returns the set of all packages provided by the Nix
|
|
|
|
# Package Collection. It does this by supplying
|
2003-11-18 13:12:56 +01:00
|
|
|
# `all-packages-generic.nix' with a standard build environment.
|
2003-11-02 18:42:19 +01:00
|
|
|
#
|
|
|
|
# On Linux systems, the standard build environment consists of
|
|
|
|
# Nix-built instances glibc and the `standard' Unix tools, i.e., the
|
|
|
|
# Posix utilities, the GNU C compiler, and so on. On other systems,
|
|
|
|
# we use the native C library.
|
2003-10-30 18:01:49 +01:00
|
|
|
|
2003-11-03 11:22:00 +01:00
|
|
|
{system}: let {
|
2003-11-18 13:12:56 +01:00
|
|
|
allPackages = import ./all-packages-generic.nix;
|
2003-10-30 18:01:49 +01:00
|
|
|
|
2004-02-04 18:25:51 +01:00
|
|
|
|
2003-11-02 18:42:19 +01:00
|
|
|
# The native (i.e., impure) build environment. This one uses the
|
|
|
|
# tools installed on the system outside of the Nix environment,
|
|
|
|
# i.e., the stuff in /bin, /usr/bin, etc. This environment should
|
|
|
|
# be used with care, since many Nix packages will not build properly
|
|
|
|
# with it (e.g., because they require GNU Make).
|
2003-12-21 21:52:13 +01:00
|
|
|
stdenvNative = (import ../stdenv/native) {system = system;};
|
|
|
|
stdenvNativePkgs = allPackages {system = system; stdenv = stdenvNative;};
|
2003-11-02 18:42:19 +01:00
|
|
|
|
2004-02-04 18:25:51 +01:00
|
|
|
|
2003-11-02 18:42:19 +01:00
|
|
|
# The Nix build environment.
|
2003-11-03 11:22:00 +01:00
|
|
|
stdenvNix = (import ../stdenv/nix) {
|
|
|
|
bootStdenv = stdenvNative;
|
|
|
|
pkgs = stdenvNativePkgs;
|
|
|
|
};
|
2003-12-21 21:52:13 +01:00
|
|
|
stdenvNixPkgs = allPackages {system = system; stdenv = stdenvNix;};
|
2003-11-02 18:42:19 +01:00
|
|
|
|
2004-02-04 18:25:51 +01:00
|
|
|
|
2003-11-02 18:42:19 +01:00
|
|
|
# The Linux build environment consists of the Nix build environment
|
|
|
|
# built against the GNU C Library.
|
2003-11-03 11:22:00 +01:00
|
|
|
stdenvLinuxGlibc = stdenvNativePkgs.glibc;
|
2003-11-18 13:12:56 +01:00
|
|
|
stdenvLinuxBoot = (import ../stdenv/nix-linux/boot.nix) {
|
2003-11-03 11:22:00 +01:00
|
|
|
system = system;
|
|
|
|
glibc = stdenvLinuxGlibc;
|
|
|
|
};
|
2003-12-21 21:52:13 +01:00
|
|
|
stdenvLinuxBootPkgs = allPackages {system = system; stdenv = stdenvLinuxBoot;};
|
2003-11-02 18:42:19 +01:00
|
|
|
|
2003-11-03 11:22:00 +01:00
|
|
|
stdenvLinux = (import ../stdenv/nix-linux) {
|
|
|
|
bootStdenv = stdenvLinuxBoot;
|
|
|
|
pkgs = stdenvLinuxBootPkgs;
|
|
|
|
glibc = stdenvLinuxGlibc;
|
|
|
|
};
|
2004-02-04 18:25:51 +01:00
|
|
|
stdenvLinuxPkgs =
|
|
|
|
allPackages {system = system; stdenv = stdenvLinux;} //
|
|
|
|
{inherit (stdenvLinuxBootPkgs)
|
2004-02-16 11:40:45 +01:00
|
|
|
gzip bzip2 /* bash */ binutils coreutils diffutils findutils gawk gcc
|
2004-02-04 18:25:51 +01:00
|
|
|
gnumake gnused gnutar gnugrep wget;
|
|
|
|
} //
|
|
|
|
{glibc = stdenvLinuxGlibc;};
|
|
|
|
|
2003-11-02 18:42:19 +01:00
|
|
|
|
2003-11-02 23:25:26 +01:00
|
|
|
# Select the right instantiation.
|
2003-11-03 11:22:00 +01:00
|
|
|
body =
|
2003-12-01 15:37:42 +01:00
|
|
|
if system == "i686-linux"
|
2003-11-03 11:22:00 +01:00
|
|
|
then stdenvLinuxPkgs
|
|
|
|
else stdenvNixPkgs;
|
|
|
|
}
|