1{stdenv, fetchurl
2, libtool, autoconf, automake
3, gmp, mpfr, libffi, makeWrapper
4, noUnicode ? false
5, gcc
6, threadSupport ? true
7}:
8let
9 s = # Generated upstream information
10 rec {
11 baseName="ecl";
12 version="16.1.3";
13 name="${baseName}-${version}";
14 hash="0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn";
15 url="https://common-lisp.net/project/ecl/static/files/release/ecl-16.1.3.tgz";
16 sha256="0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn";
17 };
18 buildInputs = [
19 libtool autoconf automake makeWrapper
20 ];
21 propagatedBuildInputs = [
22 libffi gmp mpfr gcc
23 ];
24in
25stdenv.mkDerivation {
26 inherit (s) name version;
27 inherit buildInputs propagatedBuildInputs;
28
29 src = fetchurl {
30 inherit (s) url sha256;
31 };
32
33 configureFlags = [
34 (if threadSupport then "--enable-threads" else "--disable-threads")
35 "--with-gmp-prefix=${gmp.dev}"
36 "--with-libffi-prefix=${libffi.dev}"
37 ]
38 ++
39 (stdenv.lib.optional (! noUnicode)
40 "--enable-unicode")
41 ;
42
43 hardeningDisable = [ "format" ];
44
45 postInstall = ''
46 sed -e 's/@[-a-zA-Z_]*@//g' -i $out/bin/ecl-config
47 wrapProgram "$out/bin/ecl" \
48 --prefix PATH ':' "${gcc}/bin" \
49 --prefix NIX_LDFLAGS ' ' "-L${gmp.lib or gmp.out or gmp}/lib" \
50 --prefix NIX_LDFLAGS ' ' "-L${libffi.lib or libffi.out or libffi}/lib"
51 '';
52
53 meta = {
54 inherit (s) version;
55 description = "Lisp implementation aiming to be small, fast and easy to embed";
56 license = stdenv.lib.licenses.mit ;
57 maintainers = [stdenv.lib.maintainers.raskin];
58 platforms = stdenv.lib.platforms.linux;
59 };
60}