nixpkgs/pkgs/development/compilers/chez/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, coreutils, cctools
, ncurses, libiconv, libX11, libuuid
}:
stdenv.mkDerivation rec {
pname = "chez-scheme";
2021-12-11 12:30:40 +00:00
version = "9.5.6";
src = fetchFromGitHub {
owner = "cisco";
repo = "ChezScheme";
rev = "refs/tags/v${version}";
2021-12-11 12:30:40 +00:00
sha256 = "sha256-1C5fEbVIpFXlDQ5wFmYZ2nrDUq9jBmvnku/7f0MH7vc=";
fetchSubmodules = true;
};
nativeBuildInputs = [ coreutils ] ++ lib.optional stdenv.isDarwin cctools;
buildInputs = [ ncurses libiconv libX11 libuuid ];
enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
2019-01-11 09:23:07 +00:00
/*
** We patch out a very annoying 'feature' in ./configure, which
** tries to use 'git' to update submodules.
**
** 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.
*/
patchPhase = ''
substituteInPlace ./configure \
2017-10-29 00:04:16 +00:00
--replace "git submodule init && git submodule update || exit 1" "true"
substituteInPlace ./workarea \
2017-11-29 19:00:18 +00:00
--replace "/bin/ln" ln \
--replace "/bin/cp" cp
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
'';
/*
** Don't use configureFlags, since that just implicitly appends
** everything onto a --prefix flag, which ./configure gets very angry
** about.
**
** Also, carefully set a manual workarea argument, so that we
** can later easily find the machine type that we built Chez
** for.
*/
configurePhase = ''
./configure --threads --installprefix=$out --installman=$out/share/man
'';
/*
** Clean up some of the examples from the build output.
*/
postInstall = ''
rm -rf $out/lib/csv${version}/examples
'';
2017-11-29 19:00:18 +00:00
setupHook = ./setup-hook.sh;
meta = {
description = "A powerful and incredibly fast R6RS Scheme compiler";
homepage = "https://cisco.github.io/ChezScheme/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ thoughtpolice ];
platforms = lib.platforms.unix;
badPlatforms = [ "aarch64-linux" "aarch64-darwin" ];
};
}