1# This derivation is a reduced-functionality variant of Gambit stable,
2# used to compile the full version of Gambit stable *and* unstable.
3
4{ gccStdenv, lib, fetchurl, autoconf, gcc, coreutils, gambit-support, ... }:
5# As explained in build.nix, GCC compiles Gambit 10x faster than Clang, for code 3x better
6
7gccStdenv.mkDerivation {
8 pname = "gambit-bootstrap";
9 version = "4.9.5";
10
11 src = fetchurl {
12 url = "https://gambitscheme.org/4.9.5/gambit-v4_9_5.tgz";
13 sha256 = "sha256-4o74218OexFZcgwVAFPcq498TK4fDlyDiUR5cHP4wdw=";
14 };
15
16 buildInputs = [ autoconf ];
17
18 configurePhase = ''
19 export CC=${gcc}/bin/gcc CXX=${gcc}/bin/g++ \
20 CPP=${gcc}/bin/cpp CXXCPP=${gcc}/bin/cpp LD=${gcc}/bin/ld \
21 XMKMF=${coreutils}/bin/false
22 unset CFLAGS LDFLAGS LIBS CPPFLAGS CXXFLAGS
23 ./configure --prefix=$out/gambit
24 '';
25
26 buildPhase = ''
27 # Copy the (configured) sources now, not later, so we don't have to filter out
28 # all the intermediate build products.
29 mkdir -p $out/gambit ; cp -rp . $out/gambit/
30
31 # build the gsc-boot* compiler
32 make -j$NIX_BUILD_CORES bootstrap
33 '';
34
35 installPhase = ''
36 cp -fa ./gsc-boot $out/gambit/
37 '';
38
39 forceShare = [ "info" ];
40
41 meta = gambit-support.meta // {
42 description = "Optimizing Scheme to C compiler, bootstrap step";
43 };
44}