2018-02-16 14:38:43 +00:00
|
|
|
{ stdenv, fetchurl, fetchgit, git, openssl, autoconf, pkgs, makeStaticLibraries }:
|
2010-05-28 07:01:35 +01:00
|
|
|
|
2017-07-08 14:58:40 +01:00
|
|
|
# TODO: distinct packages for gambit-release and gambit-devel
|
|
|
|
|
2014-10-25 05:04:42 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gambit-${version}";
|
2018-02-16 14:38:43 +00:00
|
|
|
version = "4.8.8-435-gd1991ba7";
|
2017-06-29 03:11:56 +01:00
|
|
|
bootstrap = import ./bootstrap.nix ( pkgs );
|
2014-10-25 05:04:42 +01:00
|
|
|
|
2017-06-29 03:11:56 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/feeley/gambit.git";
|
2018-02-16 14:38:43 +00:00
|
|
|
rev = "d1991ba7e90ed0149964320f7cafa1a8289e61f0";
|
|
|
|
sha256 = "02harwcsqxxcxgn2yc1y9kyxdp32mampyvnbxrzg2jzfmnp5g6cm";
|
2014-10-25 05:04:42 +01:00
|
|
|
};
|
|
|
|
|
2018-02-16 14:38:43 +00:00
|
|
|
# Use makeStaticLibraries to enable creation of statically linked binaries
|
|
|
|
buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)];
|
2017-06-03 01:26:44 +01:00
|
|
|
|
2017-06-29 03:11:56 +01:00
|
|
|
configurePhase = ''
|
|
|
|
options=(
|
|
|
|
--prefix=$out
|
|
|
|
--enable-single-host
|
|
|
|
--enable-c-opt=-O2
|
|
|
|
--enable-gcc-opts
|
|
|
|
--enable-shared
|
|
|
|
--enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it.
|
|
|
|
--enable-poll
|
|
|
|
--enable-openssl
|
2017-07-08 14:58:40 +01:00
|
|
|
--enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O
|
|
|
|
#--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log
|
2017-06-29 03:11:56 +01:00
|
|
|
|
|
|
|
#--enable-multiple-versions # Nope, NixOS already does version multiplexing
|
|
|
|
#--enable-guide
|
|
|
|
#--enable-track-scheme
|
|
|
|
#--enable-high-res-timing
|
|
|
|
#--enable-max-processors=4
|
|
|
|
#--enable-multiple-vms
|
|
|
|
#--enable-dynamic-tls
|
|
|
|
#--enable-multiple-vms
|
|
|
|
#--enable-multiple-threaded-vms ## when SMP branch is merged in
|
|
|
|
#--enable-thread-system=posix ## default when --enable-multiple-vms is on.
|
|
|
|
#--enable-profile
|
|
|
|
#--enable-coverage
|
|
|
|
#--enable-inline-jumps
|
|
|
|
#--enable-char-size=1" ; default is 4
|
|
|
|
)
|
|
|
|
./configure ''${options[@]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# Make bootstrap compiler, from release bootstrap
|
2017-07-08 14:58:40 +01:00
|
|
|
mkdir -p boot &&
|
|
|
|
cp -rp ${bootstrap}/. boot/. &&
|
2017-06-29 03:11:56 +01:00
|
|
|
chmod -R u+w boot &&
|
2017-07-08 14:58:40 +01:00
|
|
|
cd boot &&
|
|
|
|
cp ../gsc/makefile.in ../gsc/*.scm gsc && # */
|
|
|
|
./configure &&
|
|
|
|
for i in lib gsi gsc ; do (cd $i ; make ) ; done &&
|
|
|
|
cd .. &&
|
|
|
|
cp boot/gsc/gsc gsc-boot &&
|
2017-06-29 03:11:56 +01:00
|
|
|
|
|
|
|
# Now use the bootstrap compiler to build the real thing!
|
|
|
|
make -j2 from-scratch
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2010-05-28 07:01:35 +01:00
|
|
|
|
|
|
|
meta = {
|
2014-10-25 05:04:42 +01:00
|
|
|
description = "Optimizing Scheme to C compiler";
|
|
|
|
homepage = "http://gambitscheme.org";
|
|
|
|
license = stdenv.lib.licenses.lgpl2;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2017-06-29 03:11:56 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
|
2010-05-28 07:01:35 +01:00
|
|
|
};
|
2014-10-25 05:04:42 +01:00
|
|
|
}
|