btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / gp / gpsprune / package.nix
blobe33f340a1bd5878139fd59480fe5665bc2078301
1 { fetchurl, lib, stdenv, makeDesktopItem, makeWrapper, unzip, jre, copyDesktopItems }:
3 stdenv.mkDerivation rec {
4   pname = "gpsprune";
5   version = "24.5";
7   src = fetchurl {
8     url = "https://activityworkshop.net/software/gpsprune/gpsprune_${version}.jar";
9     hash = "sha256-qQtMSQbhIgYLJbCip6ioWeVphO1DEYudmXKUer04L4Y=";
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     changelog = "https://activityworkshop.net/software/gpsprune/whats_new.html";
50     sourceProvenance = with sourceTypes; [ binaryBytecode ];
51     license = licenses.gpl2Plus;
52     maintainers = with maintainers; [ rycee ];
53     platforms = platforms.all;
54     mainProgram = "gpsprune";
55   };