about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/jugglinglab/default.nix
blob: 9d552072f7dff35c21de0739a3adfc115c76eea7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib, stdenv, fetchFromGitHub, jre, makeWrapper, ant, jdk }:
stdenv.mkDerivation rec {
  version = "1.6.3";
  pname = "jugglinglab";
  src = fetchFromGitHub {
    owner = "jkboyce";
    repo = "jugglinglab";
    rev = "v${version}";
    sha256 = "sha256-Gq8V7gLl9IakQi7xaK8TCI/B2+6LlLjoLdcv9zlalIE=";
  };
  buildInputs = [ jre ];
  nativeBuildInputs = [ ant jdk makeWrapper ];
  buildPhase = "ant";

  installPhase = ''
    mkdir -p "$out/bin"
    mkdir -p "$out/lib"
    cp bin/*.jar $out/lib/

    # copied from the upstream shell wrapper
    classpath=$out/lib/JugglingLab.jar:$out/lib/commons-math3-3.6.1.jar:$out/lib/protobuf.jar:$out/lib/com.google.ortools.jar

    makeWrapper ${jre}/bin/java $out/bin/jugglinglab \
      --add-flags "-cp $classpath" \
      --add-flags "-Xss2048k -Djava.library.path=ortools-lib" \
      --add-flags jugglinglab.JugglingLab
  '';

  meta = with lib; {
      description = "A program to visualize different juggling pattens";
      homepage = "https://jugglinglab.org/";
      license = licenses.gpl2;
      maintainers = with maintainers; [ wnklmnn ];
      platforms = platforms.all;
      mainProgram = "jugglinglab";
  };
}