2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
, coreutils, cctools
|
2024-02-29 20:09:43 +00:00
|
|
|
, ncurses, libiconv, libX11, libuuid, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "chez-scheme";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "10.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/cisco/ChezScheme/releases/download/v${finalAttrs.version}/csv${finalAttrs.version}.tar.gz";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-03GZASte0ZhcQGnWqH/xjl4fWi3yfkApkfr0XcTyIyw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin cctools;
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ ncurses libiconv libX11 libuuid ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
|
2020-04-24 23:36:52 +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 ./makefiles/installsh \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-warn "/usr/bin/true" "${coreutils}/bin/true"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
substituteInPlace zlib/configure \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-warn "/usr/bin/libtool" libtool
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
/*
|
|
|
|
** 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 = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
./configure --as-is --threads --installprefix=$out --installman=$out/share/man
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Clean up some of the examples from the build output.
|
|
|
|
*/
|
|
|
|
postInstall = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
rm -rf $out/lib/csv${finalAttrs.version}/examples
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "A powerful and incredibly fast R6RS Scheme compiler";
|
|
|
|
homepage = "https://cisco.github.io/ChezScheme/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
|
|
|
platforms = lib.platforms.unix;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "scheme";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|