1args:
2{
3 stdenv,
4 lib,
5 fetchFromGitHub,
6 coreutils,
7 cctools,
8 darwin,
9 ncurses,
10 libiconv,
11 libX11,
12 zlib,
13 lz4,
14}:
15
16stdenv.mkDerivation (
17 args
18 // {
19 version = "unstable-2021-12-11";
20
21 src = fetchFromGitHub {
22 owner = "racket";
23 repo = "ChezScheme";
24 rev = "8846c96b08561f05a937d5ecfe4edc96cc99be39";
25 sha256 = "IYJQzT88T8kFahx2BusDOyzz6lQDCbZIfSz9rZoNF7A=";
26 fetchSubmodules = true;
27 };
28
29 prePatch = ''
30 rm -rf zlib/*.c lz4/lib/*.c
31 '';
32
33 postPatch = ''
34 export ZLIB="$(find ${zlib.out}/lib -type f | sort | head -n1)"
35 export LZ4="$(find ${lz4.lib}/lib -type f | sort | head -n1)"
36 '';
37
38 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin ([
39 cctools
40 darwin.autoSignDarwinBinariesHook
41 ]);
42 buildInputs = [
43 libiconv
44 libX11
45 lz4
46 ncurses
47 zlib
48 ];
49
50 enableParallelBuilding = true;
51
52 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
53
54 meta = {
55 description = "Fork of Chez Scheme for Racket";
56 homepage = "https://github.com/racket/ChezScheme";
57 license = lib.licenses.asl20;
58 maintainers = with lib.maintainers; [ l-as ];
59 platforms = lib.platforms.unix;
60 };
61 }
62)