mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 17:07:46 +00:00
jugglinglab: 1.6.3 -> 1.6.5, move to buildMavenPackage
This commit is contained in:
parent
d7db3ee91f
commit
c53778e069
@ -1,37 +1,73 @@
|
||||
{ lib, stdenv, fetchFromGitHub, jre, makeWrapper, ant, jdk }:
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.6.3";
|
||||
{ lib
|
||||
, stdenv
|
||||
, maven
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, wrapGAppsHook
|
||||
, 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 {
|
||||
pname = "jugglinglab";
|
||||
version = "1.6.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jkboyce";
|
||||
repo = "jugglinglab";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-Gq8V7gLl9IakQi7xaK8TCI/B2+6LlLjoLdcv9zlalIE=";
|
||||
hash = "sha256-Y87uHFpVs4A/wErNO2ZF6Su0v4LEvaE9nIysrqFoY8w=";
|
||||
};
|
||||
buildInputs = [ jre ];
|
||||
nativeBuildInputs = [ ant jdk makeWrapper ];
|
||||
buildPhase = "ant";
|
||||
|
||||
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
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
mkdir -p "$out/lib"
|
||||
cp bin/*.jar $out/lib/
|
||||
runHook preInstall
|
||||
|
||||
# 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
|
||||
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
|
||||
'';
|
||||
|
||||
# gappsWrapperArgs are set in preFixup
|
||||
postFixup = ''
|
||||
makeWrapper ${jre}/bin/java $out/bin/jugglinglab \
|
||||
--add-flags "-cp $classpath" \
|
||||
--add-flags "-Xss2048k -Djava.library.path=ortools-lib" \
|
||||
--add-flags jugglinglab.JugglingLab
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
--add-flags "-Xss2048k -Djava.library.path=$out/lib/ortools-lib" \
|
||||
--add-flags "-jar $out/share/jugglinglab/JugglingLab.jar"
|
||||
'';
|
||||
|
||||
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";
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 93fd6be..5f929c3 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -42,6 +43,65 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-enforcer-plugin</artifactId>
|
||||
+ <version>3.4.1</version>
|
||||
+ <executions>
|
||||
+ <execution>
|
||||
+ <id>require-all-plugin-versions-to-be-set</id>
|
||||
+ <phase>validate</phase>
|
||||
+ <goals>
|
||||
+ <goal>enforce</goal>
|
||||
+ </goals>
|
||||
+ <configuration>
|
||||
+ <rules>
|
||||
+ <requirePluginVersions />
|
||||
+ </rules>
|
||||
+ </configuration>
|
||||
+ </execution>
|
||||
+ </executions>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-compiler-plugin</artifactId>
|
||||
+ <version>3.12.1</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-surefire-plugin</artifactId>
|
||||
+ <version>3.2.3</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-jar-plugin</artifactId>
|
||||
+ <version>3.3.0</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-clean-plugin</artifactId>
|
||||
+ <version>3.3.2</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-install-plugin</artifactId>
|
||||
+ <version>3.1.1</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-site-plugin</artifactId>
|
||||
+ <version>4.0.0-M13</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-resources-plugin</artifactId>
|
||||
+ <version>3.3.1</version>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId>
|
||||
+ <artifactId>maven-deploy-plugin</artifactId>
|
||||
+ <version>3.1.1</version>
|
||||
+ </plugin>
|
||||
|
||||
<!-- remove existing `bin/JugglingLab.jar` -->
|
||||
<!-- otherwise on overwrite Maven creates `bin/original-JugglingLab.jar` -->
|
Loading…
Reference in New Issue
Block a user