2019-04-11 11:29:08 +01:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, coreutils, cctools
|
|
|
|
, ncurses, libiconv, libX11, libuuid
|
|
|
|
}:
|
2016-05-01 04:05:16 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "chez-scheme-${version}";
|
2019-04-11 11:29:08 +01:00
|
|
|
version = "9.5.2";
|
2016-05-01 04:05:16 +01:00
|
|
|
|
2019-04-11 11:29:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cisco";
|
|
|
|
repo = "ChezScheme";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "1gsjmsvsj31q5l9bjvm869y7bakrvl41yq94vyqdx8zwcr1bmpjf";
|
2016-05-01 04:05:16 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2017-11-29 19:00:18 +00:00
|
|
|
nativeBuildInputs = [ coreutils ] ++ stdenv.lib.optional stdenv.isDarwin cctools;
|
2019-04-11 11:29:08 +01:00
|
|
|
buildInputs = [ ncurses libiconv libX11 libuuid ];
|
2016-05-01 04:05:16 +01:00
|
|
|
|
2018-02-10 20:03:48 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
/*
|
|
|
|
** We patch out a very annoying 'feature' in ./configure, which
|
2016-05-08 04:40:43 +01:00
|
|
|
** tries to use 'git' to update submodules.
|
2016-05-01 04:05:16 +01:00
|
|
|
**
|
2016-05-08 04:40:43 +01:00
|
|
|
** We have to also fix a few occurrences to tools with absolute
|
|
|
|
** paths in some helper scripts, otherwise the build will fail on
|
|
|
|
** NixOS or in any chroot build.
|
2016-05-01 04:05:16 +01:00
|
|
|
*/
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ./configure \
|
2017-10-29 01:04:16 +01:00
|
|
|
--replace "git submodule init && git submodule update || exit 1" "true"
|
2016-05-01 23:10:18 +01:00
|
|
|
|
|
|
|
substituteInPlace ./workarea \
|
2017-11-29 19:00:18 +00:00
|
|
|
--replace "/bin/ln" ln \
|
|
|
|
--replace "/bin/cp" cp
|
2016-05-01 23:10:18 +01:00
|
|
|
|
|
|
|
substituteInPlace ./makefiles/installsh \
|
|
|
|
--replace "/usr/bin/true" "${coreutils}/bin/true"
|
2017-11-29 19:00:18 +00:00
|
|
|
|
|
|
|
substituteInPlace zlib/configure \
|
|
|
|
--replace "/usr/bin/libtool" libtool
|
2016-05-01 04:05:16 +01:00
|
|
|
'';
|
|
|
|
|
2018-02-10 20:03:48 +00:00
|
|
|
/*
|
|
|
|
** Don't use configureFlags, since that just implicitly appends
|
2016-05-01 04:05:16 +01:00
|
|
|
** everything onto a --prefix flag, which ./configure gets very angry
|
|
|
|
** about.
|
2018-02-10 20:03:48 +00:00
|
|
|
**
|
|
|
|
** Also, carefully set a manual workarea argument, so that we
|
|
|
|
** can later easily find the machine type that we built Chez
|
|
|
|
** for.
|
2016-05-01 04:05:16 +01:00
|
|
|
*/
|
|
|
|
configurePhase = ''
|
2019-04-11 11:29:08 +01:00
|
|
|
./configure --threads --installprefix=$out --installman=$out/share/man
|
2016-05-01 04:05:16 +01:00
|
|
|
'';
|
|
|
|
|
2018-02-10 20:03:48 +00:00
|
|
|
/*
|
2019-04-11 11:29:08 +01:00
|
|
|
** Clean up some of the examples from the build output.
|
2018-02-10 20:03:48 +00:00
|
|
|
*/
|
|
|
|
postInstall = ''
|
2019-04-11 11:29:08 +01:00
|
|
|
rm -rf $out/lib/csv${version}/examples
|
2018-02-10 20:03:48 +00:00
|
|
|
'';
|
2017-11-29 19:00:18 +00:00
|
|
|
|
2016-05-01 04:05:16 +01:00
|
|
|
meta = {
|
2019-04-11 11:29:08 +01:00
|
|
|
description = "A powerful and incredibly fast R6RS Scheme compiler";
|
|
|
|
homepage = https://cisco.github.io/ChezScheme/;
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-12-10 03:48:36 +00:00
|
|
|
badPlatforms = [ "aarch64-linux" ];
|
2016-05-01 04:05:16 +01:00
|
|
|
};
|
|
|
|
}
|