nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
2013-03-26 14:52:54 +00:00
let
platform = with stdenv;
if isDarwin then "macosx"
else if isCygwin then "cygwin"
2015-02-25 03:15:51 +00:00
else if (isFreeBSD || isOpenBSD) then "bsd"
else if isSunOS then "solaris"
2015-02-25 03:15:51 +00:00
else "linux"; # Should be a sane default
in
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "chicken";
2021-12-11 15:20:35 +00:00
version = "5.3.0";
binaryVersion = 11;
2014-10-09 18:49:15 +00:00
2014-06-02 16:15:44 +00:00
src = fetchurl {
url = "https://code.call-cc.org/releases/${version}/chicken-${version}.tar.gz";
2021-12-11 15:20:35 +00:00
sha256 = "sha256-w62Z2PnhftgQkS75gaw7DC4vRvsOzAM7XDttyhvbDXY=";
2014-06-02 16:15:44 +00:00
};
2013-03-26 14:52:54 +00:00
setupHook = lib.optional (bootstrap-chicken != null) ./setup-hook.sh;
2016-06-25 14:53:21 +00:00
# -fno-strict-overflow is not a supported argument in clang on darwin
hardeningDisable = lib.optionals stdenv.isDarwin ["strictoverflow"];
makeFlags = [
"PLATFORM=${platform}" "PREFIX=$(out)"
] ++ (lib.optionals stdenv.isDarwin [
"XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin"
"C_COMPILER=$(CC)"
2023-04-12 08:20:54 +00:00
"CXX_COMPILER=$(CXX)"
2022-09-10 13:08:13 +00:00
"LINKER_OPTIONS=-headerpad_max_install_names"
"POSTINSTALL_PROGRAM=install_name_tool"
]);
nativeBuildInputs = [
2014-10-17 15:26:36 +00:00
makeWrapper
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
darwin.autoSignDarwinBinariesHook
];
buildInputs = lib.optionals (bootstrap-chicken != null) [
bootstrap-chicken
];
2014-10-17 15:26:36 +00:00
postInstall = ''
for f in $out/bin/*
do
wrapProgram $f \
--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}
2014-10-17 15:26:36 +00:00
done
'';
doCheck = !stdenv.isDarwin;
postCheck = ''
./csi -R chicken.pathname -R chicken.platform \
-p "(assert (equal? \"${toString binaryVersion}\" (pathname-file (car (repository-path)))))"
'';
2014-10-09 18:49:15 +00:00
doInstallCheck = true;
installCheckPhase = ''
$out/bin/chicken -version
'';
meta = {
homepage = "https://call-cc.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ corngood nagy konst-aa ];
platforms = lib.platforms.unix;
description = "A 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.
'';
};
2013-03-26 14:52:54 +00:00
}