2021-02-24 18:30:23 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, jre
|
|
|
|
, autoPatchelfHook
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sbt";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "1.6.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-19 17:17:44 +00:00
|
|
|
url = "https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-Y3Y3tsTm+gSrYs02QGHjKxJICwkAHNIzA99is2+t1EA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
echo -java-home ${jre.home} >>conf/sbtopts
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ zlib ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2021-03-09 03:18:52 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/sbt $out/bin
|
|
|
|
cp -ra . $out/share/sbt
|
2020-10-07 09:15:18 +00:00
|
|
|
ln -sT ../share/sbt/bin/sbt $out/bin/sbt
|
2020-10-11 12:50:04 +00:00
|
|
|
ln -sT ../share/sbt/bin/sbtn-x86_64-${
|
|
|
|
if (stdenv.isDarwin) then "apple-darwin" else "pc-linux"
|
|
|
|
} $out/bin/sbtn
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
runHook postInstall
|
2021-02-24 18:30:23 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.scala-sbt.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
description = "A build tool for Scala, Java and more";
|
|
|
|
maintainers = with maintainers; [ nequissimus ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|