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 # remove forbidden references to $TMPDIR
49 preFixup = lib.optionalString stdenv.isLinux ''
50 for f in "$out"/bin/*; do
51 if isELF "$f"; then
52 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
53 fi
54 done
55 '';
56
57 meta = {
58 description = "Efficient Scheme compiler";
59 homepage = "http://www-sop.inria.fr/indes/fp/Bigloo/";
60 license = lib.licenses.gpl2Plus;
61 platforms = lib.platforms.unix;
62 maintainers = with lib.maintainers; [ thoughtpolice ];
63 broken = stdenv.isDarwin && stdenv.isAarch64; # segfault during build
64
65 longDescription = ''
66 Bigloo is a Scheme implementation devoted to one goal: enabling
67 Scheme based programming style where C(++) is usually
68 required. Bigloo attempts to make Scheme practical by offering
69 features usually presented by traditional programming languages
70 but not offered by Scheme and functional programming. Bigloo
71 compiles Scheme modules. It delivers small and fast stand alone
72 binary executables. Bigloo enables full connections between
73 Scheme and C programs, between Scheme and Java programs, and
74 between Scheme and C# programs.
75 '';
76 };
77}