summary refs log tree commit diff
path: root/pkgs/development/compilers/gambit
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/gambit')
-rw-r--r--pkgs/development/compilers/gambit/build.nix12
-rw-r--r--pkgs/development/compilers/gambit/default.nix2
-rw-r--r--pkgs/development/compilers/gambit/gambit-support.nix9
-rw-r--r--pkgs/development/compilers/gambit/unstable.nix15
4 files changed, 25 insertions, 13 deletions
diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix
index 33391c15696..60b9fb792d2 100644
--- a/pkgs/development/compilers/gambit/build.nix
+++ b/pkgs/development/compilers/gambit/build.nix
@@ -5,7 +5,8 @@
   stampYmd ? 0, stampHms ? 0,
   gambit-support,
   optimizationSetting ? "-O1",
-  gambit-params ? pkgs.gambit-support.stable-params }:
+  gambit-params ? pkgs.gambit-support.stable-params,
+  rev ? git-version }:
 
 # Note that according to a benchmark run by Marc Feeley on May 2018,
 # clang is 10x (with default settings) to 15% (with -O2) slower than GCC at compiling
@@ -30,6 +31,11 @@ gccStdenv.mkDerivation rec {
   inherit src version git-version;
   bootstrap = gambit-support.gambit-bootstrap;
 
+  passthru = {
+    inherit src version git-version rev stampYmd stampHms optimizationSetting openssl;
+  };
+
+
   nativeBuildInputs = [ git autoconf ];
 
   # TODO: if/when we can get all the library packages we depend on to have static versions,
@@ -47,6 +53,7 @@ gccStdenv.mkDerivation rec {
     "--enable-c-opt=${optimizationSetting}"
     "--enable-c-opt-rts=-O2"
     "--enable-gcc-opts"
+    "--enable-trust-c-tco"
     "--enable-shared"
     "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it.
     "--enable-openssl"
@@ -70,6 +77,9 @@ gccStdenv.mkDerivation rec {
     # "--enable-char-size=1" # default is 4
     # "--enable-march=native" # Nope, makes it not work on machines older than the builder
   ] ++ gambit-params.extraOptions
+    # TODO: pick an appropriate architecture to optimize on on x86-64?
+    # https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/i386-and-x86-64-Options.html#i386-and-x86-64-Options
+    # ++ lib.optional pkgs.stdenv.isx86_64 "--enable-march=core-avx2"
     # Do not enable poll on darwin due to https://github.com/gambit/gambit/issues/498
     ++ lib.optional (!gccStdenv.isDarwin) "--enable-poll";
 
diff --git a/pkgs/development/compilers/gambit/default.nix b/pkgs/development/compilers/gambit/default.nix
index cb4f5f9501c..a0f95192cbf 100644
--- a/pkgs/development/compilers/gambit/default.nix
+++ b/pkgs/development/compilers/gambit/default.nix
@@ -2,7 +2,7 @@
 
 callPackage ./build.nix rec {
   version = "4.9.5";
-  git-version = version;
+  git-version = "v${version}";
   src = fetchurl {
     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 6e42b9252f2..1209ca10aa1 100644
--- a/pkgs/development/compilers/gambit/gambit-support.nix
+++ b/pkgs/development/compilers/gambit/gambit-support.nix
@@ -13,16 +13,17 @@ rec {
         --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;";
+        --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
     '';
     modules = true;
-    #extraOptions = [];
-    extraOptions = ["--enable-trust-c-tco" "CFLAGS=-foptimize-sibling-calls"];
+    extraOptions = ["CFLAGS=-foptimize-sibling-calls"];
   };
 
   unstable-params = stable-params // {
     stable = false;
-    extraOptions = ["--enable-trust-c-tco"]; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable
+    extraOptions = []; # "CFLAGS=-foptimize-sibling-calls" not necessary in latest unstable
   };
 
   export-gambopt = params : "export GAMBOPT=${params.buildRuntimeOptions} ;";
diff --git a/pkgs/development/compilers/gambit/unstable.nix b/pkgs/development/compilers/gambit/unstable.nix
index 092cbdb7248..597cbedb13e 100644
--- a/pkgs/development/compilers/gambit/unstable.nix
+++ b/pkgs/development/compilers/gambit/unstable.nix
@@ -1,15 +1,16 @@
 { callPackage, fetchFromGitHub, gambit-support }:
 
-callPackage ./build.nix {
-  version = "unstable-2023-08-06";
-  git-version = "4.9.5-5-gf1fbe9aa";
-  stampYmd = 20230806;
-  stampHms = 195822;
+callPackage ./build.nix rec {
+  version = "unstable-2023-10-07";
+  git-version = "4.9.5-59-g342399c7";
+  stampYmd = 20231007;
+  stampHms = 170745;
+  rev = "342399c736ec560c0ff4faeaeb9599b45633f26c";
   src = fetchFromGitHub {
     owner = "gambit";
     repo = "gambit";
-    rev = "f1fbe9aa0f461e89f2a91bc050c1373ee6d66482";
-    sha256 = "0b0gd6cwj8zxwcqglpsnmanysiq4mvma2mrgdfr6qy99avhbhzxm";
+    inherit rev;
+    sha256 = "121pj6lxihjjnfq33lq4m5hi461xbs9f41qd4l46556dr15cyf8f";
   };
   gambit-params = gambit-support.unstable-params;
 }