2017-12-27 03:32:23 +00:00
|
|
|
{ fetchurl, stdenv, makeWrapper, gnum4, texinfo, texLive, automake,
|
|
|
|
enableX11 ? false, xlibsWrapper ? null }:
|
2010-03-17 15:32:12 +00:00
|
|
|
|
2010-04-24 11:09:53 +00:00
|
|
|
let
|
2020-04-21 21:35:54 +00:00
|
|
|
version = "10.1.10";
|
2010-04-24 11:09:53 +00:00
|
|
|
bootstrapFromC = ! (stdenv.isi686 || stdenv.isx86_64);
|
2013-01-12 11:43:47 +00:00
|
|
|
|
|
|
|
arch = if stdenv.isi686 then "-i386"
|
2020-04-21 21:35:54 +00:00
|
|
|
else "-x86-64";
|
2010-04-24 11:09:53 +00:00
|
|
|
in
|
2010-03-17 15:32:12 +00:00
|
|
|
stdenv.mkDerivation {
|
2017-12-27 03:32:23 +00:00
|
|
|
name = if enableX11 then "mit-scheme-x11-${version}" else "mit-scheme-${version}";
|
2010-03-17 15:32:12 +00:00
|
|
|
|
2010-04-24 11:09:53 +00:00
|
|
|
# MIT/GNU Scheme is not bootstrappable, so it's recommended to compile from
|
|
|
|
# the platform-specific tarballs, which contain pre-built binaries. It
|
|
|
|
# leads to more efficient code than when building the tarball that contains
|
|
|
|
# generated C code instead of those binaries.
|
|
|
|
src =
|
|
|
|
if stdenv.isi686
|
|
|
|
then fetchurl {
|
|
|
|
url = "mirror://gnu/mit-scheme/stable.pkg/${version}/mit-scheme-${version}-i386.tar.gz";
|
2020-04-21 21:35:54 +00:00
|
|
|
sha256 = "117lf06vcdbaa5432hwqnskpywc6x8ai0gj99h480a4wzkp3vhy6";
|
|
|
|
} else fetchurl {
|
2010-04-24 11:09:53 +00:00
|
|
|
url = "mirror://gnu/mit-scheme/stable.pkg/${version}/mit-scheme-${version}-x86-64.tar.gz";
|
2020-04-21 21:35:54 +00:00
|
|
|
sha256 = "1rljv6iddrbssm91c0nn08myj92af36hkix88cc6qwq38xsxs52g";
|
2010-04-24 11:09:53 +00:00
|
|
|
};
|
2010-03-17 15:32:12 +00:00
|
|
|
|
2017-12-27 03:32:23 +00:00
|
|
|
buildInputs = if enableX11 then [xlibsWrapper] else [];
|
|
|
|
|
2013-01-12 11:43:47 +00:00
|
|
|
configurePhase =
|
|
|
|
'' (cd src && ./configure)
|
|
|
|
(cd doc && ./configure)
|
|
|
|
'';
|
|
|
|
|
2010-04-24 11:09:53 +00:00
|
|
|
buildPhase =
|
2011-10-30 11:51:55 +00:00
|
|
|
'' cd src
|
|
|
|
${if bootstrapFromC
|
|
|
|
then "./etc/make-liarc.sh --prefix=$out"
|
|
|
|
else "make compile-microcode"}
|
|
|
|
|
|
|
|
cd ../doc
|
|
|
|
|
|
|
|
# Provide a `texinfo.tex'.
|
|
|
|
export TEXINPUTS="$(echo ${automake}/share/automake-*)"
|
|
|
|
echo "\$TEXINPUTS is \`$TEXINPUTS'"
|
|
|
|
make
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase =
|
2013-01-12 11:43:47 +00:00
|
|
|
'' make prefix=$out install -C src
|
|
|
|
make prefix=$out install -C doc
|
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase =
|
|
|
|
'' wrapProgram $out/bin/mit-scheme${arch} --set MITSCHEME_LIBRARY_PATH \
|
|
|
|
$out/lib/mit-scheme${arch}
|
2011-10-30 11:51:55 +00:00
|
|
|
'';
|
2010-04-24 11:09:53 +00:00
|
|
|
|
2013-01-22 22:23:53 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper gnum4 texinfo texLive automake ];
|
2010-03-17 15:32:12 +00:00
|
|
|
|
|
|
|
# XXX: The `check' target doesn't exist.
|
|
|
|
doCheck = false;
|
|
|
|
|
2014-08-21 17:40:13 +00:00
|
|
|
meta = with stdenv.lib; {
|
2010-03-17 15:32:12 +00:00
|
|
|
description = "MIT/GNU Scheme, a native code Scheme compiler";
|
|
|
|
|
|
|
|
longDescription =
|
|
|
|
'' MIT/GNU Scheme is an implementation of the Scheme programming
|
|
|
|
language, providing an interpreter, compiler, source-code debugger,
|
|
|
|
integrated Emacs-like editor, and a large runtime library. MIT/GNU
|
|
|
|
Scheme is best suited to programming large applications with a rapid
|
|
|
|
development cycle.
|
|
|
|
'';
|
|
|
|
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.gnu.org/software/mit-scheme/";
|
2010-03-17 15:32:12 +00:00
|
|
|
|
2014-08-21 17:40:13 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2010-03-17 15:32:12 +00:00
|
|
|
|
2015-01-13 21:33:24 +00:00
|
|
|
maintainers = [ ];
|
2010-04-24 21:03:00 +00:00
|
|
|
|
|
|
|
# Build fails on Cygwin and Darwin:
|
|
|
|
# <http://article.gmane.org/gmane.lisp.scheme.mit-scheme.devel/489>.
|
2018-04-30 22:51:17 +00:00
|
|
|
platforms = platforms.gnu ++ platforms.linux ++ platforms.freebsd;
|
2010-03-17 15:32:12 +00:00
|
|
|
};
|
|
|
|
}
|