Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ebf4126d8b13
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 27e030a1cc2a
Choose a head ref
  • 5 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 24, 2019

  1. bloop: 1.2.5 -> 1.3.2

    Tomahna committed Jul 24, 2019
    Copy the full SHA
    0f4da4a View commit details
  2. bloop: refactor derivation to use subderivations

    This change prevents accidentally using cached version of dependencies
    when updating the version
    Tomahna committed Jul 24, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    dtzWill Will Dietz
    Copy the full SHA
    3bdd3b1 View commit details
  3. Copy the full SHA
    d6b6015 View commit details

Commits on Jul 25, 2019

  1. Copy the full SHA
    17c2f79 View commit details

Commits on Aug 4, 2019

  1. Merge pull request #62812 from Tomahna/bloop

    bloop: 1.2.5 -> 1.3.2
    FRidh authored Aug 4, 2019
    Copy the full SHA
    27e030a View commit details
Showing with 65 additions and 33 deletions.
  1. +20 −3 nixos/modules/services/development/bloop.nix
  2. +45 −30 pkgs/development/tools/build-managers/bloop/default.nix
23 changes: 20 additions & 3 deletions nixos/modules/services/development/bloop.nix
Original file line number Diff line number Diff line change
@@ -9,6 +9,20 @@ let
in {

options.services.bloop = {
extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"-J-Xmx2G"
"-J-XX:MaxInlineLevel=20"
"-J-XX:+UseParallelGC"
];
description = ''
Specifies additional command line argument to pass to bloop
java process.
'';
};

install = mkOption {
type = types.bool;
default = false;
@@ -25,10 +39,13 @@ in {
systemd.user.services.bloop = {
description = "Bloop Scala build server";

environment = {
PATH = mkForce "${makeBinPath [ config.programs.java.package ]}";
};
serviceConfig = {
Type = "simple";
ExecStart = ''${pkgs.bloop}/bin/blp-server'';
Restart = "always";
Type = "simple";
ExecStart = ''${pkgs.bloop}/bin/bloop server'';
Restart = "always";
};
};

75 changes: 45 additions & 30 deletions pkgs/development/tools/build-managers/bloop/default.nix
Original file line number Diff line number Diff line change
@@ -1,56 +1,71 @@
{ stdenv, lib, fetchurl, coursier, jdk, jre, python, makeWrapper }:
{ stdenv, lib, fetchurl, coursier, python, makeWrapper }:

let
baseName = "bloop";
version = "1.2.5";
deps = stdenv.mkDerivation {
name = "${baseName}-deps-${version}";
version = "1.3.2";
nailgunCommit = "9327a60a"; # Fetched from https://github.com/scalacenter/bloop/releases/download/v${version}/install.py

client = stdenv.mkDerivation {
name = "${baseName}-client-${version}";

src = fetchurl {
url = "https://raw.githubusercontent.com/scalacenter/nailgun/${nailgunCommit}/pynailgun/ng.py";
sha256 = "0z4as5ibmzkd145wsch9caiy4037bgg780gcf7pyns0cv9n955b4";
};

phases = [ "installPhase" ];

installPhase = ''cp $src $out'';
};

server = stdenv.mkDerivation {
name = "${baseName}-server-${version}";
buildCommand = ''
mkdir -p $out/bin
export COURSIER_CACHE=$(pwd)
${coursier}/bin/coursier fetch ch.epfl.scala:bloop-frontend_2.12:${version} \
${coursier}/bin/coursier bootstrap ch.epfl.scala:bloop-frontend_2.12:${version} \
-r "bintray:scalameta/maven" \
-r "bintray:scalacenter/releases" \
-r "https://oss.sonatype.org/content/repositories/staging" > deps
mkdir -p $out/share/java
cp $(< deps) $out/share/java/
-r "https://oss.sonatype.org/content/repositories/staging" \
--deterministic \
-f --main bloop.Server -o $out/bin/blp-server
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "19373fyb0g7irrdzb1vsjmyv5xj84qwbcfb6lm076px7wfyn0w1c";
outputHash = "0k9zc9q793fkfwcssbkmzb0nxmgb99rwi0pjkqhvf719vmgvhc2a";
};
in
stdenv.mkDerivation rec {
name = "${baseName}-${version}";

# Fetched from https://github.com/scalacenter/bloop/releases/download/v${version}/install.py
nailgunCommit = "0c325237";
zsh = stdenv.mkDerivation {
name = "${baseName}-zshcompletion-${version}";

buildInputs = [ jdk makeWrapper deps ];
src = fetchurl {
url = "https://raw.githubusercontent.com/scalacenter/bloop/v${version}/etc/zsh/_bloop";
sha256 = "09qq5888vaqlqan2jbs2qajz2c3ff13zj8r0x2pcxsqmvlqr02hp";
};

phases = [ "installPhase" ];
phases = [ "installPhase" ];

client = fetchurl {
url = "https://raw.githubusercontent.com/scalacenter/nailgun/${nailgunCommit}/pynailgun/ng.py";
sha256 = "0qjw4nsyb4cxg96jj1yv5c0ivcxvmscxxqfzll5w9p1pjb30bq0n";
installPhase = ''cp $src $out'';
};
in
stdenv.mkDerivation rec {
name = "${baseName}-${version}";

zshCompletion = fetchurl {
url = "https://raw.githubusercontent.com/scalacenter/bloop/v${version}/etc/zsh/_bloop";
sha256 = "1id6f1fgy2rk0q5aad6ffivhbxa94fallzsc04l9n0y1s2xdhqpm";
};
buildInputs = [ makeWrapper ];

phases = [ "installPhase" ];

installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/zsh/site-functions
cp ${client} $out/bin/blp-client
cp ${zshCompletion} $out/share/zsh/site-functions/_bloop
chmod +x $out/bin/blp-client
ln -s ${server}/bin/blp-server $out/blp-server
ln -s ${zsh} $out/share/zsh/site-functions/_bloop
makeWrapper ${jre}/bin/java $out/bin/blp-server \
--prefix PATH : ${lib.makeBinPath [ jdk ]} \
--add-flags "-cp $CLASSPATH bloop.Server"
makeWrapper $out/bin/blp-client $out/bin/bloop \
cp ${client} $out/bloop
chmod +x $out/bloop
makeWrapper $out/bloop $out/bin/bloop \
--prefix PATH : ${lib.makeBinPath [ python ]}
'';