nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 21.05 44 lines 1.3 kB view raw
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.3"; 10 11 src = fetchurl { 12 url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.9/source/gambit-v4_9_3.tgz"; 13 sha256 = "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"; 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 ./ $out/gambit/ 37 ''; 38 39 forceShare = [ "info" ]; 40 41 meta = gambit-support.meta // { 42 description = "Optimizing Scheme to C compiler, bootstrap step"; 43 }; 44}