1{ lib
2, stdenv
3, fetchFromGitHub
4, autoreconfHook
5, gmp
6, libffi
7}:
8
9stdenv.mkDerivation rec {
10 pname = "polyml";
11 version = "5.9.1";
12
13 src = fetchFromGitHub {
14 owner = "polyml";
15 repo = "polyml";
16 rev = "v${version}";
17 sha256 = "sha256-72wm8dt+Id59A5058mVE5P9TkXW5/LZRthZoxUustVA=";
18 };
19
20 prePatch = lib.optionalString stdenv.isDarwin ''
21 substituteInPlace configure.ac --replace stdc++ c++
22 '';
23
24 buildInputs = [ libffi gmp ];
25
26 nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
27
28 configureFlags = [
29 "--enable-shared"
30 "--with-system-libffi"
31 "--with-gmp"
32 ];
33
34 doCheck = true;
35
36 checkPhase = ''
37 runHook preCheck
38 make check
39 runHook postCheck
40 '';
41
42 meta = with lib; {
43 description = "Standard ML compiler and interpreter";
44 longDescription = ''
45 Poly/ML is a full implementation of Standard ML.
46 '';
47 homepage = "https://www.polyml.org/";
48 license = licenses.lgpl21;
49 platforms = with platforms; (linux ++ darwin);
50 maintainers = with maintainers; [ maggesi kovirobi ];
51 };
52}