1{ lib, stdenv, fetchFromGitHub, gmp, perl }:
2
3stdenv.mkDerivation rec {
4 pname = "mosml";
5 version = "2.10.1";
6
7 buildInputs = [ gmp perl ];
8
9 makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" ];
10
11 src = fetchFromGitHub {
12 owner = "kfl";
13 repo = "mosml";
14 rev = "ver-${version}";
15 sha256 = "sha256-GK39WvM7NNhoC5f0Wjy4/5VWT+Rbh2qo+W71hWrbPso=";
16 };
17
18 setSourceRoot = ''export sourceRoot="$(echo */src)"'';
19
20 # MosML needs a specific RPATH entry pointing to $(out)/lib (added
21 # by the build system), which patchelf will remove.
22 dontPatchELF = true;
23
24 meta = with lib; {
25 description = "A light-weight implementation of Standard ML";
26 longDescription = ''
27 Moscow ML is a light-weight implementation of Standard ML (SML), a strict
28 functional language used in teaching and research.
29 '';
30 homepage = "https://mosml.org/";
31 license = licenses.gpl2;
32 platforms = platforms.unix;
33 maintainers = with maintainers; [ vaibhavsagar ];
34 };
35}