summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/gambit
diff options
context:
space:
mode:
authorFrancois-Rene Rideau <fare@tunes.org>2023-09-10 19:04:17 -0400
committerFrancois-Rene Rideau <fare@tunes.org>2023-10-14 18:36:25 -0400
commit8743ae8765c2119f068f6c38a6ca1ccaa026d6e2 (patch)
tree55609e881d5a4081e7d88c0b10887a3415cc2378 /pkgs/development/compilers/gambit
parentf427e60ce598f14ff6d7972e1db6d24867fde647 (diff)
gambit: tweak support
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
3 files changed, 17 insertions, 6 deletions
diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix
index 33391c156969..60b9fb792d2f 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 cb4f5f9501ca..a0f95192cbfc 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 6e42b9252f24..1209ca10aa16 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} ;";