push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,101 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
darwin,
bootstrap-chicken ? null,
testers,
}:
let
platform =
with stdenv;
if isDarwin then
"macosx"
else if isCygwin then
"cygwin"
else if (isFreeBSD || isOpenBSD) then
"bsd"
else if isSunOS then
"solaris"
else
"linux"; # Should be a sane default
in
stdenv.mkDerivation (finalAttrs: {
pname = "chicken";
version = "5.4.0";
binaryVersion = 11;
src = fetchurl {
url = "https://code.call-cc.org/releases/${finalAttrs.version}/chicken-${finalAttrs.version}.tar.gz";
sha256 = "sha256-PF1KphwRZ79tm/nq+JHadjC6n188Fb8JUVpwOb/N7F8=";
};
# Disable two broken tests: "static link" and "linking tests"
postPatch = ''
sed -i tests/runtests.sh -e "/static link/,+4 { s/^/# / }"
sed -i tests/runtests.sh -e "/linking tests/,+11 { s/^/# / }"
'';
setupHook = lib.optional (bootstrap-chicken != null) ./setup-hook.sh;
makeFlags = [
"PLATFORM=${platform}"
"PREFIX=$(out)"
"C_COMPILER=$(CC)"
"CXX_COMPILER=$(CXX)"
]
++ (lib.optionals stdenv.hostPlatform.isDarwin [
"XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin"
"LINKER_OPTIONS=-headerpad_max_install_names"
"POSTINSTALL_PROGRAM=install_name_tool"
])
++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"HOSTSYSTEM=${stdenv.hostPlatform.config}"
"TARGET_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
"TARGET_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
]);
nativeBuildInputs = [
makeWrapper
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
darwin.autoSignDarwinBinariesHook
];
buildInputs = lib.optionals (bootstrap-chicken != null) [
bootstrap-chicken
];
doCheck = !stdenv.hostPlatform.isDarwin;
postCheck = ''
./csi -R chicken.pathname -R chicken.platform \
-p "(assert (equal? \"${toString finalAttrs.binaryVersion}\" (pathname-file (car (repository-path)))))"
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "csi -version";
};
meta = {
homepage = "https://call-cc.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
corngood
nagy
konst-aa
];
platforms = lib.platforms.unix;
description = "Portable compiler for the Scheme programming language";
longDescription = ''
CHICKEN is a compiler for the Scheme programming language.
CHICKEN produces portable and efficient C, supports almost all
of the R5RS Scheme language standard, and includes many
enhancements and extensions. CHICKEN runs on Linux, macOS,
Windows, and many Unix flavours.
'';
};
})

View File

@@ -0,0 +1,90 @@
{
lib,
newScope,
fetchurl,
}:
let
# Some eggs mistakenly declare dependencies on modules which are part of chicken itself and thus
# need not (and cannot) be installed as eggs. Instead of marking such eggs as broken, we remove
# these invalid dependencies.
invalidDependencies = [
"srfi-4"
];
in
lib.makeScope newScope (self: {
fetchegg =
{
pname,
version,
sha256,
...
}:
fetchurl {
inherit sha256;
url = "https://code.call-cc.org/egg-tarballs/5/${pname}/${pname}-${version}.tar.gz";
};
eggDerivation = self.callPackage ./eggDerivation.nix { };
chicken = self.callPackage ./chicken.nix {
bootstrap-chicken = self.chicken.override { bootstrap-chicken = null; };
};
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/5/${pname}";
meta.description = synopsis;
meta.license =
(
lib.licenses
// {
"agpl" = lib.licenses.agpl3Only;
"artistic" = lib.licenses.artistic2;
"bsd" = lib.licenses.bsd3;
"bsd-1-clause" = lib.licenses.bsd1;
"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;
"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 ./deps.toml))
)
);
egg2nix = self.callPackage ./egg2nix.nix { };
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
{
lib,
eggDerivation,
fetchFromGitHub,
chickenEggs,
}:
eggDerivation {
src = fetchFromGitHub {
owner = "corngood";
repo = "egg2nix";
rev = "chicken-5";
sha256 = "1vfnhbcnyakywgjafhs0k5kpsdnrinzvdjxpz3fkwas1jsvxq3d1";
};
pname = "egg2nix";
version = "c5-git";
buildInputs = with chickenEggs; [
args
matchable
];
meta = {
description = "Generate nix-expression from CHICKEN scheme eggs";
mainProgram = "egg2nix";
homepage = "https://github.com/the-kenny/egg2nix";
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ corngood ];
};
}

