Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 54 lines 1.5 kB view raw
1{ lib, stdenv, makeDesktopItem, fetchurl, jdk21, wrapGAppsHook3, glib }: 2 3stdenv.mkDerivation rec { 4 pname = "pdfsam-basic"; 5 version = "5.2.3"; 6 7 src = fetchurl { 8 url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb"; 9 hash = "sha256-ai1UHMeLvCba6WV6f6dGc53CxPP7bJaPgo8Tm7ddkOM="; 10 }; 11 12 unpackPhase = '' 13 ar vx ${src} 14 tar xvf data.tar.gz 15 ''; 16 17 nativeBuildInputs = [ wrapGAppsHook3 ]; 18 buildInputs = [ glib ]; 19 20 preFixup = '' 21 gappsWrapperArgs+=(--set JAVA_HOME "${jdk21}" --set PDFSAM_JAVA_PATH "${jdk21}") 22 ''; 23 24 installPhase = '' 25 cp -R opt/pdfsam-basic/ $out/ 26 mkdir -p "$out"/share/icons 27 cp --recursive ${desktopItem}/share/applications $out/share 28 cp $out/icon.svg "$out"/share/icons/pdfsam-basic.svg 29 ''; 30 31 desktopItem = makeDesktopItem { 32 name = pname; 33 exec = pname; 34 icon = pname; 35 comment = meta.description; 36 desktopName = "PDFsam Basic"; 37 genericName = "PDF Split and Merge"; 38 mimeTypes = [ "application/pdf" ]; 39 categories = [ "Office" ]; 40 }; 41 42 meta = with lib; { 43 homepage = "https://github.com/torakiki/pdfsam"; 44 description = "Multi-platform software designed to extract pages, split, merge, mix and rotate PDF files"; 45 mainProgram = "pdfsam-basic"; 46 sourceProvenance = with sourceTypes; [ 47 binaryBytecode 48 binaryNativeCode 49 ]; 50 license = licenses.agpl3Plus; 51 platforms = platforms.linux; 52 maintainers = with maintainers; [ _1000101 ]; 53 }; 54}