1{ stdenv, fetchFromGitHub, autoreconfHook, gmp, libffi }:
2
3stdenv.mkDerivation rec {
4 name = "polyml-${version}";
5 version = "5.7";
6
7 prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
8 substituteInPlace configure.ac --replace stdc++ c++
9 '';
10
11 buildInputs = [ libffi gmp ];
12
13 nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
14
15 configureFlags = [
16 "--enable-shared"
17 "--with-system-libffi"
18 "--with-gmp"
19 ];
20
21 src = fetchFromGitHub {
22 owner = "polyml";
23 repo = "polyml";
24 rev = "v${version}";
25 sha256 = "10nsljmcl0zjbcc7ifc991ypwfwq5gh4rcp5rg4nnb706c6bs16y";
26 };
27
28 meta = with stdenv.lib; {
29 description = "Standard ML compiler and interpreter";
30 longDescription = ''
31 Poly/ML is a full implementation of Standard ML.
32 '';
33 homepage = http://www.polyml.org/;
34 license = licenses.lgpl21;
35 platforms = with platforms; (linux ++ darwin);
36 maintainers = with maintainers; [ z77z yurrriq ];
37 };
38}