mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-18 05:39:58 +00:00
The CHICKEN 6 set was added as a copy of the CHICKEN 5 one, following the
existing 4-vs-5 split, but the two releases only really differ in the
compiler's version, its egg binary version, and the egg channel their eggs
come from. Everything else -- the compiler derivation, the egg builder, the
scope that ties them together, the egg metadata reader and the script that
generates the egg set -- now lives in common/, and each release directory
keeps only what is genuinely per release: deps.toml, overrides.nix, and the
arguments in default.nix.
CHICKEN 4 is left alone. It predates deps.toml and update.sh, it patches and
regenerates the compiler's own sources, and it is no longer supported
upstream, so it has little to share.
Aligning the two expressions changes the CHICKEN 5 compiler derivation:
- The bootstrap stage is gone. Building a throwaway compiler and rebuilding
with it is a leftover of the CHICKEN 4 expression, which patches Scheme
sources and therefore needs a working CHICKEN to regenerate the C files.
CHICKEN 5 needs no patch and its tarball ships the generated C files.
- checkTarget is set, so the test suite now actually runs. The generic
check phase probes for a target with a bare `make`, which fails here
because PLATFORM is only given in makeFlags, so the suite was silently
skipped. It passes: 76 sections, in 12 minutes, with the two tests the
expression disables in postPatch still disabled.
- dontConfigure is set. CHICKEN 5 has no configure script at all, so this
is a no-op for it; it is CHICKEN 6, whose hand-written configure rejects
the options stdenv passes, that needs it.
- The setup hook is generated from the binary version with replaceVars,
rather than kept as one copy per release.
The egg builder gains the CHICKEN 6 egg cache export, which is harmless for
CHICKEN 5, and loses an unused binding. As @DerGuteMoritz notes in review,
the export only needs doing once: the install phase runs in the same shell as
the build phase.
Every CHICKEN 5 egg therefore rebuilds, with no expected change to what they
contain.
Sharing the expression also shares its meta, so Xophmeister, who added the
CHICKEN 6 set, is now listed as a maintainer of CHICKEN 5 as well.
Assisted-by: Claude Code (claude-opus-5[1m])
108 lines
3.4 KiB
Nix
108 lines
3.4 KiB
Nix
{
|
|
lib,
|
|
newScope,
|
|
fetchurl,
|
|
|
|
# Release-specific arguments, supplied by the per-release directory.
|
|
version,
|
|
hash,
|
|
binaryVersion,
|
|
postPatch ? "",
|
|
# Generated by ./update.sh; see the CHICKEN section of the Nixpkgs manual.
|
|
depsFile,
|
|
overridesFile,
|
|
# Modules which are part of chicken itself, but which some eggs declare as
|
|
# dependencies. They need not (and cannot) be installed as eggs, so they are
|
|
# removed from the dependency lists instead of marking those eggs as broken.
|
|
# Which modules are built in changes between releases, hence the argument.
|
|
invalidDependencies,
|
|
}:
|
|
let
|
|
# Upstream serves eggs per major release, so the major version selects both
|
|
# the egg channel and the documentation it is described in.
|
|
majorVersion = lib.versions.major version;
|
|
in
|
|
lib.makeScope newScope (self: {
|
|
|
|
fetchegg =
|
|
{
|
|
pname,
|
|
version,
|
|
sha256,
|
|
...
|
|
}:
|
|
fetchurl {
|
|
inherit sha256;
|
|
url = "https://code.call-cc.org/egg-tarballs/${majorVersion}/${pname}/${pname}-${version}.tar.gz";
|
|
};
|
|
|
|
eggDerivation = self.callPackage ./eggDerivation.nix { inherit overridesFile; };
|
|
|
|
chicken = self.callPackage ./chicken.nix {
|
|
inherit
|
|
version
|
|
hash
|
|
binaryVersion
|
|
postPatch
|
|
;
|
|
};
|
|
|
|
chickenEggs = lib.recurseIntoAttrs (
|
|
lib.makeScope self.newScope (
|
|
eggself:
|
|
(lib.mapAttrs (
|
|
pname:
|
|
eggData@{
|
|
version,
|
|
synopsis,
|
|
dependencies,
|
|
license,
|
|
...
|
|
}:
|
|
self.eggDerivation {
|
|
inherit pname version;
|
|
src = self.fetchegg (eggData // { inherit pname; });
|
|
buildInputs = map (x: eggself.${x}) (lib.subtractLists invalidDependencies dependencies);
|
|
meta.homepage = "https://wiki.call-cc.org/eggref/${majorVersion}/${pname}";
|
|
meta.description = synopsis;
|
|
meta.license =
|
|
(
|
|
lib.licenses
|
|
// {
|
|
"agpl" = lib.licenses.agpl3Only;
|
|
"artistic" = lib.licenses.artistic2;
|
|
"bsd" = lib.licenses.bsd3;
|
|
"bsd-0-clause" = lib.licenses.bsd0;
|
|
"bsd-1-clause" = lib.licenses.bsd1;
|
|
"bsd-2" = lib.licenses.bsd2;
|
|
"bsd-2-clause" = lib.licenses.bsd2;
|
|
"bsd-3" = lib.licenses.bsd3;
|
|
"bsd-3-clause" = lib.licenses.bsd3;
|
|
"gpl" = lib.licenses.gpl3Only;
|
|
"gpl-2" = lib.licenses.gpl2Only;
|
|
"gplv2" = lib.licenses.gpl2Only;
|
|
"gpl-3" = lib.licenses.gpl3Only;
|
|
"gpl-3.0" = lib.licenses.gpl3Only;
|
|
"gplv3" = lib.licenses.gpl3Only;
|
|
"lgpl" = lib.licenses.lgpl3Only;
|
|
"lgpl-2" = lib.licenses.lgpl2Only;
|
|
"lgpl-2.0+" = lib.licenses.lgpl2Plus;
|
|
"lgpl-2.1" = lib.licenses.lgpl21Only;
|
|
"lgpl-2.1-or-later" = lib.licenses.lgpl21Plus;
|
|
"lgpl-3" = lib.licenses.lgpl3Only;
|
|
"lgplv3" = lib.licenses.lgpl3Only;
|
|
"lgpl-3.0-or-later" = lib.licenses.lgpl3Plus;
|
|
"public-domain" = lib.licenses.publicDomain;
|
|
"srfi" = lib.licenses.bsd3;
|
|
"unicode" = lib.licenses.ucd;
|
|
"unknown" = lib.licenses.free;
|
|
"zlib-acknowledgement" = lib.licenses.zlib;
|
|
}
|
|
).${license} or license;
|
|
}
|
|
) (lib.importTOML depsFile))
|
|
)
|
|
);
|
|
|
|
})
|