7 bootstrap-chicken ? null,
18 else if (isFreeBSD || isOpenBSD) then
23 "linux"; # Should be a sane default
25 stdenv.mkDerivation (finalAttrs: {
32 url = "https://code.call-cc.org/releases/${finalAttrs.version}/chicken-${finalAttrs.version}.tar.gz";
33 sha256 = "sha256-PF1KphwRZ79tm/nq+JHadjC6n188Fb8JUVpwOb/N7F8=";
36 # Disable two broken tests: "static link" and "linking tests"
38 sed -i tests/runtests.sh -e "/static link/,+4 { s/^/# / }"
39 sed -i tests/runtests.sh -e "/linking tests/,+11 { s/^/# / }"
42 setupHook = lib.optional (bootstrap-chicken != null) ./setup-hook.sh;
46 "PLATFORM=${platform}"
51 ++ (lib.optionals stdenv.hostPlatform.isDarwin [
52 "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin"
53 "LINKER_OPTIONS=-headerpad_max_install_names"
54 "POSTINSTALL_PROGRAM=install_name_tool"
56 ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
57 "HOSTSYSTEM=${stdenv.hostPlatform.config}"
58 "TARGET_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
59 "TARGET_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
66 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
67 darwin.autoSignDarwinBinariesHook
70 buildInputs = lib.optionals (bootstrap-chicken != null) [
74 doCheck = !stdenv.hostPlatform.isDarwin;
76 ./csi -R chicken.pathname -R chicken.platform \
77 -p "(assert (equal? \"${toString finalAttrs.binaryVersion}\" (pathname-file (car (repository-path)))))"
80 passthru.tests.version = testers.testVersion {
81 package = finalAttrs.finalPackage;
82 command = "csi -version";
86 homepage = "https://call-cc.org/";
87 license = lib.licenses.bsd3;
88 maintainers = with lib.maintainers; [
93 platforms = lib.platforms.unix;
94 description = "Portable compiler for the Scheme programming language";
96 CHICKEN is a compiler for the Scheme programming language.
97 CHICKEN produces portable and efficient C, supports almost all
98 of the R5RS Scheme language standard, and includes many
99 enhancements and extensions. CHICKEN runs on Linux, macOS,
100 Windows, and many Unix flavours.