nixos/tests/userborn: fix setting hostPlatform (#378940)
[NixPkgs.git] / pkgs / by-name / sm / smlpkg / package.nix
blob6a77c6878e7b163a7f850f0bb46bedcc469a0da9
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   mlton,
6   unzip,
7 }:
9 stdenv.mkDerivation rec {
10   pname = "smlpkg";
11   version = "0.1.5";
13   src = fetchFromGitHub {
14     owner = "diku-dk";
15     repo = "smlpkg";
16     rev = "v${version}";
17     sha256 = "1xmbdnfc34ia0a78dhkfv5jyadxndinhw8c47l1mjd4l7n8vqnph";
18   };
20   enableParallelBuilding = true;
22   nativeBuildInputs = [ mlton ];
24   # Set as an environment variable in all the phase scripts.
25   MLCOMP = "mlton";
27   buildFlags = [ "all" ];
28   installFlags = [ "prefix=$(out)" ];
30   doCheck = true;
32   nativeCheckInputs = [ unzip ];
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   '';
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   };