depot/third_party/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
Default email a425ba4985 Project import generated by Copybara.
GitOrigin-RevId: 5b091d4fbe3b7b7493c3b46fe0842e4b30ea24b3
2021-12-30 14:39:12 +01:00

46 lines
1 KiB
Nix

{ lib
, stdenv
, fetchurl
, jre
, autoPatchelfHook
, zlib
}:
stdenv.mkDerivation rec {
pname = "sbt";
version = "1.6.0";
src = fetchurl {
url = "https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz";
sha256 = "sha256-Y52xcPZRDQ+IX/QAVGRODshbuDb5oJA45r9OT2Jxusw=";
};
postPatch = ''
echo -java-home ${jre.home} >>conf/sbtopts
'';
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
buildInputs = lib.optionals stdenv.isLinux [ zlib ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/sbt $out/bin
cp -ra . $out/share/sbt
ln -sT ../share/sbt/bin/sbt $out/bin/sbt
ln -sT ../share/sbt/bin/sbtn-x86_64-${
if (stdenv.isDarwin) then "apple-darwin" else "pc-linux"
} $out/bin/sbtn
runHook postInstall
'';
meta = with lib; {
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;
};
}