View File

@@ -0,0 +1,89 @@
{
callPackage,
lib,
stdenv,
chicken,
makeWrapper,
}:
{
src,
buildInputs ? [ ],
chickenInstallFlags ? [ ],
cscOptions ? [ ],
...
}@args:
let
nameVersionAssertion =
pred: lib.assertMsg pred "either name or both pname and version must be given";
pname =
if args ? pname then
assert nameVersionAssertion (!args ? name && args ? version);
args.pname
else
assert nameVersionAssertion (args ? name && !args ? version);
lib.getName args.name;
version = if args ? version then args.version else lib.getVersion args.name;
name = if args ? name then args.name else "${args.pname}-${args.version}";
overrides = callPackage ./overrides.nix { };
override = if builtins.hasAttr pname overrides then builtins.getAttr pname overrides else lib.id;
in
(stdenv.mkDerivation (
{
pname = "chicken-${pname}";
inherit version;
propagatedBuildInputs = buildInputs;
nativeBuildInputs = [
chicken
makeWrapper
];
buildInputs = [ chicken ];
strictDeps = true;
CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
buildPhase = ''
runHook preBuild
chicken-install -cached -no-install -host ${lib.escapeShellArgs chickenInstallFlags}
runHook postBuild
'';
installPhase = ''
runHook preInstall
export CHICKEN_INSTALL_PREFIX=$out
export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
chicken-install -cached -host ${lib.escapeShellArgs chickenInstallFlags}
# Patching generated .egg-info instead of original .egg to work around https://bugs.call-cc.org/ticket/1855
csi -e "(write (cons '(version \"${version}\") (read)))" < "$CHICKEN_INSTALL_REPOSITORY/${pname}.egg-info" > "${pname}.egg-info.new"
mv "${pname}.egg-info.new" "$CHICKEN_INSTALL_REPOSITORY/${pname}.egg-info"
for f in $out/bin/*
do
wrapProgram $f \
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}:$CHICKEN_REPOSITORY_PATH" \
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share" \
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_PATH"
done
runHook postInstall
'';
dontConfigure = true;
meta = {
inherit (chicken.meta) platforms;
}
// args.meta or { };
}
// removeAttrs args [
"name"
"pname"
"version"
"buildInputs"
"meta"
]
)).overrideAttrs
override

View File

@@ -0,0 +1,314 @@
{
stdenv,
pkgs,
lib,
chickenEggs,
}:
let
inherit (lib) addMetaAttrs;
addToNativeBuildInputs = pkg: old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ lib.toList pkg;
};
addToBuildInputs = pkg: old: {
buildInputs = (old.buildInputs or [ ]) ++ lib.toList pkg;
};
addToPropagatedBuildInputs = pkg: old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ lib.toList pkg;
};
addPkgConfig = old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ];
};
addToBuildInputsWithPkgConfig = pkg: old: (addPkgConfig old) // (addToBuildInputs pkg old);
addToPropagatedBuildInputsWithPkgConfig =
pkg: old: (addPkgConfig old) // (addToPropagatedBuildInputs pkg old);
broken = addMetaAttrs { broken = true; };
brokenOnDarwin = addMetaAttrs { broken = stdenv.hostPlatform.isDarwin; };
addToCscOptions = opt: old: {
CSC_OPTIONS = lib.concatStringsSep " " ([ old.CSC_OPTIONS or "" ] ++ lib.toList opt);
};
in
{
breadline = addToBuildInputs pkgs.readline;
blas = addToBuildInputsWithPkgConfig pkgs.blas;
blosc = addToBuildInputs pkgs.c-blosc;
botan = addToBuildInputsWithPkgConfig pkgs.botan2;
cairo =
old:
(addToBuildInputsWithPkgConfig pkgs.cairo old)
// (addToPropagatedBuildInputs (with chickenEggs; [
srfi-1
srfi-13
]) old);
cmark = addToBuildInputs pkgs.cmark;
epoxy =
old:
(addToPropagatedBuildInputsWithPkgConfig pkgs.libepoxy old)
// {
env.NIX_CFLAGS_COMPILE = toString [
(
if stdenv.cc.isClang then
"-Wno-error=incompatible-function-pointer-types"
else
"-Wno-error=incompatible-pointer-types"
)
"-Wno-error=int-conversion"
];
};
espeak = addToBuildInputsWithPkgConfig pkgs.espeak-ng;
exif = addToBuildInputsWithPkgConfig pkgs.libexif;
expat =
old:
(addToBuildInputsWithPkgConfig pkgs.expat old)
// {
env.NIX_CFLAGS_COMPILE = toString [
(
if stdenv.cc.isClang then
"-Wno-error=incompatible-function-pointer-types"
else
"-Wno-error=incompatible-pointer-types"
)
];
};
ezxdisp =
old:
(addToBuildInputsWithPkgConfig pkgs.xorg.libX11 old)
// {
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-function-declaration"
];
};
freetype = addToBuildInputsWithPkgConfig pkgs.freetype;
fuse = addToBuildInputsWithPkgConfig pkgs.fuse;
gl-math = old: {
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=incompatible-pointer-types"
];
};
gl-utils = addPkgConfig;
glfw3 = addToBuildInputsWithPkgConfig pkgs.glfw3;
glls = addPkgConfig;
glut =
old:
(brokenOnDarwin old)
// lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) (
addToCscOptions [
"-I${(lib.getDev pkgs.libglut)}/include"
"-I${(lib.getDev pkgs.libGL)}/include"
"-I${(lib.getDev pkgs.libGLU)}/include"
] old
)
// (addToBuildInputs pkgs.libglut old);
iconv = addToBuildInputs (lib.optional stdenv.hostPlatform.isDarwin pkgs.libiconv);
icu = addToBuildInputsWithPkgConfig pkgs.icu;
imlib2 = addToBuildInputsWithPkgConfig pkgs.imlib2;
inotify =
old:
(addToBuildInputs (lib.optional stdenv.hostPlatform.isDarwin pkgs.libinotify-kqueue) old)
// lib.optionalAttrs stdenv.hostPlatform.isDarwin (addToCscOptions "-L -linotify" old);
leveldb = addToBuildInputs pkgs.leveldb;
magic = addToBuildInputs pkgs.file;
magic-pipes = addToBuildInputs pkgs.chickenPackages_5.chickenEggs.regex;
mdh =
old:
(addToBuildInputs pkgs.pcre old)
// {
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-function-declaration"
"-Wno-error=implicit-int"
];
};
# missing dependency in upstream egg
mistie = addToPropagatedBuildInputs (with chickenEggs; [ srfi-1 ]);
mosquitto = addToPropagatedBuildInputs [ pkgs.mosquitto ];
nanomsg = addToBuildInputs pkgs.nanomsg;
ncurses = addToBuildInputsWithPkgConfig [ pkgs.ncurses ];
opencl = addToBuildInputs [
pkgs.opencl-headers
pkgs.ocl-icd
];
openssl = addToBuildInputs pkgs.openssl;
plot = addToBuildInputs pkgs.plotutils;
postgresql = addToBuildInputsWithPkgConfig pkgs.libpq;
rocksdb = addToBuildInputs pkgs.rocksdb_8_3;
# missing dependency in upstream egg
s9fes-char-graphics-shapes = addToPropagatedBuildInputs (
with chickenEggs;
[
utf8
s9fes-char-graphics
]
);
# missing dependency in upstream egg
s9fes-char-graphics = addToPropagatedBuildInputs (
with chickenEggs;
[
srfi-1
utf8
record-variants
]
);
scheme2c-compatibility = addPkgConfig;
sdl-base =
old:
(
(addToPropagatedBuildInputsWithPkgConfig pkgs.SDL old)
//
# needed for sdl-config to be in PATH
(addToNativeBuildInputs pkgs.SDL old)
);
sdl2 =
old:
(
(addToPropagatedBuildInputsWithPkgConfig pkgs.SDL2 old)
//
# needed for sdl2-config to be in PATH
(addToNativeBuildInputs pkgs.SDL2 old)
);
sdl2-image =
old:
(
(addToPropagatedBuildInputsWithPkgConfig pkgs.SDL2_image old)
//
# needed for sdl2-config to be in PATH
(addToNativeBuildInputs pkgs.SDL2 old)
);
sdl2-ttf =
old:
(
(addToPropagatedBuildInputsWithPkgConfig pkgs.SDL2_ttf old)
//
# needed for sdl2-config to be in PATH
(addToNativeBuildInputs pkgs.SDL2 old)
);
soil = addToPropagatedBuildInputsWithPkgConfig pkgs.libepoxy;
sqlite3 = addToBuildInputs pkgs.sqlite;
stemmer = old: (addToBuildInputs pkgs.libstemmer old) // (addToCscOptions "-L -lstemmer" old);
stfl =
old: (addToBuildInputs [ pkgs.ncurses pkgs.stfl ] old) // (addToCscOptions "-L -lncurses" old);
taglib =
old:
(addToBuildInputs [ pkgs.zlib pkgs.taglib_1 ] old)
// (
# needed for tablib-config to be in PATH
addToNativeBuildInputs pkgs.taglib_1 old
);
uuid-lib = addToBuildInputs pkgs.libuuid;
webview = addToBuildInputsWithPkgConfig pkgs.webkitgtk_4_0;
ws-client = addToBuildInputs pkgs.zlib;
xlib = addToPropagatedBuildInputs pkgs.xorg.libX11;
yaml = addToBuildInputs pkgs.libyaml;
zlib = addToBuildInputs pkgs.zlib;
zmq = addToBuildInputs pkgs.zeromq;
zstd = addToBuildInputs pkgs.zstd;
# less trivial fixes, should be upstreamed
git =
old:
(addToBuildInputsWithPkgConfig pkgs.libgit2 old)
// {
postPatch = ''
substituteInPlace libgit2.scm \
--replace "asize" "reserved"
'';
};
lazy-ffi =
old:
(addToBuildInputs pkgs.libffi old)
// {
postPatch = ''
substituteInPlace lazy-ffi.scm \
--replace "ffi/ffi.h" "ffi.h"
'';
};
opengl =
old:
(brokenOnDarwin old)
// (addToBuildInputsWithPkgConfig (lib.optionals (!stdenv.hostPlatform.isDarwin) [
pkgs.libGL
pkgs.libGLU
]) old)
// {
postPatch = ''
substituteInPlace opengl.egg \
--replace 'framework ' 'framework" "'
'';
};
posix-shm = old: {
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace build.scm \
--replace "-lrt" ""
'';
};
# platform changes
pledge = addMetaAttrs { platforms = lib.platforms.openbsd; };
unveil = addMetaAttrs { platforms = lib.platforms.openbsd; };
# overrides for chicken 5.4
dbus =
old:
(addToBuildInputsWithPkgConfig [ pkgs.dbus ] old)
// {
# backticks in compiler options
# aren't supported anymore as of chicken 5.4, it seems.
preBuild = ''
substituteInPlace \
dbus.egg dbus.setup \
--replace '`pkg-config --cflags dbus-1`' "$(pkg-config --cflags dbus-1)" \
--replace '`pkg-config --libs dbus-1`' "$(pkg-config --libs dbus-1)"
'';
};
math = old: {
# define-values is used but not imported
# some breaking change happened now it needs to be done
# explicitly?
preBuild = ''
substituteInPlace *.scm **/*.scm \
--replace-quiet 'only chicken.base' 'only chicken.base define-values'
'';
};
socket = old: {
# chicken-do checks for changes to a file that doesn't exist
preBuild = ''
touch socket-config
'';
};
# mark broken
allegro =
old:
(broken old)
// {
# depends on 'chicken' egg, which doesn't exist, so we specify all the deps here (needs to be
# kept around even when marked as broken so that evaluation doesn't break due to the missing
# attribute).
propagatedBuildInputs = [
chickenEggs.foreigners
];
};
ephem = broken;
canvas-draw = broken;
coops-utils = broken;
crypt = broken;
gemini = broken;
gemini-client = broken;
hypergiant = broken;
iup = broken;
kiwi = broken;
lmdb-ht = broken;
mpi = broken;
pyffi = broken;
qt-light = broken;
sundials = broken;
svn-client = broken;
tokyocabinet = broken;
# mark broken darwin
# fatal error: 'mqueue.h' file not found
posix-mq = brokenOnDarwin;
# Undefined symbols for architecture arm64: "_pthread_setschedprio"
pthreads = brokenOnDarwin;
# error: use of undeclared identifier 'B4000000'
stty = brokenOnDarwin;
}

