Bloop: 1.3.4 -> 1.4.1

This commit is contained in:
Karol Chmist 2020-05-21 16:47:18 +02:00 committed by Jon
parent 77cf1a6581
commit 9a6386fd6f

View File

@ -1,21 +1,33 @@
{ stdenv, lib, fetchurl, coursier, python, makeWrapper }: { stdenv, fetchurl, coursier,
autoPatchelfHook,
lib, zlib }:
let let
baseName = "bloop"; baseName = "bloop";
version = "1.3.4"; version = "1.4.1";
nailgunCommit = "d7ed5db"; # Fetched from https://github.com/scalacenter/bloop/releases/download/v${version}/install.py
client = stdenv.mkDerivation { client = stdenv.mkDerivation {
name = "${baseName}-client-${version}"; name = "${baseName}-client-${version}";
src = fetchurl { nativeBuildInputs = [ autoPatchelfHook ] ;
url = "https://raw.githubusercontent.com/scalacenter/nailgun/${nailgunCommit}/pynailgun/ng.py"; phases = [ "installPhase" "fixupPhase" ];
sha256 = "0lrj25m0nvphz2i5mqjwccpyrd7gn8a5k22k5khrpdh6ldxqis8a"; buildInputs = [ stdenv.cc.cc.lib zlib] ;
};
phases = [ "installPhase" ]; installPhase = ''
mkdir -p $out/bin
installPhase = ''cp $src $out'';
export COURSIER_CACHE=$(pwd)
${coursier}/bin/coursier install bloop:${version} \
--repository "bintray:scalameta/maven" \
--repository "bintray:scalacenter/releases" \
--repository "https://oss.sonatype.org/content/repositories/staging" \
--force \
--install-dir $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "01hgv0j0a4v8iqi638rcqdirpa30jwfp7gh7dvsk32apx003ylvb";
}; };
server = stdenv.mkDerivation { server = stdenv.mkDerivation {
@ -25,15 +37,17 @@ let
export COURSIER_CACHE=$(pwd) export COURSIER_CACHE=$(pwd)
${coursier}/bin/coursier bootstrap ch.epfl.scala:bloop-frontend_2.12:${version} \ ${coursier}/bin/coursier bootstrap ch.epfl.scala:bloop-frontend_2.12:${version} \
-r "bintray:scalameta/maven" \ --repository "bintray:scalameta/maven" \
-r "bintray:scalacenter/releases" \ --repository "bintray:scalacenter/releases" \
-r "https://oss.sonatype.org/content/repositories/staging" \ --repository "https://oss.sonatype.org/content/repositories/staging" \
--deterministic \ --deterministic \
-f --main bloop.Server -o $out/bin/blp-server --force \
--main bloop.Server \
--output $out/blp-server
''; '';
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
outputHash = "1z33ip6hgfwiixm2gimz819p5cnxn1fmxb3ryyf77jzwsx7py718"; outputHash = "01kyzb374kyicm1nmx6vzz42gj8cd9m6bd5dgrajkcr6q09jfgbg";
}; };
zsh = stdenv.mkDerivation { zsh = stdenv.mkDerivation {
@ -41,7 +55,7 @@ let
src = fetchurl { src = fetchurl {
url = "https://raw.githubusercontent.com/scalacenter/bloop/v${version}/etc/zsh/_bloop"; url = "https://raw.githubusercontent.com/scalacenter/bloop/v${version}/etc/zsh/_bloop";
sha256 = "09qq5888vaqlqan2jbs2qajz2c3ff13zj8r0x2pcxsqmvlqr02hp"; sha256 = "1xzg0qfkjdmzm3mvg82mc4iia8cl7b6vbl8ng4ir2xsz00zjrlsq";
}; };
phases = [ "installPhase" ]; phases = [ "installPhase" ];
@ -52,21 +66,16 @@ in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "${baseName}-${version}"; name = "${baseName}-${version}";
buildInputs = [ makeWrapper ];
phases = [ "installPhase" ]; phases = [ "installPhase" ];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
mkdir -p $out/share/zsh/site-functions mkdir -p $out/share/zsh/site-functions
ln -s ${server}/bin/blp-server $out/blp-server ln -s ${server}/blp-server $out/bin/blp-server
ln -s ${zsh} $out/share/zsh/site-functions/_bloop
cp ${client} $out/bloop ln -s ${zsh} $out/share/zsh/site-functions/_bloop
chmod +x $out/bloop ln -s ${client}/.bloop.aux $out/bin/bloop
makeWrapper $out/bloop $out/bin/bloop \
--prefix PATH : ${lib.makeBinPath [ python ]}
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {