1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 mlton,
6 unzip,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "smlpkg";
11 version = "0.1.5";
12
13 src = fetchFromGitHub {
14 owner = "diku-dk";
15 repo = "smlpkg";
16 rev = "v${version}";
17 sha256 = "1xmbdnfc34ia0a78dhkfv5jyadxndinhw8c47l1mjd4l7n8vqnph";
18 };
19
20 enableParallelBuilding = true;
21
22 nativeBuildInputs = [ mlton ];
23
24 # Set as an environment variable in all the phase scripts.
25 MLCOMP = "mlton";
26
27 buildFlags = [ "all" ];
28 installFlags = [ "prefix=$(out)" ];
29
30 doCheck = true;
31
32 nativeCheckInputs = [ unzip ];
33
34 # We cannot run the pkgtests, as Nix does not allow network
35 # connections.
36 checkPhase = ''
37 runHook preCheck
38 make -C src test
39 runHook postCheck
40 '';
41
42 meta = with lib; {
43 description = "Generic package manager for Standard ML libraries and programs";
44 homepage = "https://github.com/diku-dk/smlpkg";
45 license = licenses.mit;
46 platforms = mlton.meta.platforms;
47 maintainers = with maintainers; [ athas ];
48 mainProgram = "smlpkg";
49 };
50}