···11+{
22+ lib,
33+ stdenvNoCC,
44+ fetchFromGitHub,
55+ gradle_8,
66+ jdk17,
77+ makeBinaryWrapper,
88+ nix-update-script,
99+}:
1010+stdenvNoCC.mkDerivation (finalAttrs: {
1111+ pname = "gpx-animator";
1212+ version = "1.8.2";
1313+1414+ gradle = gradle_8.override { java = jdk17; };
1515+1616+ nativeBuildInputs = [
1717+ finalAttrs.gradle
1818+ makeBinaryWrapper
1919+ ];
2020+2121+ src = fetchFromGitHub {
2222+ owner = "gpx-animator";
2323+ repo = "gpx-animator";
2424+ tag = "v${finalAttrs.version}";
2525+ hash = "sha256-U6nrS7utnUCohCzkOdmehtSdu+5d0KJF81mXWc/666A=";
2626+ };
2727+2828+ mitmCache = finalAttrs.gradle.fetchDeps {
2929+ inherit (finalAttrs) pname;
3030+ data = ./deps.json;
3131+ };
3232+3333+ # We only need `gradleBuildTask = "shadowJar"` instead of the slower default `gradleBuildTask
3434+ # = "assemble"` (which also generates tarballs, etc) to generate the final .jar. However, the
3535+ # shadowJar task doesn't have dependencies set up correctly so it won't create the
3636+ # `version.txt` file and the resulting application will say "UNKNOWN_VERSION" in the titlebar
3737+ # and everywhere else. As a side effect, we don't need doCheck = true either because the
3838+ # assemble task also runs tests.
3939+ __darwinAllowLocalNetworking = true;
4040+4141+ # Most other java packages use `jre_minimal` with extra modules rather than the full `jdk` as
4242+ # the runtime dependency. But gpx-animator uses javax modules that cannot just be added
4343+ # as modules in jre_minimal.
4444+ installPhase = ''
4545+ runHook preInstall
4646+4747+ install -Dm644 build/libs/gpx-animator-${finalAttrs.version}-all.jar -t $out/share/gpx-animator/
4848+ makeWrapper ${jdk17}/bin/java $out/bin/gpx-animator \
4949+ --add-flags "-jar $out/share/gpx-animator/gpx-animator-${finalAttrs.version}-all.jar"
5050+5151+ runHook postInstall
5252+ '';
5353+5454+ passthru.updateScript = nix-update-script { };
5555+5656+ meta = {
5757+ description = "GPX track to video animator";
5858+ longDescription = ''
5959+ GPX Animator generates video from GPX files, it supports:
6060+6161+ - Multiple GPX tracks with mutliple track segments
6262+ - Skipping idle parts
6363+ - Configurable color, label, width and time offset per track
6464+ - Configurable video size, fps and speedup or total video time
6565+ - Background map from any public TMS server
6666+ '';
6767+ homepage = "https://gpx-animator.app";
6868+ changelog = "https://github.com/gpx-animator/gpx-animator/releases/tag/v${finalAttrs.version}";
6969+ license = lib.licenses.asl20;
7070+ maintainers = [ lib.maintainers.markasoftware ];
7171+ mainProgram = "gpx-animator";
7272+ platforms = lib.platforms.unix;
7373+ };
7474+})