2021-02-21 15:34:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, jre
|
|
|
|
, autoPatchelfHook
|
|
|
|
, zlib
|
|
|
|
}:
|
2010-05-08 22:51:47 +01:00
|
|
|
|
2013-11-05 13:19:11 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "sbt";
|
2021-04-06 07:44:54 +01:00
|
|
|
version = "1.5.0";
|
2013-05-14 23:41:22 +01:00
|
|
|
|
2013-11-05 13:19:11 +00:00
|
|
|
src = fetchurl {
|
2021-03-10 19:31:11 +00:00
|
|
|
url = "https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz";
|
2021-04-06 07:44:54 +01:00
|
|
|
sha256 = "1dj241cj3v8kzqnz5s499rijpl7wv4rw171swqnc0xza90513pxa";
|
2013-05-14 23:41:22 +01:00
|
|
|
};
|
2010-05-08 22:51:47 +01:00
|
|
|
|
2021-02-26 15:33:00 +00:00
|
|
|
postPatch = ''
|
2015-09-25 15:54:35 +01:00
|
|
|
echo -java-home ${jre.home} >>conf/sbtopts
|
|
|
|
'';
|
2013-05-14 23:41:22 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
|
2020-10-05 11:03:53 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ zlib ];
|
2020-10-05 11:03:53 +01:00
|
|
|
|
2013-05-14 23:41:22 +01:00
|
|
|
installPhase = ''
|
2021-02-26 15:33:00 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2015-09-25 15:54:35 +01:00
|
|
|
mkdir -p $out/share/sbt $out/bin
|
|
|
|
cp -ra . $out/share/sbt
|
2020-10-05 11:03:53 +01:00
|
|
|
ln -sT ../share/sbt/bin/sbt $out/bin/sbt
|
2020-10-08 15:50:33 +01:00
|
|
|
ln -sT ../share/sbt/bin/sbtn-x86_64-${
|
|
|
|
if (stdenv.isDarwin) then "apple-darwin" else "pc-linux"
|
|
|
|
} $out/bin/sbtn
|
2013-05-14 23:41:22 +01:00
|
|
|
|
2021-02-26 15:33:00 +00:00
|
|
|
runHook postInstall
|
2021-02-21 15:34:07 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 19:55:05 +01:00
|
|
|
homepage = "https://www.scala-sbt.org/";
|
2016-07-21 11:29:14 +01:00
|
|
|
license = licenses.bsd3;
|
2013-11-05 13:19:11 +00:00
|
|
|
description = "A build tool for Scala, Java and more";
|
2019-08-20 14:24:01 +01:00
|
|
|
maintainers = with maintainers; [ nequissimus ];
|
2016-07-21 11:29:14 +01:00
|
|
|
platforms = platforms.unix;
|
2014-06-05 11:36:39 +01:00
|
|
|
};
|
2013-05-14 23:41:22 +01:00
|
|
|
}
|