[Nix-dev] [Want to commit this week] deepOverride replacement when callPackage is used
Michael Raskin
7c6f434c at mail.ru
Thu Sep 2 13:47:54 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello.
[Summary: right now it is hard to build a package with recursively
replaced glib; there is a way that works - look at code snippets and
comment on them.
I see no reasons not to commit these changes in a couple of days after
checking them on Empathy build, unless some problems with the changes
are pointed out]
Soon after we had a discussion about avoiding deepOverride,
all-packages.nix changed to callPackage style and the proposed solution
stopped working.
Part one: gtkLibs220 has no __overrides. So gtk depends on default glib
unless you basically copy-paste everything. Proposed solution
(instantiation checked, gives the same unless you use overrides):
- ------------ CODE ------------------
gtkLibs220 = recurseIntoAttrs (makeOverridable
(overrides :
(let
callPackage = newScope self;
self = rec {
[snip]
} // overrides;
in self)) {});
- ------------ END CODE --------------
Part two: callPackage uses default pkgs (with overrides from
config.nix). When you override gtkLibs, gnome subset gets old glib
whatever I do (and I guess overriding gtk would be even worse).
Proposal:
- ------------ CODE ------------------
move
callPackage = newScope {};
newScope = extra: lib.callPackageWith (defaultScope // extra);
defaultScope = pkgs // pkgs.xorg;
inside pkgsFun result body.
- ------------ END CODE --------------
Possible alternatives: convert pkgsFun the same way as gtkLibs220.
My plan: finish building Empathy (which needs that and more) as a
check, commit "conservative part" (some telepathy and gnome libraries)
right after that. If no reasons are given why the proposed composition
changes are bad, commit them too.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMf47qAAoJEE6tnN0aWvw3zmgH/jp6edXRPmFrTHAgJz44ezq3
zQEpgEk6RSdiP9rgrRy+UUhbut9BmLJ4QrZvuSqn7ZQuMePyiGxphAG68bKvdOWH
K6324es8BJPcidD4Z7oDKPcZ6A6JT9nHAJwjv4Ldph38+oNOFdn702xExeJ6hba0
FNTH0l2h7v7DSaeu9jW6rEdSFRe1yAFcNZOTyAcGQpvjkaBFdAmtIZAXGX7Mh5rh
p0XwWgJHV3Uekr9XwX0pOAn2e4B3DrY32T+5xz7c+YeLNfkCDsvwctq8bL0sU+Ps
U0nPiEPLeXCqYdsSItL67w2qnScYN7DhKhWGPJP0KIlxPpHDI9uQINQlQBH+XL8=
=7Tps
-----END PGP SIGNATURE-----
More information about the nix-dev
mailing list