Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / gpsprune / default.nix
blob8ea6091894e8ef4a2d91ca67d1b6669159c78f21
1 { fetchurl, lib, stdenv, makeDesktopItem, makeWrapper, unzip, jre, copyDesktopItems }:
3 stdenv.mkDerivation rec {
4   pname = "gpsprune";
5   version = "23.2";
7   src = fetchurl {
8     url = "https://activityworkshop.net/software/gpsprune/gpsprune_${version}.jar";
9     sha256 = "sha256-r2iw1vINWgqxoW0Zc8Sloa+wN/GUbUQfJ0e2BSP9vxM=";
10   };
12   dontUnpack = true;
14   nativeBuildInputs = [ makeWrapper copyDesktopItems ];
15   buildInputs = [ jre ];
17   desktopItems = [
18     (makeDesktopItem {
19       name = "gpsprune";
20       exec = "gpsprune %F";
21       icon = "gpsprune";
22       desktopName = "GpsPrune";
23       genericName = "GPS Data Editor";
24       comment = meta.description;
25       categories = [ "Education" "Geoscience" ];
26       mimeTypes = [
27         "application/gpx+xml"
28         "application/vnd.google-earth.kml+xml"
29         "application/vnd.google-earth.kmz"
30       ];
31     })
32   ];
34   installPhase = ''
35     runHook preInstall
37     install -Dm644 ${src} $out/share/java/gpsprune.jar
38     makeWrapper ${jre}/bin/java $out/bin/gpsprune \
39       --add-flags "-jar $out/share/java/gpsprune.jar"
40     mkdir -p $out/share/pixmaps
41     ${unzip}/bin/unzip -p $src tim/prune/gui/images/window_icon_64.png > $out/share/pixmaps/gpsprune.png
43     runHook postInstall
44   '';
46   meta = with lib; {
47     description = "Application for viewing, editing and converting GPS coordinate data";
48     homepage = "https://activityworkshop.net/software/gpsprune/";
49     sourceProvenance = with sourceTypes; [ binaryBytecode ];
50     license = licenses.gpl2Plus;
51     maintainers = with maintainers; [ rycee ];
52     platforms = platforms.all;
53   };