diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2022-10-14 22:26:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 22:26:09 +0200 |
commit | 53c73b2ef12d8f5138f1c1a8f4e2d2b97f420d8a (patch) | |
tree | 16c80e80d5e06150c63e04888a234f4428a5a0f0 /pkgs/applications | |
parent | 9f1d6c1c5d0961c99c67a475148e39f6dcf4fb9d (diff) | |
parent | b401f9f9588d5274383ffd6cefce1eb90bffcc6a (diff) |
Merge pull request #193698 from fee1-dead-contrib/pattypan/new
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/misc/pattypan/default.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/applications/misc/pattypan/default.nix b/pkgs/applications/misc/pattypan/default.nix new file mode 100644 index 0000000000000..19a9b18ce193f --- /dev/null +++ b/pkgs/applications/misc/pattypan/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, fetchFromGitHub +, unzip +, jre +, jdk +, ant +, makeWrapper +, makeDesktopItem +, copyDesktopItems +, glib +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "pattypan"; + version = "22.03"; + + src = fetchFromGitHub { + owner = "yarl"; + repo = "pattypan"; + rev = "v${version}"; + sha256 = "0qmvlcqhqw5k500v2xdakk340ymgv5amhbfqxib5s4db1w32pi60"; + }; + + nativeBuildInputs = [ copyDesktopItems jdk ant makeWrapper wrapGAppsHook ]; + buildInputs = [ glib jre ]; + + buildPhase = '' + runHook preBuild + export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" + ant + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/java + cp pattypan.jar $out/share/java/pattypan.jar + makeWrapper ${jre}/bin/java $out/bin/pattypan \ + --add-flags "-cp $out/share/java/pattypan.jar pattypan.Launcher" + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + desktopName = "Pattypan"; + genericName = "An uploader for Wikimedia Commons"; + categories = [ "Utility" ]; + exec = "pattypan"; + name = "pattypan"; + }) + ]; + + meta = with lib; { + homepage = "https://commons.wikimedia.org/wiki/Commons:Pattypan"; + description = "An uploader for Wikimedia Commons"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ fee1-dead ]; + }; +} |