diff --git a/pkgs/development/compilers/gambit/bootstrap.nix b/pkgs/development/compilers/gambit/bootstrap.nix index a29f45a4e7a5..753938e95aa3 100644 --- a/pkgs/development/compilers/gambit/bootstrap.nix +++ b/pkgs/development/compilers/gambit/bootstrap.nix @@ -6,11 +6,11 @@ gccStdenv.mkDerivation { pname = "gambit-bootstrap"; - version = "4.9.3"; + version = "4.9.5"; src = fetchurl { - url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.9/source/gambit-v4_9_3.tgz"; - sha256 = "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"; + url = "https://gambitscheme.org/4.9.5/gambit-v4_9_5.tgz"; + sha256 = "sha256-4o74218OexFZcgwVAFPcq498TK4fDlyDiUR5cHP4wdw="; }; buildInputs = [ autoconf ]; diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix index 029225629154..e06c05b1f244 100644 --- a/pkgs/development/compilers/gambit/build.nix +++ b/pkgs/development/compilers/gambit/build.nix @@ -39,11 +39,14 @@ gccStdenv.mkDerivation rec { "--enable-targets=${gambit-params.targets}" "--enable-single-host" "--enable-c-opt=${optimizationSetting}" + "--enable-c-opt-rts=-O2" "--enable-gcc-opts" "--enable-shared" "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it. "--enable-openssl" + #"--enable-default-compile-options='(compactness 9)'" # Make life easier on the JS backend "--enable-default-runtime-options=${gambit-params.defaultRuntimeOptions}" + # "--enable-rtlib-debug" # used by Geiser, but only on recent-enough gambit, and messes js runtime # "--enable-debug" # Nope: enables plenty of good stuff, but also the costly console.log # "--enable-multiple-versions" # Nope, NixOS already does version multiplexing # "--enable-guide" @@ -84,18 +87,19 @@ gccStdenv.mkDerivation rec { ''; buildPhase = '' - # Make bootstrap compiler, from release bootstrap + echo "Make bootstrap compiler, from release bootstrap" mkdir -p boot cp -rp ${bootstrap}/gambit/. boot/. chmod -R u+w boot cd boot cp ../gsc/makefile.in ../gsc/*.scm gsc/ + echo > include/stamp.h # No stamp needed for the bootstrap compiler ./configure for i in lib gsi gsc ; do (cd $i ; make -j$NIX_BUILD_CORES) ; done cd .. cp boot/gsc/gsc gsc-boot - # Now use the bootstrap compiler to build the real thing! + echo "Now use the bootstrap compiler to build the real thing!" make -j$NIX_BUILD_CORES from-scratch ${lib.optionalString gambit-params.modules "make -j$NIX_BUILD_CORES modules"} ''; @@ -107,6 +111,7 @@ gccStdenv.mkDerivation rec { ''; doCheck = true; + dontStrip = true; meta = gambit-support.meta; } diff --git a/pkgs/development/compilers/gambit/default.nix b/pkgs/development/compilers/gambit/default.nix index 8f77daa4173b..cb4f5f9501ca 100644 --- a/pkgs/development/compilers/gambit/default.nix +++ b/pkgs/development/compilers/gambit/default.nix @@ -1,10 +1,10 @@ { callPackage, fetchurl }: callPackage ./build.nix rec { - version = "4.9.3"; + version = "4.9.5"; git-version = version; src = fetchurl { - url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.9/source/gambit-v4_9_3.tgz"; - sha256 = "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"; + url = "https://gambitscheme.org/4.9.5/gambit-v4_9_5.tgz"; + sha256 = "sha256-4o74218OexFZcgwVAFPcq498TK4fDlyDiUR5cHP4wdw="; }; } diff --git a/pkgs/development/compilers/gambit/gambit-support.nix b/pkgs/development/compilers/gambit/gambit-support.nix index be745367ec03..13827b4a59c7 100644 --- a/pkgs/development/compilers/gambit/gambit-support.nix +++ b/pkgs/development/compilers/gambit/gambit-support.nix @@ -3,24 +3,25 @@ rec { stable-params = { stable = true; - defaultRuntimeOptions = "f8,-8,t8"; - buildRuntimeOptions = "f8,-8,t8"; - fix-stamp = git-version : ""; - targets = "java,js,php,python,ruby"; - modules = false; - }; - - unstable-params = { - stable = false; defaultRuntimeOptions = "iL,fL,-L,tL"; buildRuntimeOptions = "i8,f8,-8,t8"; - fix-stamp = git-version : '' + 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;"; ''; - targets = "arm,java,js,php,python,riscv-32,riscv-64,ruby,x86,x86-64"; # eats 100% cpu on _digest - modules = false; + modules = true; + extraOptions = []; + }; + + unstable-params = stable-params // { + stable = false; + extraOptions = ["--enable-trust-c-tco"]; }; export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;";