Remove uses of __overrides feature

In addition to replacing use of a feature with IMO confusing semantics,
this will also let us cleanly separate out all-packages.nix into
category-specific files without changing the structure of the pkgs
attrset.

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-12-30 11:04:45 -05:00
parent f529e91501
commit 4af1c79c06
4 changed files with 19 additions and 27 deletions

View file

@ -1,7 +1,5 @@
{ callPackage, self, stdenv, gettext, gvfs, libunique, overrides ? {} }: { callPackage, self, stdenv, gettext, gvfs, libunique, overrides ? {} }:
{ let overridden = set // overrides; set = with overridden; {
__overrides = overrides;
# Backward compatibility. # Backward compatibility.
gtkdoc = self.gtk_doc; gtkdoc = self.gtk_doc;
startupnotification = self.startup_notification; startupnotification = self.startup_notification;
@ -117,4 +115,4 @@
libglademm = callPackage ./bindings/libglademm { }; libglademm = callPackage ./bindings/libglademm { };
} }; in overridden

View file

@ -129,19 +129,17 @@ let
# The package compositions. Yes, this isn't properly indented. # The package compositions. Yes, this isn't properly indented.
pkgsFun = pkgs: __overrides: pkgsFun = pkgs: overrides:
with helperFunctions; with helperFunctions;
let defaultScope = pkgs // pkgs.xorg; in let defaultScope = pkgs // pkgs.xorg; self = self_ // overrides;
helperFunctions // rec { self_ = with self; helperFunctions // {
# `__overrides' is a magic attribute that causes the attributes in
# its value to be added to the surrounding `rec'. We'll remove this
# eventually.
inherit __overrides pkgs;
# Make some arguments passed to all-packages.nix available # Make some arguments passed to all-packages.nix available
inherit system stdenvType platform; inherit system stdenvType platform;
# Allow callPackage to fill in the pkgs argument
inherit pkgs;
# We use `callPackage' to be able to omit function arguments that # We use `callPackage' to be able to omit function arguments that
# can be obtained from `pkgs' or `pkgs.xorg' (i.e. `defaultScope'). # can be obtained from `pkgs' or `pkgs.xorg' (i.e. `defaultScope').
@ -6033,7 +6031,7 @@ let
perlPackages = recurseIntoAttrs (import ./perl-packages.nix { perlPackages = recurseIntoAttrs (import ./perl-packages.nix {
inherit pkgs; inherit pkgs;
__overrides = (config.perlPackageOverrides or (p: {})) pkgs; overrides = (config.perlPackageOverrides or (p: {})) pkgs;
}); });
perl510Packages = import ./perl-packages.nix { perl510Packages = import ./perl-packages.nix {
@ -6041,7 +6039,7 @@ let
perl = perl510; perl = perl510;
buildPerlPackage = import ../development/perl-modules/generic perl510; buildPerlPackage = import ../development/perl-modules/generic perl510;
}; };
__overrides = (config.perl510PackageOverrides or (p: {})) pkgs; overrides = (config.perl510PackageOverrides or (p: {})) pkgs;
}; };
perl514Packages = import ./perl-packages.nix { perl514Packages = import ./perl-packages.nix {
@ -6049,7 +6047,7 @@ let
perl = perl514; perl = perl514;
buildPerlPackage = import ../development/perl-modules/generic perl514; buildPerlPackage = import ../development/perl-modules/generic perl514;
}; };
__overrides = (config.perl514PackageOverrides or (p: {})) pkgs; overrides = (config.perl514PackageOverrides or (p: {})) pkgs;
}; };
perlXMLParser = perlPackages.XMLParser; perlXMLParser = perlPackages.XMLParser;
@ -6177,7 +6175,7 @@ let
rPackages = recurseIntoAttrs (import ./r-packages.nix { rPackages = recurseIntoAttrs (import ./r-packages.nix {
inherit pkgs; inherit pkgs;
__overrides = (config.rPackageOverrides or (p: {})) pkgs; overrides = (config.rPackageOverrides or (p: {})) pkgs;
}); });
### SERVERS ### SERVERS
@ -10469,4 +10467,4 @@ let
adobeReader = adobe-reader; adobeReader = adobe-reader;
}; in pkgs }; in self; in pkgs

View file

@ -5,16 +5,14 @@
for each package in a separate file: the call to the function would for each package in a separate file: the call to the function would
be almost as must code as the function itself. */ be almost as must code as the function itself. */
{pkgs, __overrides}: {pkgs, overrides}:
rec { let self = _self // overrides; _self = with self; {
inherit (pkgs) buildPerlPackage fetchurl stdenv perl fetchsvn gnused; inherit (pkgs) buildPerlPackage fetchurl stdenv perl fetchsvn gnused;
inherit (stdenv.lib) maintainers; inherit (stdenv.lib) maintainers;
inherit __overrides;
# Helper functions for packages that use Module::Build to build. # Helper functions for packages that use Module::Build to build.
buildPerlModule = { buildInputs ? [], ... } @ args: buildPerlModule = { buildInputs ? [], ... } @ args:
buildPerlPackage (args // { buildPerlPackage (args // {
@ -9369,4 +9367,4 @@ rec {
}; };
}; };
} }; in self

View file

@ -1,15 +1,13 @@
/* This file defines the composition for CRAN (R) packages. */ /* This file defines the composition for CRAN (R) packages. */
{pkgs, __overrides}: {pkgs, overrides}:
rec { let self = _self // overrides; _self = with self; {
inherit (pkgs) buildRPackage fetchurl stdenv R; inherit (pkgs) buildRPackage fetchurl stdenv R;
inherit (stdenv.lib) maintainers; inherit (stdenv.lib) maintainers;
inherit __overrides;
abind = buildRPackage rec { abind = buildRPackage rec {
name = "abind-1.4-0"; name = "abind-1.4-0";
src = fetchurl { src = fetchurl {
@ -243,4 +241,4 @@ rec {
}; };
propagatedBuildInputs = [ DBI gsubfn proto chron RSQLite RSQLiteExtfuns ]; propagatedBuildInputs = [ DBI gsubfn proto chron RSQLite RSQLiteExtfuns ];
}; };
} }; in self