__splicedPackages: Don't include xorg

For historical reasons, callPackage has the xorg packages in scope. This
unstable building block is more versatile without the xorg hack baked in.
This commit is contained in:
John Ericson 2018-10-11 12:27:49 -04:00
parent bfef8113f6
commit dc214ed99b

View File

@ -24,15 +24,6 @@
lib: pkgs: actuallySplice: lib: pkgs: actuallySplice:
let let
defaultBuildBuildScope = pkgs.buildPackages.buildPackages // pkgs.buildPackages.buildPackages.xorg;
defaultBuildHostScope = pkgs.buildPackages // pkgs.buildPackages.xorg;
defaultBuildTargetScope =
if pkgs.stdenv.targetPlatform == pkgs.stdenv.hostPlatform
then defaultBuildHostScope
else assert pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform; defaultHostTargetScope;
defaultHostHostScope = {}; # unimplemented
defaultHostTargetScope = pkgs // pkgs.xorg;
defaultTargetTargetScope = pkgs.targetPackages // pkgs.targetPackages.xorg or {};
spliceReal = { pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget spliceReal = { pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
, pkgsHostHost, pkgsHostTarget , pkgsHostHost, pkgsHostTarget
@ -105,19 +96,24 @@ let
} @ args: } @ args:
if actuallySplice then spliceReal args else pkgsHostTarget; if actuallySplice then spliceReal args else pkgsHostTarget;
splicedPackages = splicePackages { splicedPackages = splicePackages rec {
pkgsBuildBuild = defaultBuildBuildScope; pkgsBuildBuild = pkgs.buildPackages.buildPackages;
pkgsBuildHost = defaultBuildHostScope; pkgsBuildHost = pkgs.buildPackages;
pkgsBuildTarget = defaultBuildTargetScope; pkgsBuildTarget =
pkgsHostHost = defaultHostHostScope; if pkgs.stdenv.targetPlatform == pkgs.stdenv.hostPlatform
pkgsHostTarget = defaultHostTargetScope; then pkgsBuildHost
pkgsTargetTarget = defaultTargetTargetScope; else assert pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform; pkgsHostTarget;
pkgsHostHost = {}; # unimplemented
pkgsHostTarget = pkgs;
pkgsTargetTarget = pkgs.targetPackages;
} // { } // {
# These should never be spliced under any circumstances # These should never be spliced under any circumstances
inherit (pkgs) pkgs buildPackages targetPackages; inherit (pkgs) pkgs buildPackages targetPackages;
inherit (pkgs.stdenv) buildPlatform targetPlatform hostPlatform; inherit (pkgs.stdenv) buildPlatform targetPlatform hostPlatform;
}; };
splicedPackagesWithXorg = splicedPackages // splicedPackages.xorg;
in in
{ {
@ -128,9 +124,9 @@ in
# `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below). # `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below).
callPackage = pkgs.newScope {}; callPackage = pkgs.newScope {};
callPackages = lib.callPackagesWith splicedPackages; callPackages = lib.callPackagesWith splicedPackagesWithXorg;
newScope = extra: lib.callPackageWith (splicedPackages // extra); newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
# Haskell package sets need this because they reimplement their own # Haskell package sets need this because they reimplement their own
# `newScope`. # `newScope`.