nixpkgs/pkgs/applications/misc/pdfsam-basic/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.4 KiB
Nix
Raw Normal View History

2023-02-06 19:53:26 +01:00
{ lib, stdenv, makeDesktopItem, fetchurl, jdk19, wrapGAppsHook, glib }:
2019-09-19 16:24:50 +02:00
stdenv.mkDerivation rec {
pname = "pdfsam-basic";
2023-02-16 05:51:50 +01:00
version = "5.0.3";
2019-09-19 16:24:50 +02:00
src = fetchurl {
url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb";
2023-02-16 05:51:50 +01:00
hash = "sha256-NST5d5dzO26ifKStbgD7qNbumUMQhfUFNE472LR1z5k=";
2019-09-19 16:24:50 +02:00
};
unpackPhase = ''
ar vx ${src}
tar xvf data.tar.gz
'';
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs = [ glib ];
preFixup = ''
2023-02-06 19:53:26 +01:00
gappsWrapperArgs+=(--set JAVA_HOME "${jdk19}" --set PDFSAM_JAVA_PATH "${jdk19}")
2019-09-19 16:24:50 +02:00
'';
installPhase = ''
cp -R opt/pdfsam-basic/ $out/
mkdir -p "$out"/share/icons
cp --recursive ${desktopItem}/share/applications $out/share
cp $out/icon.svg "$out"/share/icons/pdfsam-basic.svg
'';
desktopItem = makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
comment = meta.description;
desktopName = "PDFsam Basic";
genericName = "PDF Split and Merge";
mimeTypes = [ "application/pdf" ];
categories = [ "Office" ];
2019-09-19 16:24:50 +02:00
};
meta = with lib; {
2023-02-06 19:53:26 +01:00
homepage = "https://github.com/torakiki/pdfsam";
description = "Multi-platform software designed to extract pages, split, merge, mix and rotate PDF files";
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode
];
license = licenses.agpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ _1000101 ];
2019-09-19 16:24:50 +02:00
};
}