2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, maven
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2024-01-13 08:15:51 +00:00
|
|
|
, jre
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
platformName = {
|
|
|
|
"x86_64-linux" = "linux-x86-64";
|
|
|
|
"aarch64-linux" = "linux-aarch64";
|
|
|
|
"x86_64-darwin" = "darwin-x86-64";
|
|
|
|
"aarch64-darwin" = "darwin-aarch64";
|
|
|
|
}.${stdenv.system} or null;
|
|
|
|
in
|
|
|
|
maven.buildMavenPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "jugglinglab";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.6.5";
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jkboyce";
|
|
|
|
repo = "jugglinglab";
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = "v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-Y87uHFpVs4A/wErNO2ZF6Su0v4LEvaE9nIysrqFoY8w=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# make sure mvnHash doesn't change when maven is updated
|
|
|
|
./fix-default-maven-plugin-versions.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
mvnHash = "sha256-1Uzo9nRw+YR/sd7CC9MTPe/lttkRX6BtmcsHaagP1Do=";
|
|
|
|
|
|
|
|
# fix jar timestamps for reproducibility
|
|
|
|
mvnParameters = "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2024-01-13 08:15:51 +00:00
|
|
|
runHook preInstall
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
install -Dm644 bin/JugglingLab.jar -t $out/share/jugglinglab
|
|
|
|
${lib.optionalString (platformName != null) ''
|
|
|
|
install -Dm755 bin/ortools-lib/ortools-${platformName}/* -t $out/lib/ortools-lib
|
|
|
|
''}
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
# gappsWrapperArgs are set in preFixup
|
|
|
|
postFixup = ''
|
2020-05-29 06:06:01 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/jugglinglab \
|
2024-01-13 08:15:51 +00:00
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--add-flags "-Xss2048k -Djava.library.path=$out/lib/ortools-lib" \
|
|
|
|
--add-flags "-jar $out/share/jugglinglab/JugglingLab.jar"
|
2020-05-29 06:06:01 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
description = "A program to visualize different juggling pattens";
|
|
|
|
homepage = "https://jugglinglab.org/";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
mainProgram = "jugglinglab";
|
|
|
|
maintainers = with maintainers; [ wnklmnn tomasajt ];
|
|
|
|
platforms = platforms.all;
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
2020-11-09 15:59:12 +00:00
|
|
|
}
|