1{ fetchurl, lib, stdenv, autoconf, automake, libtool, gmp
2, darwin, libunistring
3}:
4
5stdenv.mkDerivation rec {
6 pname = "bigloo";
7 version = "4.4b";
8
9 src = fetchurl {
10 url = "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo-${version}.tar.gz";
11 sha256 = "sha256-oxOSJwKWmwo7PYAwmeoFrKaYdYvmvQquWXyutolc488=";
12 };
13
14 nativeBuildInputs = [ autoconf automake libtool ];
15
16 buildInputs = lib.optionals stdenv.isDarwin [
17 darwin.apple_sdk.frameworks.ApplicationServices
18 libunistring
19 ];
20
21 propagatedBuildInputs = [ gmp ];
22
23 preConfigure =
24 # For libuv on darwin
25 lib.optionalString stdenv.isDarwin ''
26 export LIBTOOLIZE=libtoolize
27 '' +
28 # Help libgc's configure.
29 '' export CXXCPP="$CXX -E"
30 '';
31
32 patchPhase = ''
33 # Fix absolute paths.
34 sed -e 's=/bin/mv=mv=g' -e 's=/bin/rm=rm=g' \
35 -e 's=/tmp=$TMPDIR=g' -i autoconf/* \
36 [Mm]akefile* */[Mm]akefile* */*/[Mm]akefile* \
37 */*/*/[Mm]akefile* */*/*/*/[Mm]akefile* \
38 comptime/Cc/cc.scm gc/install-*
39
40 # Make sure we don't change string lengths in the generated
41 # C files.
42 sed -e 's=/bin/rm= rm=g' -e 's=/bin/mv= mv=g' \
43 -i comptime/Cc/cc.c
44 '';
45
46 checkTarget = "test";
47
48 # Hack to avoid TMPDIR in RPATHs.
49 preFixup = ''rm -rf "$(pwd)" '';
50
51 meta = {
52 description = "Efficient Scheme compiler";
53 homepage = "http://www-sop.inria.fr/indes/fp/Bigloo/";
54 license = lib.licenses.gpl2Plus;
55 platforms = lib.platforms.unix;
56 maintainers = with lib.maintainers; [ thoughtpolice ];
57 broken = stdenv.isDarwin && stdenv.isAarch64; # segfault during build
58
59 longDescription = ''
60 Bigloo is a Scheme implementation devoted to one goal: enabling
61 Scheme based programming style where C(++) is usually
62 required. Bigloo attempts to make Scheme practical by offering
63 features usually presented by traditional programming languages
64 but not offered by Scheme and functional programming. Bigloo
65 compiles Scheme modules. It delivers small and fast stand alone
66 binary executables. Bigloo enables full connections between
67 Scheme and C programs, between Scheme and Java programs, and
68 between Scheme and C# programs.
69 '';
70 };
71}