depot/third_party/nixpkgs/pkgs/development/compilers/gambit/gambit-support.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

41 lines
1.7 KiB
Nix

{ pkgs, lib }:
rec {
stable-params = {
stable = true;
defaultRuntimeOptions = "iL,fL,-L,tL";
buildRuntimeOptions = "i8,f8,-8,t8";
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"
substituteInPlace configure \
--replace "$(grep '^PACKAGE_VERSION=.*$' configure)" 'PACKAGE_VERSION="v${git-version}"' \
--replace "$(grep '^PACKAGE_STRING=.*$' configure)" 'PACKAGE_STRING="Gambit v${git-version}"' ;
substituteInPlace include/makefile.in \
--replace "echo > stamp.h;" "(echo '#define ___STAMP_VERSION \"${git-version}\"'; echo '#define ___STAMP_YMD ${toString stampYmd}'; echo '#define ___STAMP_HMS ${toString stampHms}';) > stamp.h;";
'';
modules = true;
#extraOptions = [];
extraOptions = ["--enable-trust-c-tco" "CFLAGS=-foptimize-sibling-calls"];
};
unstable-params = stable-params // {
stable = false;
extraOptions = ["--enable-trust-c-tco"]; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable
};
export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;";
gambit-bootstrap = import ./bootstrap.nix ( pkgs );
meta = with lib; {
description = "Optimizing Scheme to C compiler";
homepage = "http://gambitscheme.org";
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 ];
};
}