From 7267839e761cca2160233422b86296511591f32c Mon Sep 17 00:00:00 2001 From: Alexandra <74795488+alyaeanyx@users.noreply.github.com> Date: Sun, 23 Jan 2022 04:04:10 +0100 Subject: [PATCH] gprojector: init at 3.0.2 (#154932) --- .../science/astronomy/gprojector/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/applications/science/astronomy/gprojector/default.nix diff --git a/pkgs/applications/science/astronomy/gprojector/default.nix b/pkgs/applications/science/astronomy/gprojector/default.nix new file mode 100644 index 000000000000..3864058828f4 --- /dev/null +++ b/pkgs/applications/science/astronomy/gprojector/default.nix @@ -0,0 +1,51 @@ +{ stdenvNoCC +, lib +, fetchzip +, jre +, makeDesktopItem +, copyDesktopItems +, makeWrapper +, extraJavaArgs ? "-Xms512M -Xmx2000M" +}: + +stdenvNoCC.mkDerivation rec { + pname = "gprojector"; + version = "3.0.2"; + + src = fetchzip { + url = "https://www.giss.nasa.gov/tools/gprojector/download/G.ProjectorJ-${version}.tgz"; + sha256 = "sha256-IvGZOYt2d8aWtlAJJzVrwkqOOhaUHUmEDlMeD/0NdwU="; + }; + + desktopItems = [ (makeDesktopItem { + name = "gprojector"; + exec = "gprojector"; + desktopName = "G.Projector"; + comment = meta.description; + categories = "Science;"; + extraEntries = "StartupWMClass = gov-nasa-giss-projector-GProjector"; + }) ]; + + buildInputs = [ jre ]; + nativeBuildInputs = [ makeWrapper copyDesktopItems ]; + + dontConfigure = true; + dontBuild = true; + dontFixup = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share + cp -r $src/jars $out/share/java + makeWrapper ${jre}/bin/java $out/bin/gprojector --add-flags "-jar $out/share/java/G.Projector.jar" --add-flags "${extraJavaArgs}" + runHook postInstall + ''; + + meta = { + description = "G.Projector transforms an input map image into any of about 200 global and regional map projections"; + homepage = "https://www.giss.nasa.gov/tools/gprojector/"; + maintainers = with lib.maintainers; [ alyaeanyx ]; + license = lib.licenses.unfree; + inherit (jre.meta) platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21412f030e8b..de36a00efb27 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6042,6 +6042,8 @@ with pkgs; hamlib = hamlib_4; }; + gprojector = callPackage ../applications/science/astronomy/gprojector { }; + gptfdisk = callPackage ../tools/system/gptfdisk { }; grafx2 = callPackage ../applications/graphics/grafx2 {};