2020-03-21 04:52:59 +00:00
|
|
|
# This derivation is a reduced-functionality variant of Gambit stable,
|
|
|
|
# used to compile the full version of Gambit stable *and* unstable.
|
2017-06-29 02:11:56 +00:00
|
|
|
|
2020-03-21 04:52:59 +00:00
|
|
|
{ gccStdenv, lib, fetchurl, autoconf, gcc, coreutils, gambit-support, ... }:
|
|
|
|
# As explained in build.nix, GCC compiles Gambit 10x faster than Clang, for code 3x better
|
|
|
|
|
|
|
|
gccStdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gambit-bootstrap";
|
2022-01-25 16:12:11 +00:00
|
|
|
version = "4.9.5";
|
2017-06-29 02:11:56 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-25 16:12:11 +00:00
|
|
|
url = "https://gambitscheme.org/4.9.5/gambit-v4_9_5.tgz";
|
|
|
|
sha256 = "sha256-4o74218OexFZcgwVAFPcq498TK4fDlyDiUR5cHP4wdw=";
|
2017-06-29 02:11:56 +00:00
|
|
|
};
|
|
|
|
|
2018-11-21 15:19:58 +00:00
|
|
|
buildInputs = [ autoconf ];
|
2017-06-29 02:11:56 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2020-02-16 00:26:35 +00:00
|
|
|
export CC=${gcc}/bin/gcc CXX=${gcc}/bin/g++ \
|
|
|
|
CPP=${gcc}/bin/cpp CXXCPP=${gcc}/bin/cpp LD=${gcc}/bin/ld \
|
|
|
|
XMKMF=${coreutils}/bin/false
|
|
|
|
unset CFLAGS LDFLAGS LIBS CPPFLAGS CXXFLAGS
|
2020-03-21 04:52:59 +00:00
|
|
|
./configure --prefix=$out/gambit
|
2017-06-29 02:11:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# Copy the (configured) sources now, not later, so we don't have to filter out
|
|
|
|
# all the intermediate build products.
|
2020-03-21 04:52:59 +00:00
|
|
|
mkdir -p $out/gambit ; cp -rp . $out/gambit/
|
2017-06-29 02:11:56 +00:00
|
|
|
|
|
|
|
# build the gsc-boot* compiler
|
2020-03-21 04:52:59 +00:00
|
|
|
make -j$NIX_BUILD_CORES bootstrap
|
2017-06-29 02:11:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-12-22 15:17:45 +00:00
|
|
|
cp -fa ./gsc-boot $out/gambit/
|
2017-06-29 02:11:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
forceShare = [ "info" ];
|
|
|
|
|
2020-03-21 04:52:59 +00:00
|
|
|
meta = gambit-support.meta // {
|
2017-06-29 02:11:56 +00:00
|
|
|
description = "Optimizing Scheme to C compiler, bootstrap step";
|
|
|
|
};
|
|
|
|
}
|