git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #42874 from obsidiansystems/crossPkgs

Add pkgsCross & pkgsLocal

commitccfe1b5713ffe10cd2242766a90074b423f48fa5 authorJohn Ericson <Ericson2314@yahoo.com> dateMon 2 Jul 2018, 13:25 (8 years ago) parenta444ed318af089
2 files changed+30−27
pkgs/top-level/all-packages.nix+3−26 pkgs/top-level/stage.nix+27−1
pkgs/top-level/all-packages.nix+3−26
@@ -5,7 +5,7 @@
55 * to merges. Please use the full-text search of your editor. ;)
66 * Hint: ### starts category names.
77 */
8−{ lib, nixpkgsFun, noSysDirs, config}:
8+{ lib, noSysDirs, config}:
99self: pkgs:
1010
1111with pkgs;
@@ -15,22 +15,6 @@ with pkgs;
1515 # Allow callPackage to fill in the pkgs argument
1616 inherit pkgs;
1717
18−
19− # Override system. This is useful to build i686 packages on x86_64-linux.
20− forceSystem = system: kernel: nixpkgsFun {
21− localSystem = {
22− inherit system;
23− platform = platform // { kernelArch = kernel; };
24− };
25− };
26−
27− # Used by wine, firefox with debugging version of Flash, ...
28− pkgsi686Linux = forceSystem "i686-linux" "i386";
29−
30− callPackage_i686 = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
31− then pkgsi686Linux.callPackage
32− else throw "callPackage_i686 not supported on system '${stdenv.system}'";
33−
3418 # A stdenv capable of building 32-bit binaries. On x86_64-linux,
3519 # it uses GCC compiled with multilib support; on i686-linux, it's
3620 # just the plain stdenv.
@@ -2420,7 +2404,7 @@ with pkgs;
24202404 fluentd = callPackage ../tools/misc/fluentd { };
24212405
24222406 flvstreamer = callPackage ../tools/networking/flvstreamer { };
2423−
2407+
24242408 hmetis = callPackage_i686 ../applications/science/math/hmetis { };
24252409
24262410 libbsd = callPackage ../development/libraries/libbsd { };
@@ -5889,14 +5873,7 @@ with pkgs;
58895873 xbursttools = callPackage ../tools/misc/xburst-tools {
58905874 # It needs a cross compiler for mipsel to build the firmware it will
58915875 # load into the Ben Nanonote
5892− gccCross =
5893− let
5894− pkgsCross = nixpkgsFun {
5895− # Ben Nanonote system
5896− crossSystem = lib.systems.examples.ben-nanonote;
5897− };
5898− in
5899− pkgsCross.buildPackages.gccCrossStageStatic;
5876+ gccCross = pkgsCross.ben-nanonote.buildPackages.gccCrossStageStatic;
59005877 };
59015878
59025879 xclip = callPackage ../tools/misc/xclip { };
pkgs/top-level/stage.nix+27−1
@@ -93,7 +93,7 @@ let
9393
9494 allPackages = self: super:
9595 let res = import ./all-packages.nix
96− { inherit lib nixpkgsFun noSysDirs config; }
96+ { inherit lib noSysDirs config; }
9797 res self;
9898 in res;
9999
@@ -117,6 +117,31 @@ let
117117 lib.optionalAttrs allowCustomOverrides
118118 ((config.packageOverrides or (super: {})) super);
119119
120+ # Override system. This is useful to build i686 packages on x86_64-linux.
121+ forceSystem = system: kernel: nixpkgsFun {
122+ localSystem = {
123+ inherit system;
124+ platform = stdenv.hostPlatform.platform // { kernelArch = kernel; };
125+ };
126+ };
127+
128+ # Convenience attributes for instantitating nixpkgs. Each of these
129+ # will instantiate a new version of allPackages. They map example
130+ # attributes to their own thing.
131+ extraPkgs = self: super: {
132+ pkgsCross = lib.mapAttrs (n: crossSystem:
133+ nixpkgsFun { inherit crossSystem; })
134+ lib.systems.examples;
135+ pkgsLocal = lib.mapAttrs (n: localSystem:
136+ nixpkgsFun { inherit localSystem; })
137+ lib.systems.examples;
138+
139+ # Used by wine, firefox with debugging version of Flash, ...
140+ pkgsi686Linux = forceSystem "i686-linux" "i386";
141+ callPackage_i686 = self.pkgsi686Linux.callPackage;
142+ inherit forceSystem;
143+ };
144+
120145 # The complete chain of package set builders, applied from top to bottom.
121146 # stdenvOverlays must be last as it brings package forward from the
122147 # previous bootstrapping phases which have already been overlayed.
@@ -127,6 +152,7 @@ let
127152 trivialBuilders
128153 splice
129154 allPackages
155+ extraPkgs
130156 aliases
131157 configOverrides
132158 ] ++ overlays ++ [