2020-08-20 17:08:02 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoPatchelfHook
|
|
|
|
, installShellFiles
|
2021-12-06 16:07:01 +00:00
|
|
|
, makeWrapper
|
2020-08-20 17:08:02 +00:00
|
|
|
, jre
|
|
|
|
, lib
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bloop";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.5.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
platform =
|
|
|
|
if stdenv.isLinux && stdenv.isx86_64 then "x86_64-pc-linux"
|
|
|
|
else if stdenv.isDarwin && stdenv.isx86_64 then "x86_64-apple-darwin"
|
|
|
|
else throw "unsupported platform";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
bloop-bash = fetchurl {
|
|
|
|
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/bash-completions";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-2mt+zUEJvQ/5ixxFLZ3Z0m7uDSj/YE9sg/uNMjamvdE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
bloop-fish = fetchurl {
|
|
|
|
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/fish-completions";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-eFESR6iPHRDViGv+Fk3sCvPgVAhk2L1gCG4LnfXO/v4=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
bloop-zsh = fetchurl {
|
|
|
|
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/zsh-completions";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-WNMsPwBfd5EjeRbRtc06lCEVI2FVoLfrqL82OR0G7/c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
bloop-binary = fetchurl rec {
|
|
|
|
url = "https://github.com/scalacenter/bloop/releases/download/v${version}/bloop-${platform}";
|
|
|
|
sha256 =
|
|
|
|
if stdenv.isLinux && stdenv.isx86_64 then "sha256-jif9z05W17vjFgb146qWC3o44HmbnX05gWPlbXttYsE="
|
|
|
|
else if stdenv.isDarwin && stdenv.isx86_64 then "sha256-YOnXgKXsGrTu9P4I0NZW6ollZVQUXnbW8WtZTJmy+w0="
|
|
|
|
else throw "unsupported platform";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
dontUnpack = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ]
|
|
|
|
++ lib.optional stdenv.isLinux autoPatchelfHook;
|
2020-08-20 17:08:02 +00:00
|
|
|
buildInputs = [ stdenv.cc.cc.lib zlib ];
|
|
|
|
propagatedBuildInputs = [ jre ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
install -D -m 0755 ${bloop-binary} $out/.bloop-wrapped
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
makeWrapper $out/.bloop-wrapped $out/bin/bloop
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
#Install completions
|
|
|
|
installShellCompletion --name bloop --bash ${bloop-bash}
|
|
|
|
installShellCompletion --name _bloop --zsh ${bloop-zsh}
|
|
|
|
installShellCompletion --name bloop.fish --fish ${bloop-fish}
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://scalacenter.github.io/bloop/";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A Scala build server and command-line tool to make the compile and test developer workflows fast and productive in a build-tool-agnostic way";
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ kubukoz tomahna ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|