2020-03-21 05:52:59 +01:00
|
|
|
{ pkgs, lib }:
|
|
|
|
|
|
|
|
rec {
|
|
|
|
stable-params = {
|
2020-10-21 06:08:26 +02:00
|
|
|
stable = true;
|
2020-03-21 05:52:59 +01:00
|
|
|
defaultRuntimeOptions = "iL,fL,-L,tL";
|
|
|
|
buildRuntimeOptions = "i8,f8,-8,t8";
|
2022-01-25 17:12:11 +01:00
|
|
|
targets = "js"; # arm,java,js,php,python,riscv-32,riscv-64,ruby,x86,x86-64
|
|
|
|
#fixStamp = _: _: _: "";
|
|
|
|
fixStamp = git-version: stampYmd: stampHms: ''
|
|
|
|
echo "Fixing timestamp recipe in Makefile"
|
2020-03-21 05:52:59 +01:00
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "$(grep '^PACKAGE_VERSION=.*$' configure)" 'PACKAGE_VERSION="v${git-version}"' \
|
|
|
|
--replace "$(grep '^PACKAGE_STRING=.*$' configure)" 'PACKAGE_STRING="Gambit v${git-version}"' ;
|
2022-01-25 17:12:11 +01:00
|
|
|
substituteInPlace include/makefile.in \
|
2023-09-11 01:04:17 +02:00
|
|
|
--replace "\$\$(\$(GIT) describe --tag --always | sed 's/-bootstrap\$\$//')" "v${git-version}" \
|
|
|
|
--replace "echo > stamp.h;" "(echo '#define ___STAMP_VERSION \"v${git-version}\"'; echo '#define ___STAMP_YMD ${toString stampYmd}'; echo '#define ___STAMP_HMS ${toString stampHms}';) > stamp.h;";
|
|
|
|
grep -i ' version=\|echo..#define ___STAMP_VERSION' include/makefile.in # XXX DEBUG -- REMOVE ME
|
2020-03-21 05:52:59 +01:00
|
|
|
'';
|
2022-01-25 17:12:11 +01:00
|
|
|
modules = true;
|
2023-09-11 01:04:17 +02:00
|
|
|
extraOptions = ["CFLAGS=-foptimize-sibling-calls"];
|
2022-01-25 17:12:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
unstable-params = stable-params // {
|
|
|
|
stable = false;
|
2023-09-11 01:04:17 +02:00
|
|
|
extraOptions = []; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable
|
2020-03-21 05:52:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;";
|
|
|
|
|
|
|
|
gambit-bootstrap = import ./bootstrap.nix ( pkgs );
|
|
|
|
|
2020-11-13 01:37:27 +01:00
|
|
|
meta = with lib; {
|
2020-03-21 05:52:59 +01:00
|
|
|
description = "Optimizing Scheme to C compiler";
|
|
|
|
homepage = "http://gambitscheme.org";
|
2020-11-13 01:37:27 +01:00
|
|
|
license = licenses.lgpl21Only; # dual, also asl20
|
|
|
|
# NB regarding platforms: continuously tested on Linux x86_64 and regularly tested on macOS x86_64.
|
|
|
|
# *should* work everywhere.
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice raskin fare ];
|
2020-03-21 05:52:59 +01:00
|
|
|
};
|
|
|
|
}
|