at master 1.9 kB view raw
1{ pkgs, lib }: 2 3rec { 4 stable-params = { 5 stable = true; 6 defaultRuntimeOptions = "iL,fL,-L,tL"; 7 buildRuntimeOptions = "i8,f8,-8,t8"; 8 targets = "js"; # arm,java,js,php,python,riscv-32,riscv-64,ruby,x86,x86-64 9 #fixStamp = _: _: _: ""; 10 fixStamp = git-version: stampYmd: stampHms: '' 11 echo "Fixing timestamp recipe in Makefile" 12 substituteInPlace configure \ 13 --replace "$(grep '^PACKAGE_VERSION=.*$' configure)" 'PACKAGE_VERSION="v${git-version}"' \ 14 --replace "$(grep '^PACKAGE_STRING=.*$' configure)" 'PACKAGE_STRING="Gambit v${git-version}"' ; 15 substituteInPlace include/makefile.in \ 16 --replace "\$\$(\$(GIT) describe --tag --always | sed 's/-bootstrap\$\$//')" "v${git-version}" \ 17 --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;"; 18 grep -i ' version=\|echo..#define ___STAMP_VERSION' include/makefile.in # XXX DEBUG -- REMOVE ME 19 ''; 20 modules = true; 21 extraOptions = [ "CFLAGS=-foptimize-sibling-calls" ]; 22 }; 23 24 unstable-params = stable-params // { 25 stable = false; 26 extraOptions = [ ]; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable 27 }; 28 29 export-gambopt = params: "export GAMBOPT=${params.buildRuntimeOptions} ;"; 30 31 gambit-bootstrap = import ./bootstrap.nix (pkgs); 32 33 meta = with lib; { 34 description = "Optimizing Scheme to C compiler"; 35 homepage = "http://gambitscheme.org"; 36 license = licenses.lgpl21Only; # dual, also asl20 37 # NB regarding platforms: continuously tested on Linux x86_64 and regularly tested on macOS x86_64. 38 # *should* work everywhere. 39 platforms = platforms.unix; 40 maintainers = with maintainers; [ 41 thoughtpolice 42 raskin 43 fare 44 ]; 45 }; 46}