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-08-21 13:32:41 +00:00
|
|
|
version = "1.7.1";
|
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-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-ihg6/bNRkpDd4vjIHJsrrRnd14c17zEftfub3PaNP+Q=";
|
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
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
|
|
|
stdenv.cc.cc # libstdc++.so.6
|
|
|
|
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;
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A build tool for Scala, Java and more";
|
|
|
|
maintainers = with maintainers; [ nequissimus ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|