2024-05-15 15:35:15 +00:00
|
|
|
{ lib, stdenv, makeDesktopItem, fetchurl, jdk21, wrapGAppsHook3, glib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pdfsam-basic";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "5.2.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-ai1UHMeLvCba6WV6f6dGc53CxPP7bJaPgo8Tm7ddkOM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar vx ${src}
|
|
|
|
tar xvf data.tar.gz
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ glib ];
|
|
|
|
|
|
|
|
preFixup = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
gappsWrapperArgs+=(--set JAVA_HOME "${jdk21}" --set PDFSAM_JAVA_PATH "${jdk21}")
|
2020-04-24 23:36:52 +00: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";
|
2022-03-05 16:20:37 +00:00
|
|
|
mimeTypes = [ "application/pdf" ];
|
|
|
|
categories = [ "Office" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-02-09 11:40:11 +00:00
|
|
|
homepage = "https://github.com/torakiki/pdfsam";
|
|
|
|
description = "Multi-platform software designed to extract pages, split, merge, mix and rotate PDF files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pdfsam-basic";
|
2023-02-09 11:40:11 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ _1000101 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
}
|