nixpkgs/pkgs/development/tools/build-managers/bloop/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.7 KiB
Nix
Raw Normal View History

{ stdenv
, fetchurl
, autoPatchelfHook
2020-07-11 09:37:59 +00:00
, installShellFiles
2021-11-04 23:27:50 +00:00
, makeWrapper
2020-07-11 09:37:59 +00:00
, jre
, lib
, zlib
}:
2018-06-03 19:48:05 +00:00
stdenv.mkDerivation rec {
pname = "bloop";
version = "2.0.2";
2022-05-01 11:36:45 +00:00
platform =
if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64 then "x86_64-pc-linux"
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then "x86_64-apple-darwin"
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "aarch64-apple-darwin"
2022-05-01 11:36:45 +00:00
else throw "unsupported platform";
bloop-bash = fetchurl {
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/bash-completions";
2022-05-01 11:36:45 +00:00
sha256 = "sha256-2mt+zUEJvQ/5ixxFLZ3Z0m7uDSj/YE9sg/uNMjamvdE=";
};
bloop-fish = fetchurl {
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/fish-completions";
2022-05-01 11:36:45 +00:00
sha256 = "sha256-eFESR6iPHRDViGv+Fk3sCvPgVAhk2L1gCG4LnfXO/v4=";
2018-06-03 19:48:05 +00:00
};
bloop-zsh = fetchurl {
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/zsh-completions";
2022-05-01 11:36:45 +00:00
sha256 = "sha256-WNMsPwBfd5EjeRbRtc06lCEVI2FVoLfrqL82OR0G7/c=";
};
2022-05-01 11:36:45 +00:00
bloop-binary = fetchurl rec {
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/bloop-${platform}";
sha256 =
if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64 then "sha256-xYVfgi3ANjBiuf4/5FDgSYDL/fPsvuJn4jFxAEVYct4="
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then "sha256-lq0S2AsulcUUYDd3qnWonwd/W0/gb7lJwC+QTYTlTdg="
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "sha256-e+9Q7xIEsHloaKOj13vZnGs2vulkOJv7tCOuACobHvk="
2022-05-01 11:36:45 +00:00
else throw "unsupported platform";
2018-06-03 19:48:05 +00:00
};
2020-07-11 09:37:59 +00:00
dontUnpack = true;
nativeBuildInputs = [ installShellFiles makeWrapper ]
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
2020-07-11 09:37:59 +00:00
buildInputs = [ stdenv.cc.cc.lib zlib ];
propagatedBuildInputs = [ jre ];
2018-06-03 19:48:05 +00:00
installPhase = ''
2021-11-04 23:27:50 +00:00
runHook preInstall
2022-05-01 11:36:45 +00:00
install -D -m 0755 ${bloop-binary} $out/.bloop-wrapped
2018-06-03 19:48:05 +00:00
2022-05-01 11:36:45 +00:00
makeWrapper $out/.bloop-wrapped $out/bin/bloop
2018-06-03 19:48:05 +00:00
#Install completions
2020-07-11 09:37:59 +00:00
installShellCompletion --name bloop --bash ${bloop-bash}
installShellCompletion --name _bloop --zsh ${bloop-zsh}
installShellCompletion --name bloop.fish --fish ${bloop-fish}
2021-11-04 23:27:50 +00:00
runHook postInstall
2018-06-03 19:48:05 +00:00
'';
meta = with lib; {
homepage = "https://scalacenter.github.io/bloop/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2018-06-03 19:48:05 +00:00
license = licenses.asl20;
description = "Scala build server and command-line tool to make the compile and test developer workflows fast and productive in a build-tool-agnostic way";
mainProgram = "bloop";
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
2021-11-04 23:28:01 +00:00
maintainers = with maintainers; [ kubukoz tomahna ];
2018-06-03 19:48:05 +00:00
};
}