2021-01-22 12:25:31 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2019-04-11 12:29:08 +02:00
|
|
|
, coreutils, cctools
|
|
|
|
, ncurses, libiconv, libX11, libuuid
|
|
|
|
}:
|
2016-05-01 05:05:16 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "chez-scheme";
|
2020-10-21 08:31:49 +02:00
|
|
|
version = "9.5.4";
|
2016-05-01 05:05:16 +02:00
|
|
|
|
2019-04-11 12:29:08 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cisco";
|
|
|
|
repo = "ChezScheme";
|
|
|
|
rev = "refs/tags/v${version}";
|
2020-10-21 08:31:49 +02:00
|
|
|
sha256 = "065dir19cqpn0d1bk9w49wnwzn6qfrgvcqw8da2fdhkafhfcb1bj";
|
2016-05-01 05:05:16 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
nativeBuildInputs = [ coreutils ] ++ lib.optional stdenv.isDarwin cctools;
|
2019-04-11 12:29:08 +02:00
|
|
|
buildInputs = [ ncurses libiconv libX11 libuuid ];
|
2016-05-01 05:05:16 +02:00
|
|
|
|
2018-02-10 21:03:48 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
|
2019-01-11 10:23:07 +01:00
|
|
|
|
2018-02-10 21:03:48 +01:00
|
|
|
/*
|
|
|
|
** We patch out a very annoying 'feature' in ./configure, which
|
2016-05-08 05:40:43 +02:00
|
|
|
** tries to use 'git' to update submodules.
|
2016-05-01 05:05:16 +02:00
|
|
|
**
|
2016-05-08 05:40:43 +02: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 05:05:16 +02:00
|
|
|
*/
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ./configure \
|
2017-10-29 02:04:16 +02:00
|
|
|
--replace "git submodule init && git submodule update || exit 1" "true"
|
2016-05-02 00:10:18 +02:00
|
|
|
|
|
|
|
substituteInPlace ./workarea \
|
2017-11-29 20:00:18 +01:00
|
|
|
--replace "/bin/ln" ln \
|
|
|
|
--replace "/bin/cp" cp
|
2016-05-02 00:10:18 +02:00
|
|
|
|
|
|
|
substituteInPlace ./makefiles/installsh \
|
|
|
|
--replace "/usr/bin/true" "${coreutils}/bin/true"
|
2017-11-29 20:00:18 +01:00
|
|
|
|
|
|
|
substituteInPlace zlib/configure \
|
|
|
|
--replace "/usr/bin/libtool" libtool
|
2016-05-01 05:05:16 +02:00
|
|
|
'';
|
|
|
|
|
2018-02-10 21:03:48 +01:00
|
|
|
/*
|
|
|
|
** Don't use configureFlags, since that just implicitly appends
|
2016-05-01 05:05:16 +02:00
|
|
|
** everything onto a --prefix flag, which ./configure gets very angry
|
|
|
|
** about.
|
2018-02-10 21:03:48 +01: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 05:05:16 +02:00
|
|
|
*/
|
|
|
|
configurePhase = ''
|
2019-04-11 12:29:08 +02:00
|
|
|
./configure --threads --installprefix=$out --installman=$out/share/man
|
2016-05-01 05:05:16 +02:00
|
|
|
'';
|
|
|
|
|
2018-02-10 21:03:48 +01:00
|
|
|
/*
|
2019-04-11 12:29:08 +02:00
|
|
|
** Clean up some of the examples from the build output.
|
2018-02-10 21:03:48 +01:00
|
|
|
*/
|
|
|
|
postInstall = ''
|
2019-04-11 12:29:08 +02:00
|
|
|
rm -rf $out/lib/csv${version}/examples
|
2018-02-10 21:03:48 +01:00
|
|
|
'';
|
2017-11-29 20:00:18 +01:00
|
|
|
|
2020-09-16 22:41:47 +02:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2016-05-01 05:05:16 +02:00
|
|
|
meta = {
|
2019-04-11 12:29:08 +02:00
|
|
|
description = "A powerful and incredibly fast R6RS Scheme compiler";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://cisco.github.io/ChezScheme/";
|
2021-01-22 12:25:31 +01:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
|
|
|
platforms = lib.platforms.unix;
|
2018-12-10 04:48:36 +01:00
|
|
|
badPlatforms = [ "aarch64-linux" ];
|
2016-05-01 05:05:16 +02:00
|
|
|
};
|
|
|
|
}
|