Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gmp, libffi }:
2
3stdenv.mkDerivation rec {
4 pname = "polyml";
5 version = "5.8";
6
7 prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
8 substituteInPlace configure.ac --replace stdc++ c++
9 '';
10
11 patches = [
12 (fetchpatch {
13 name = "new-libffi-FFI_SYSV.patch";
14 url = "https://github.com/polyml/polyml/commit/ad32de7f181acaffaba78d5c3d9e5aa6b84a741c.patch";
15 sha256 = "007q3r2h9kfh3c1nv0dyhipmak44q468ab9bwnz4kk4a2dq76n8v";
16 })
17 ];
18
19 buildInputs = [ libffi gmp ];
20
21 nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
22
23 configureFlags = [
24 "--enable-shared"
25 "--with-system-libffi"
26 "--with-gmp"
27 ];
28
29 src = fetchFromGitHub {
30 owner = "polyml";
31 repo = "polyml";
32 rev = "v${version}";
33 sha256 = "1s7q77bivppxa4vd7gxjj5dbh66qnirfxnkzh1ql69rfx1c057n3";
34 };
35
36 meta = with stdenv.lib; {
37 description = "Standard ML compiler and interpreter";
38 longDescription = ''
39 Poly/ML is a full implementation of Standard ML.
40 '';
41 homepage = https://www.polyml.org/;
42 license = licenses.lgpl21;
43 platforms = with platforms; (linux ++ darwin);
44 maintainers = with maintainers; [ maggesi kovirobi ];
45 };
46}