nixpkgs/pkgs/by-name/bl/bloop/package.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";
2024-11-07 16:43:11 +00:00
version = "2.0.5";
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 =
2024-11-07 16:43:11 +00:00
if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64 then "sha256-COsGPMCsl3hTcw9JOZ6/LnQAhsNCXMvC0sDLqhHrY1o="
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then "sha256-oXfdHIvmEtjh+Ohpu8R2VbrR+YbEQKI6l2cYiG/kQnk="
else if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "sha256-+C8uY1TsqCy0Ml7GBovjGN4rAzkTqRSv5M0EI0l2tds="
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;
buildInputs = [ (lib.getLib stdenv.cc.cc) zlib ];
2020-07-11 09:37:59 +00:00
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" ];
2024-10-09 12:15:10 +00:00
maintainers = with maintainers; [ agilesteel kubukoz tomahna ];
2018-06-03 19:48:05 +00:00
};
}