···1+{
2+ lib,
3+ stdenvNoCC,
4+ fetchFromGitHub,
5+ gradle_8,
6+ jdk17,
7+ makeBinaryWrapper,
8+ nix-update-script,
9+}:
10+stdenvNoCC.mkDerivation (finalAttrs: {
11+ pname = "gpx-animator";
12+ version = "1.8.2";
13+14+ gradle = gradle_8.override { java = jdk17; };
15+16+ nativeBuildInputs = [
17+ finalAttrs.gradle
18+ makeBinaryWrapper
19+ ];
20+21+ src = fetchFromGitHub {
22+ owner = "gpx-animator";
23+ repo = "gpx-animator";
24+ tag = "v${finalAttrs.version}";
25+ hash = "sha256-U6nrS7utnUCohCzkOdmehtSdu+5d0KJF81mXWc/666A=";
26+ };
27+28+ mitmCache = finalAttrs.gradle.fetchDeps {
29+ inherit (finalAttrs) pname;
30+ data = ./deps.json;
31+ };
32+33+ # We only need `gradleBuildTask = "shadowJar"` instead of the slower default `gradleBuildTask
34+ # = "assemble"` (which also generates tarballs, etc) to generate the final .jar. However, the
35+ # shadowJar task doesn't have dependencies set up correctly so it won't create the
36+ # `version.txt` file and the resulting application will say "UNKNOWN_VERSION" in the titlebar
37+ # and everywhere else. As a side effect, we don't need doCheck = true either because the
38+ # assemble task also runs tests.
39+ __darwinAllowLocalNetworking = true;
40+41+ # Most other java packages use `jre_minimal` with extra modules rather than the full `jdk` as
42+ # the runtime dependency. But gpx-animator uses javax modules that cannot just be added
43+ # as modules in jre_minimal.
44+ installPhase = ''
45+ runHook preInstall
46+47+ install -Dm644 build/libs/gpx-animator-${finalAttrs.version}-all.jar -t $out/share/gpx-animator/
48+ makeWrapper ${jdk17}/bin/java $out/bin/gpx-animator \
49+ --add-flags "-jar $out/share/gpx-animator/gpx-animator-${finalAttrs.version}-all.jar"
50+51+ runHook postInstall
52+ '';
53+54+ passthru.updateScript = nix-update-script { };
55+56+ meta = {
57+ description = "GPX track to video animator";
58+ longDescription = ''
59+ GPX Animator generates video from GPX files, it supports:
60+61+ - Multiple GPX tracks with mutliple track segments
62+ - Skipping idle parts
63+ - Configurable color, label, width and time offset per track
64+ - Configurable video size, fps and speedup or total video time
65+ - Background map from any public TMS server
66+ '';
67+ homepage = "https://gpx-animator.app";
68+ changelog = "https://github.com/gpx-animator/gpx-animator/releases/tag/v${finalAttrs.version}";
69+ license = lib.licenses.asl20;
70+ maintainers = [ lib.maintainers.markasoftware ];
71+ mainProgram = "gpx-animator";
72+ platforms = lib.platforms.unix;
73+ };
74+})