nixpkgs/pkgs/applications/misc/pattypan/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

81 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, ant
, jdk
, makeWrapper
, wrapGAppsHook3
, makeDesktopItem
, copyDesktopItems
, stripJavaArchivesHook
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pattypan";
version = "22.03";
src = fetchFromGitHub {
owner = "yarl";
repo = "pattypan";
rev = "v${finalAttrs.version}";
hash = "sha256-wMQrBg+rEV1W7NgtWFXZr3pAxpyqdbEBKLNwDDGju2I=";
};
nativeBuildInputs = [
ant
jdk
makeWrapper
wrapGAppsHook3
copyDesktopItems
stripJavaArchivesHook
];
dontWrapGApps = true;
env.JAVA_TOOL_OPTIONS = "-Dfile.encoding=UTF8"; # needed for jdk versions below jdk19
buildPhase = ''
runHook preBuild
ant
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm644 pattypan.jar -t $out/share/pattypan
install -Dm644 src/pattypan/resources/logo.png $out/share/pixmaps/pattypan.png
runHook postInstall
'';
# gappsWrapperArgs is set in preFixup
postFixup = ''
makeWrapper ${jdk}/bin/java $out/bin/pattypan \
''${gappsWrapperArgs[@]} \
--add-flags "-jar $out/share/pattypan/pattypan.jar"
'';
desktopItems = [
(makeDesktopItem {
name = "pattypan";
exec = "pattypan";
icon = "pattypan";
desktopName = "Pattypan";
genericName = "An uploader for Wikimedia Commons";
categories = [ "Utility" ];
})
];
meta = with lib; {
description = "Uploader for Wikimedia Commons";
homepage = "https://commons.wikimedia.org/wiki/Commons:Pattypan";
license = licenses.mit;
mainProgram = "pattypan";
maintainers = with maintainers; [ fee1-dead ];
platforms = platforms.all;
sourceProvenance = with sourceTypes; [
fromSource
binaryBytecode # source bundles dependencies as jars
];
};
})