Merge pull request #249982 from nagy/chicken-scope

chickenPackages: turn into scope, update
This commit is contained in:
Weijia Wang 2023-08-31 01:05:51 +02:00 committed by GitHub
commit 30c071bebb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 102 additions and 71 deletions

View file

@ -47,3 +47,32 @@ To include more eggs, edit `pkgs/development/compilers/chicken/5/eggs.scm`.
The first section of this file lists eggs which are required by `egg2nix` The first section of this file lists eggs which are required by `egg2nix`
itself; all other eggs go into the second section. After editing, follow the itself; all other eggs go into the second section. After editing, follow the
procedure for updating eggs. procedure for updating eggs.
## Override Scope {#sec-chicken-override-scope}
The chicken package and its eggs, respectively, reside in a scope. This means,
the scope can be overridden to effect other packages in it.
This example shows how to use a local copy of `srfi-180` and have it affect
all the other eggs:
```nix
let
myChickenPackages = pkgs.chickenPackages.overrideScope' (self: super: {
# The chicken package itself can be overridden to effect the whole ecosystem.
# chicken = super.chicken.overrideAttrs {
# src = ...
# };
chickenEggs = super.chickenEggs.overrideScope' (eggself: eggsuper: {
srfi-180 = eggsuper.srfi-180.overrideAttrs {
# path to a local copy of srfi-180
src = ...
};
});
});
in
# Here, `myChickenPackages.chickenEggs.json-rpc`, which depends on `srfi-180` will use
# the local copy of `srfi-180`.
# ...
```

View file

@ -18,4 +18,4 @@ let
egg2nix = callPackage ./egg2nix.nix { }; egg2nix = callPackage ./egg2nix.nix { };
}; };
in lib.recurseIntoAttrs self in self

View file

@ -1,40 +1,42 @@
{ lib, newScope, fetchurl }: { lib, newScope, fetchurl }:
let
callPackage = newScope self;
self = with lib; { lib.makeScope newScope (self: {
inherit callPackage;
fetchegg = { pname, version, sha256, ... }: fetchegg = { pname, version, sha256, ... }:
fetchurl { fetchurl {
inherit sha256; inherit sha256;
url = url =
"https://code.call-cc.org/egg-tarballs/5/${pname}/${pname}-${version}.tar.gz"; "https://code.call-cc.org/egg-tarballs/5/${pname}/${pname}-${version}.tar.gz";
};
eggDerivation = callPackage ./eggDerivation.nix { };
chicken = callPackage ./chicken.nix {
bootstrap-chicken = self.chicken.override { bootstrap-chicken = null; };
}; };
chickenEggs = recurseIntoAttrs (mapAttrs (pname: eggDerivation = self.callPackage ./eggDerivation.nix { };
eggData@{ version, synopsis, dependencies, license, ... }:
self.eggDerivation {
name = "${pname}-${version}";
src = self.fetchegg (eggData // { inherit pname; });
buildInputs = map (x: self.chickenEggs.${x}) dependencies;
meta.homepage =
"https://code.call-cc.org/cgi-bin/gitweb.cgi?p=eggs-5-latest.git;a=tree;f=${pname}/${version}";
meta.description = synopsis;
meta.license = (licenses // {
"bsd-2-clause" = licenses.bsd2;
"bsd-3-clause" = licenses.bsd3;
"public-domain" = licenses.publicDomain;
}).${license} or license;
}) (importTOML ./deps.toml));
egg2nix = callPackage ./egg2nix.nix { }; chicken = self.callPackage ./chicken.nix {
bootstrap-chicken = self.chicken.override { bootstrap-chicken = null; };
}; };
in lib.recurseIntoAttrs self chickenEggs = lib.recurseIntoAttrs (lib.makeScope self.newScope (eggself:
(lib.mapAttrs
(pname:
eggData@{ version, synopsis, dependencies, license, ... }:
self.eggDerivation {
name = "${pname}-${version}";
src = self.fetchegg (eggData // { inherit pname; });
buildInputs = map (x: eggself.${x}) dependencies;
meta.homepage =
"https://code.call-cc.org/cgi-bin/gitweb.cgi?p=eggs-5-latest.git;a=tree;f=${pname}/${version}";
meta.description = synopsis;
meta.license = (lib.licenses // {
"bsd-1-clause" = lib.licenses.bsd1;
"bsd-2-clause" = lib.licenses.bsd2;
"bsd-3-clause" = lib.licenses.bsd3;
"lgpl-2.0+" = lib.licenses.lgpl2Plus;
"lgpl-2.1-or-later" = lib.licenses.lgpl21Plus;
"public-domain" = lib.licenses.publicDomain;
}).${license} or license;
})
(lib.importTOML ./deps.toml))));
egg2nix = self.callPackage ./egg2nix.nix { };
})

