From 69f1045001a32a45de891f3c2264d09b1955a7f2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jul 2018 15:47:10 -0400 Subject: [PATCH] treewide: remove forceSystem --- pkgs/os-specific/gnu/default.nix | 4 +-- pkgs/top-level/stage.nix | 44 ++++++++++++++------------------ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix index 478040132b82..5dc52c766f18 100644 --- a/pkgs/os-specific/gnu/default.nix +++ b/pkgs/os-specific/gnu/default.nix @@ -3,7 +3,7 @@ args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool , texinfo, glibcCross, hurdPartedCross, libuuid, samba , gccCrossStageStatic, gcc -, forceSystem, newScope, platform, config +, pkgsi686Linux, newScope, platform, config , targetPlatform, buildPlatform , overrides ? {} , buildPackages, pkgs @@ -90,7 +90,7 @@ let mig = callPackage ./mig { # Build natively, but force use of a 32-bit environment because we're # targeting `i586-pc-gnu'. - stdenv = (forceSystem "i686-linux" "i386").stdenv; + stdenv = pkgsi686Linux.stdenv; }; # XXX: Use this one for its `.crossDrv'. Using the one above from diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 39dd00b66d52..20770bd6f324 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -124,31 +124,7 @@ let # - pkgsCross. where system is a member of lib.systems.examples # - pkgsMusl # - pkgsi686Linux - # - # In addition some utility functions are included for creating the - # above sets. - # - # - forceLibc - # - forceSystem - otherPackageSets = self: super: { - # This maps each entry in lib.systems.examples to its own package - # set. Each of these will contain all packages cross compiled for - # that target system. For instance, pkgsCross.rasberryPi.hello, - # will refer to the "hello" package built for the ARM6-based - # Raspberry Pi. - pkgsCross = lib.mapAttrs (n: crossSystem: - nixpkgsFun { inherit crossSystem; }) - lib.systems.examples; - - # All packages built with the Musl libc. This will override the - # default GNU libc on Linux systems. Non-Linux systems are not - # supported. - pkgsMusl = self.forceLibc "musl"; - - # All packages built for i686 Linux. - # Used by wine, firefox with debugging version of Flash, ... - pkgsi686Linux = self.forceSystem "i686-linux" "i386"; - + otherPackageSets = self: super: let # Override default libc. Currently this is only useful on Linux # systems where you have the choice between Musl & Glibc. In the # future it may work for other things. @@ -166,6 +142,24 @@ let platform = stdenv.hostPlatform.platform // { inherit kernelArch; }; }; }; + in { + # This maps each entry in lib.systems.examples to its own package + # set. Each of these will contain all packages cross compiled for + # that target system. For instance, pkgsCross.rasberryPi.hello, + # will refer to the "hello" package built for the ARM6-based + # Raspberry Pi. + pkgsCross = lib.mapAttrs (n: crossSystem: + nixpkgsFun { inherit crossSystem; }) + lib.systems.examples; + + # All packages built with the Musl libc. This will override the + # default GNU libc on Linux systems. Non-Linux systems are not + # supported. + pkgsMusl = forceLibc "musl"; + + # All packages built for i686 Linux. + # Used by wine, firefox with debugging version of Flash, ... + pkgsi686Linux = forceSystem "i686-linux" "i386"; }; # The complete chain of package set builders, applied from top to bottom.