Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub 2, coreutils, cctools 3, ncurses, libiconv, libX11, libuuid 4}: 5 6stdenv.mkDerivation rec { 7 pname = "chez-scheme"; 8 version = "9.5.8a"; 9 10 src = fetchFromGitHub { 11 owner = "cisco"; 12 repo = "ChezScheme"; 13 rev = "refs/tags/v${version}"; 14 sha256 = "sha256-d8DgHATZzZbOYODHFKTqg4oWg/wja8jQgcCVpj8j6yQ="; 15 fetchSubmodules = true; 16 }; 17 18 nativeBuildInputs = lib.optional stdenv.isDarwin cctools; 19 buildInputs = [ ncurses libiconv libX11 libuuid ]; 20 21 enableParallelBuilding = true; 22 23 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"; 24 25 /* 26 ** We patch out a very annoying 'feature' in ./configure, which 27 ** tries to use 'git' to update submodules. 28 ** 29 ** We have to also fix a few occurrences to tools with absolute 30 ** paths in some helper scripts, otherwise the build will fail on 31 ** NixOS or in any chroot build. 32 */ 33 patchPhase = '' 34 substituteInPlace ./configure \ 35 --replace "git submodule init && git submodule update || exit 1" "true" 36 37 substituteInPlace ./workarea \ 38 --replace "/bin/ln" ln \ 39 --replace "/bin/cp" cp 40 41 substituteInPlace ./makefiles/installsh \ 42 --replace "/usr/bin/true" "${coreutils}/bin/true" 43 44 substituteInPlace zlib/configure \ 45 --replace "/usr/bin/libtool" libtool 46 ''; 47 48 /* 49 ** Don't use configureFlags, since that just implicitly appends 50 ** everything onto a --prefix flag, which ./configure gets very angry 51 ** about. 52 ** 53 ** Also, carefully set a manual workarea argument, so that we 54 ** can later easily find the machine type that we built Chez 55 ** for. 56 */ 57 configurePhase = '' 58 ./configure --threads --installprefix=$out --installman=$out/share/man 59 ''; 60 61 /* 62 ** Clean up some of the examples from the build output. 63 */ 64 postInstall = '' 65 rm -rf $out/lib/csv${version}/examples 66 ''; 67 68 setupHook = ./setup-hook.sh; 69 70 meta = { 71 description = "A powerful and incredibly fast R6RS Scheme compiler"; 72 homepage = "https://cisco.github.io/ChezScheme/"; 73 license = lib.licenses.asl20; 74 maintainers = with lib.maintainers; [ thoughtpolice ]; 75 platforms = lib.platforms.unix; 76 badPlatforms = [ "aarch64-linux" "aarch64-darwin" ]; 77 }; 78}