View file

@ -107,9 +107,9 @@ version = "0.6"
[apropos] [apropos]
dependencies = ["srfi-1", "utf8", "string-utils", "symbol-utils", "check-errors"] dependencies = ["srfi-1", "utf8", "string-utils", "symbol-utils", "check-errors"]
license = "bsd" license = "bsd"
sha256 = "1xnqfnbnac4pzm4j3mphq09p18q962dxg11cfyxqk8k6v8qrv5nh" sha256 = "0njkdxwd9122l9vql64nqm7dy3lggikr2bzwidwk7i8yz3nm3g6w"
synopsis = "CHICKEN apropos" synopsis = "CHICKEN apropos"
version = "3.7.2" version = "3.8.1"
[arcadedb] [arcadedb]
dependencies = ["uri-common", "medea"] dependencies = ["uri-common", "medea"]
@ -282,9 +282,9 @@ version = "1.37"
[bitwise-utils] [bitwise-utils]
dependencies = [] dependencies = []
license = "public-domain" license = "public-domain"
sha256 = "09fdcv81069br4pz0ccr2jj6xgakvwbshdiy21r85865r7r6g05m" sha256 = "065q6ha8wsj6qhg7zxkaj2qrj5sm3iz2v7shcp5wh7j3fqwbs5q5"
synopsis = "Bitwise utilities" synopsis = "Bitwise utilities"
version = "1.2.5" version = "1.3.0"
[blas] [blas]
dependencies = ["bind", "compile-file", "srfi-13"] dependencies = ["bind", "compile-file", "srfi-13"]
@ -364,11 +364,11 @@ synopsis = "Byte array utility procedures for blobs."
version = "2.3" version = "2.3"
[cairo] [cairo]
dependencies = [] dependencies = ["srfi-1"]
license = "lgpl-2.1" license = "lgpl-2.1"
sha256 = "1krsjlydqa9zj0bpad0w4x636kg30ng1azlyyn8j8vx3b8lcd362" sha256 = "1x69i4aysn8mf93ic36947p6gvgglk8c0vg2m6vdhimf6y65szi1"
synopsis = "Chicken bindings for Cairo, a vector graphics library" synopsis = "Chicken bindings for Cairo, a vector graphics library"
version = "0.1.17" version = "0.1.18"
[call-table-generics] [call-table-generics]
dependencies = ["brev-separate"] dependencies = ["brev-separate"]
@ -1157,9 +1157,9 @@ version = "0.4.2"
[gochan] [gochan]
dependencies = ["matchable", "srfi-18", "queues"] dependencies = ["matchable", "srfi-18", "queues"]
license = "bsd" license = "bsd"
sha256 = "1yp3yzfx97qfx8kkxvjvs1vnr2h8iffnx1zaqq05dbh5ivnx74j8" sha256 = "1pyzr387zbbw7x9zk524qcs368hzxv4c46p24cz3x2nl30y84d5h"
synopsis = "golang channels in CHICKEN" synopsis = "golang channels in CHICKEN"
version = "5.2.9" version = "5.2.10"
[graph-bfs] [graph-bfs]
dependencies = ["srfi-1", "iset", "matchable", "yasos", "digraph"] dependencies = ["srfi-1", "iset", "matchable", "yasos", "digraph"]
@ -1213,9 +1213,9 @@ version = "0.10.1"
[hash-trie] [hash-trie]
dependencies = [] dependencies = []
license = "mit" license = "mit"
sha256 = "0kcr99fdc0b09inq8ansb79ynblcxryvsg67zfms5y7z91v11p0c" sha256 = "1860bp5h3kh0ra6b2qvb5pccylajq1x2hng0skqnv8ik068lnfr0"
synopsis = "hash-trie" synopsis = "hash-trie"
version = "1.1.7" version = "1.1.8"
[heap-o-rama] [heap-o-rama]
dependencies = ["srfi-18"] dependencies = ["srfi-18"]
@ -1395,9 +1395,9 @@ version = "0.3"
[ipfs] [ipfs]
dependencies = ["http-client", "intarweb", "medea", "srfi-1", "srfi-13", "srfi-189", "srfi-197", "uri-common"] dependencies = ["http-client", "intarweb", "medea", "srfi-1", "srfi-13", "srfi-189", "srfi-197", "uri-common"]
license = "unlicense" license = "unlicense"
sha256 = "1cxjbl5kl4xk42a4p8j3av6ip0gqvp5yxahsccvm0snc98n3ngqg" sha256 = "1mw6z3piddy9xz494kv0243jhhirlb1dp15dph2p1ks4bhipbr4m"
synopsis = "IPFS HTTP API for Scheme" synopsis = "IPFS HTTP API for Scheme"
version = "0.0.12" version = "0.0.13"
[irc] [irc]
dependencies = ["matchable", "regex", "srfi-1"] dependencies = ["matchable", "regex", "srfi-1"]
@ -1556,9 +1556,9 @@ version = "1.2.1"
[list-utils] [list-utils]
dependencies = ["utf8", "srfi-1", "check-errors"] dependencies = ["utf8", "srfi-1", "check-errors"]
license = "bsd" license = "bsd"
sha256 = "0wqmsvh3sfgp8ssh98n8y615lxnjlcda1k375jfss7vf8k5xn032" sha256 = "0sbd04kmiahk7mbw1cy64n1qjz2rpldjx66aj41r964kjscm6izv"
synopsis = "list-utils" synopsis = "list-utils"
version = "2.4.3" version = "2.5.1"
[live-define] [live-define]
dependencies = ["matchable"] dependencies = ["matchable"]
@ -1794,9 +1794,9 @@ version = "0.7"
[micro-benchmark] [micro-benchmark]
dependencies = ["micro-stats", "srfi-1"] dependencies = ["micro-stats", "srfi-1"]
license = "gplv3" license = "gplv3"
sha256 = "0ahvxdm350bc9v80gnb8ccmjqqp60jznfjkx7w5ypf0q61mnj8sj" sha256 = "022fkwr1wm1im40rgk3g5dz8n4rvlw1zdmskqsh9idv31gbfi456"
synopsis = "Easily create micro-benchmarks" synopsis = "Easily create micro-benchmarks"
version = "0.0.19" version = "0.0.20"
[micro-stats] [micro-stats]
dependencies = ["srfi-1", "sequences", "sequences-utils"] dependencies = ["srfi-1", "sequences", "sequences-utils"]
@ -2333,9 +2333,9 @@ version = "2.1.2"
[rlimit] [rlimit]
dependencies = ["srfi-13"] dependencies = ["srfi-13"]
license = "bsd" license = "bsd"
sha256 = "0jmz98253k3q9a6kyyby6jm722w3s74c5y3km7ih9ybjjmcdkyzv" sha256 = "1yxdn9y11i8s9mj5dknlpz588d48bklylxcq73v0s48a5m7vfpwp"
synopsis = "Setting resource limits" synopsis = "Setting resource limits"
version = "1.0.1" version = "1.0.2"
[rocksdb] [rocksdb]
dependencies = [] dependencies = []
@ -2368,9 +2368,9 @@ version = "0.9.12"
[s9fes-char-graphics] [s9fes-char-graphics]
dependencies = ["srfi-1", "utf8", "format"] dependencies = ["srfi-1", "utf8", "format"]
license = "public-domain" license = "public-domain"
sha256 = "1h12l59860cyv8xwvvpf96dnlqwd25mrq2qapj9nyxv0vbkcs4p6" sha256 = "1ysz8vrx7zwfv4drx955ca28avmdfilafd9a20sl67y5vwb47i8m"
synopsis = "Scheme 9 from Empty Space Char Graphics" synopsis = "Scheme 9 from Empty Space Char Graphics"
version = "1.3.3" version = "1.4.2"
[salmonella-diff] [salmonella-diff]
dependencies = ["salmonella", "salmonella-html-report", "srfi-1", "srfi-13", "sxml-transforms"] dependencies = ["salmonella", "salmonella-html-report", "srfi-1", "srfi-13", "sxml-transforms"]
@ -2508,9 +2508,9 @@ version = "1.9.1"
[sequences-utils] [sequences-utils]
dependencies = ["srfi-1", "srfi-69", "sequences"] dependencies = ["srfi-1", "srfi-69", "sequences"]
license = "bsd" license = "bsd"
sha256 = "0s5yadn034a3g89xjcy0yxga7k60dadcnynv16yvbcfg4wjrs81k" sha256 = "1c0yq4bzq6lkax4pwky5vyb2gl0yw88r7fzsbx37xsw14lb4fl64"
synopsis = "(More) Generic sequence operators" synopsis = "(More) Generic sequence operators"
version = "0.4.0" version = "0.5.0"
[sequences] [sequences]
dependencies = ["fast-generic", "srfi-42"] dependencies = ["fast-generic", "srfi-42"]
@ -3047,9 +3047,9 @@ version = "0.2.3"
[srfi-18] [srfi-18]
dependencies = [] dependencies = []
license = "bsd" license = "bsd"
sha256 = "0v2pkdck0ji1wiqgg8sg4z6rbkj2qw4vy4b9lx0w0pmhlxqpg1xd" sha256 = "0mkg3g045md9v74p4ac24q0c4xvvinz1nggakyg7wlg7c176i2l9"
synopsis = "SRFI-18 thread library" synopsis = "SRFI-18 thread library"
version = "0.1.6" version = "0.1.7"
[srfi-180] [srfi-180]
dependencies = ["r7rs", "srfi-60", "srfi-145", "srfi-121"] dependencies = ["r7rs", "srfi-60", "srfi-145", "srfi-121"]
@ -3068,9 +3068,9 @@ version = "1.0.3"
[srfi-19] [srfi-19]
dependencies = ["srfi-1", "utf8", "srfi-18", "srfi-29", "srfi-69", "miscmacros", "locale", "record-variants", "check-errors"] dependencies = ["srfi-1", "utf8", "srfi-18", "srfi-29", "srfi-69", "miscmacros", "locale", "record-variants", "check-errors"]
license = "bsd" license = "bsd"
sha256 = "14nyv6m67k2angmhg028rd50mq77qi1zfr5f0praiyy07k2pmcpz" sha256 = "0mq9nd1ck1qq9bs415xw4sqlbw1jcrg9n1vrh8kiqy197xbymh0h"
synopsis = "Time Data Types and Procedures" synopsis = "Time Data Types and Procedures"
version = "4.7.3" version = "4.7.5"
[srfi-193] [srfi-193]
dependencies = [] dependencies = []
@ -3159,9 +3159,9 @@ version = "4.2.2"
[srfi-29] [srfi-29]
dependencies = ["srfi-1", "srfi-69", "utf8", "locale", "posix-utils", "condition-utils", "check-errors"] dependencies = ["srfi-1", "srfi-69", "utf8", "locale", "posix-utils", "condition-utils", "check-errors"]
license = "bsd" license = "bsd"
sha256 = "1wxz4kj6dqylfiqi035vzsphgbj68y6wwivmx25z5j11c8v3s81c" sha256 = "15g2knq5b76f3nhxnmxidhkvbw9dyyc00hrzvsnpkmnfqzcmxbxw"
synopsis = "Localization" synopsis = "Localization"
version = "3.0.6" version = "3.0.7"
[srfi-34] [srfi-34]
dependencies = [] dependencies = []
@ -3647,11 +3647,11 @@ synopsis = "tracing and breakpoints"
version = "2.0" version = "2.0"
[transducers] [transducers]
dependencies = ["srfi-1", "srfi-128", "srfi-133", "srfi-143", "srfi-146", "srfi-160", "check-errors"] dependencies = ["srfi-1", "srfi-128", "srfi-133", "srfi-143", "srfi-146", "srfi-160", "check-errors", "r7rs"]
license = "mit" license = "mit"
sha256 = "0mkrrfvskwgy5w8c9gz21np3p9857sm8fylq0hjz608jaxzybpcz" sha256 = "162f0xvk69jha55sszdkgm47q18k3x5bc2g6psn2107im4ma45fi"
synopsis = "Transducers for working with foldable data types." synopsis = "Transducers for working with foldable data types."
version = "0.4.0" version = "0.4.2"
[transmission] [transmission]
dependencies = ["http-client", "intarweb", "medea", "r7rs", "srfi-1", "srfi-189", "uri-common"] dependencies = ["http-client", "intarweb", "medea", "r7rs", "srfi-1", "srfi-189", "uri-common"]
@ -3789,9 +3789,9 @@ version = "3.6.3"
[uuid-lib] [uuid-lib]
dependencies = ["record-variants"] dependencies = ["record-variants"]
license = "bsd" license = "bsd"
sha256 = "0da71k0f3j1l9wjnfk9gqs9gw3v1192xhxbxv2gfmah3fvxf203p" sha256 = "1hk5p2yvwq4dx93a1wnxggrbwkh050b6m9jlw44s7xvhxhvdqyns"
synopsis = "OSF DCE 1.1 UUID" synopsis = "OSF DCE 1.1 UUID"
version = "0.0.10" version = "0.0.14"
[uuid] [uuid]
dependencies = [] dependencies = []
@ -3915,9 +3915,9 @@ version = "0.2"
[zshbrev] [zshbrev]
dependencies = ["brev"] dependencies = ["brev"]
license = "lgplv3" license = "lgplv3"
sha256 = "16sn87z72x8d4ddbkwgz1jxas471r5nvazwi0klsn204v1qc30dy" sha256 = "1id8a728ibi3fzcpfdd7ary41g7nrlb7pc3vjpmz70jp1q53qppx"
synopsis = "Access Chicken functions from any shell and access zsh functions from Chicken" synopsis = "Access Chicken functions from any shell and access zsh functions from Chicken"
version = "1.19" version = "1.20"
[zstd] [zstd]
dependencies = [] dependencies = []

View file

@ -15510,8 +15510,8 @@ with pkgs;
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; }; colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; };
colmapWithCuda = colmap.override { cudaSupport = true; }; colmapWithCuda = colmap.override { cudaSupport = true; };
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { }; chickenPackages_4 = recurseIntoAttrs (callPackage ../development/compilers/chicken/4 { });
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { }; chickenPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/chicken/5 { });
chickenPackages = dontRecurseIntoAttrs chickenPackages_5; chickenPackages = dontRecurseIntoAttrs chickenPackages_5;
inherit (chickenPackages_5) inherit (chickenPackages_5)