View File

@@ -0,0 +1,43 @@
(import (chicken process-context)
(chicken format)
(chicken string))
(define env-var get-environment-variable)
(define ref alist-ref)
(define egg (read))
(printf "[~A]\n" (env-var "EGG_NAME"))
(define dependencies
(map (lambda (dep)
(->string (if (list? dep)
(car dep)
dep)))
(append
(ref 'dependencies egg eqv? '())
;; TODO separate this into `buildInputs` and `propagatedBuildInputs`
(ref 'build-dependencies egg eqv? '()))))
(printf "dependencies = [~A]\n"
(string-intersperse (map (lambda (dep) (sprintf "~S" dep))
dependencies)
", "))
(define license (ref 'license egg))
(printf "license = ~S\n"
(if (not license)
""
(string-translate (->string (car license))
"ABCDEFGHIJKLMNOPQRSTUVWXYZ "
"abcdefghijklmnopqrstuvwxyz-")))
(printf "sha256 = ~S\n" (env-var "EGG_SHA256"))
(define synopsis (ref 'synopsis egg))
(printf "synopsis = ~S\n"
(if (not synopsis)
""
(car synopsis)))
(printf "version = ~S\n" (env-var "EGG_VERSION"))
(print)

View File

@@ -0,0 +1,6 @@
addChickenRepositoryPath() {
addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_PATH "$1/lib/chicken/11"
addToSearchPathWithCustomDelimiter : CHICKEN_INCLUDE_PATH "$1/share"
}
addEnvHooks "$targetOffset" addChickenRepositoryPath

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../../../.. -i ysh -p oils-for-unix chicken nix-prefetch-git jq
setglobal ENV.URL_PREFIX="https://code.call-cc.org/egg-tarballs/5/"
cd $(nix-prefetch-git --deepClone --quiet \
https://code.call-cc.org/eggs-5-latest | jq --raw-output .path)
echo "# THIS IS A GENERATED FILE. DO NOT EDIT!" > $_this_dir/deps.toml
for i, item in */*/*.egg {
setglobal ENV.EGG_NAME=$(dirname $(dirname $item))
setglobal ENV.EGG_VERSION=$(basename $(dirname $item))
setglobal ENV.EGG_URL="$[ENV.URL_PREFIX]$[ENV.EGG_NAME]/$[ENV.EGG_NAME]-$[ENV.EGG_VERSION].tar.gz"
setglobal ENV.EGG_SHA256=$(nix-prefetch-url $[ENV.EGG_URL])
csi -s $_this_dir/read-egg.scm < $item
} >> $_this_dir/deps.toml