depot/third_party/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

47 lines
1 KiB
Nix

{ lib
, stdenv
, fetchurl
, jre
, autoPatchelfHook
, zlib
}:
stdenv.mkDerivation rec {
pname = "sbt";
version = "1.4.8";
src = fetchurl {
url =
"https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz";
sha256 = "sha256-WXItvaPW0dfsfcPiHWGi6AAjAwpCQ4I+7q3XftnFo50=";
};
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;
};
}