mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 17:23:08 +00:00
755b915a15
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/'
81 lines
1.8 KiB
Nix
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
|
|
];
|
|
};
|
|
})
|