2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mill";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.9.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "https://github.com/com-lihaoyi/mill/releases/download/${version}/${version}-assembly";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-JbZorHeBznBb+R9JjPQBNKlTdNNzg1G82OxWvBtNg5Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
# this is mostly downloading a pre-built artifact
|
|
|
|
preferLocal = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -Dm555 "$src" "$out/bin/.mill-wrapped"
|
|
|
|
# can't use wrapProgram because it sets --argv0
|
|
|
|
makeWrapper "$out/bin/.mill-wrapped" "$out/bin/mill" \
|
|
|
|
--prefix PATH : "${jre}/bin" \
|
2020-11-15 13:44:38 +00:00
|
|
|
--set JAVA_HOME "${jre}"
|
2020-04-24 23:36:52 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
# The default release is a script which will do an impure download
|
|
|
|
# just ensure that the application can run without network
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/mill --help > /dev/null
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.lihaoyi.com/mill";
|
|
|
|
license = licenses.mit;
|
|
|
|
description = "A build tool for Scala, Java and more";
|
|
|
|
longDescription = ''
|
|
|
|
Mill is a build tool borrowing ideas from modern tools like Bazel, to let you build
|
|
|
|
your projects in a way that's simple, fast, and predictable. Mill has built in
|
|
|
|
support for the Scala programming language, and can serve as a replacement for
|
|
|
|
SBT, but can also be extended to support any other language or platform via
|
|
|
|
modules (written in Java or Scala) or through an external subprocesses.
|
|
|
|
'';
|
|
|
|
maintainers = with maintainers; [ scalavision ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|