From patchwork Sat Apr 19 05:43:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jussi Timperi X-Patchwork-Id: 41802 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4DD2227BC4A; Sat, 19 Apr 2025 06:46:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5563D27BC49 for ; Sat, 19 Apr 2025 06:46:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u6123-0001gq-IT; Sat, 19 Apr 2025 01:46:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u611i-0001bZ-EK for guix-patches@gnu.org; Sat, 19 Apr 2025 01:46:10 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u611f-0003kH-JD for guix-patches@gnu.org; Sat, 19 Apr 2025 01:46:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=0B6K/45NGe4cDHNrqq3Mv5T8iv7ZyH6lnqZWRwFAsy4=; b=pcAc65JgKcB/ZVlRxpIOcuyXWxlCNXKQ1VAg8MRFdSZghVnQsWlz1DadbTMgDGNGdJIVBOS+6OncZI+SwQ8VpPfVxENus/UyEesQzScsa4Jp8mJ3EDEeBm90XNp9tMjCstu3HWcdYyPzH67kcATGW179fRy22qesGSpZnHxnLwe//1V4WE3sA9Zf9sM6nwuGBArjIDgb3dnroX5uhk1ADl/v5JOC5erE+p6crdQlTf2emf/mvdVtm9gjaxq/wPTlK3MG2WmopfsqKjxQQQa2vTTHIM1Ggami4Wo2WEOyvA3RevgTBYwXF9ln8ShmfiGzSKZPXoGhyClH+/wMUN9s2Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u611f-0001oE-FR for guix-patches@gnu.org; Sat, 19 Apr 2025 01:46:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77915] [PATCH 2/2] gnu: Add cpdf. Resent-From: Jussi Timperi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Apr 2025 05:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77915 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77915@debbugs.gnu.org Cc: Jussi Timperi Received: via spool by 77915-submit@debbugs.gnu.org id=B77915.17450415126596 (code B ref 77915); Sat, 19 Apr 2025 05:46:03 +0000 Received: (at 77915) by debbugs.gnu.org; 19 Apr 2025 05:45:12 +0000 Received: from localhost ([127.0.0.1]:55758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u610p-0001iI-Bz for submit@debbugs.gnu.org; Sat, 19 Apr 2025 01:45:11 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:56620) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u610l-0001dU-DE for 77915@debbugs.gnu.org; Sat, 19 Apr 2025 01:45:09 -0400 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-30c461a45f8so21717501fa.1 for <77915@debbugs.gnu.org>; Fri, 18 Apr 2025 22:45:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745041500; x=1745646300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0B6K/45NGe4cDHNrqq3Mv5T8iv7ZyH6lnqZWRwFAsy4=; b=QLyO02MK7mOvzWGwGjppwA/nF1bxbRSG5JF1HHPcGt6oDfv+9l1Z6kT03DRWVX6zDR jHNOiAUf476gxkqW9Qq1Xbgf1UvGrssllJ3Nrq9f5eQJG4/2ML0jh14uStsfBbI43dda BZB3SxFoIVSEu8OQfbkc0IoXnFWD2bx6M/9j3yaTzk9obFtPg4yX/dLuzRVoCgIJpDz+ X5Mr7b413nLORMx1f7eq6Hx40HHkYK01fsm/1M91DhYNJ2sfR9WcAWTe4aRR2ujGpZ8t OqrfFR2JbJ+qV0Enwu0s1Y2LcKt5QQaFp8dKrfUNpjvmyQeOWdet72rqHgD6yTra4MfR 7YLA== X-Gm-Message-State: AOJu0YwyTTvZlo5brc/U06oZ6BbO9BWdI95aFlXXNE4HgVOXxaNM2Hss EY321vn7yoeIEKR2zBEfyiABdB4AGQ9vYPDF+BRljSuCFpJQhylGQ2T2o+xg X-Gm-Gg: ASbGnct3VJe7RZGLviQiiMVIGopB5P6doJN6Q7Na3QFysqKKKMteHVEUQXMRcsgN4E0 teKj9DxlReakO6J/HtuZJGgV6+6X2bbXGRhP2bB7rhF7OxLs8vFbi8MLgUfCAtIDqTUS87c26F/ VshpCoSA9J7XsVuFGZ03lSgDYVuVzTvvvodnyKQaZ4VOn2dS8M6CIkbHc0d/X4lTW6GxmWPJjTU SimuKUhCP/NVYLSxNO6zI01G/4csXaBqePH2X155cz3+8jMyPa30VTFbNKAnZGsvg3P1FMw5KGN i0awQdzExoYr0M43v5+mK8bbZoyVjbl1euQl4SXRSd4MN+hCCPExODd9rgAf50K+junWskLvXCF KJnS/O2IQhbJTIA== X-Google-Smtp-Source: AGHT+IH3Tasg94yKWEVYWQRgqGVf/niJgQXasMMSENNJiTHsxHhUZZgb8eUuB2iLUQUM2Y4kCFsNvA== X-Received: by 2002:a05:651c:322a:b0:30b:badf:75f0 with SMTP id 38308e7fff4ca-310904b99a3mr18476081fa.2.1745041500034; Fri, 18 Apr 2025 22:45:00 -0700 (PDT) Received: from localhost (n4vq5b60duktexf2i1j-1.v6.elisa-mobile.fi. [2001:999:484:d9ae:d04c:d1be:232d:7ad7]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-310907824c4sm4426351fa.25.2025.04.18.22.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 22:44:59 -0700 (PDT) From: Jussi Timperi Date: Sat, 19 Apr 2025 08:43:16 +0300 Message-ID: <7fc3c5bcce039138657b1544cb9a5accdb17c022.1745039829.git.jussi.timperi@iki.fi> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/pdf.scm (cpdf): New variable. Change-Id: I16fa4bf7251f5d38bdd14f472adeef513c34623c --- gnu/packages/pdf.scm | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 6340f9b3bf..6de03e6e03 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -29,6 +29,7 @@ ;;; Copyright © 2023 Benjamin Slade ;;; Copyright © 2024 Artyom V. Poptsov ;;; Copyright © 2024 Aaron Covrig +;;; Copyright © 2025 Jussi Timperi ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +57,7 @@ (define-module (gnu packages pdf) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system meson) + #:use-module (guix build-system ocaml) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system qt) @@ -95,6 +97,7 @@ (define-module (gnu packages pdf) #:use-module (gnu packages man) #:use-module (gnu packages markup) #:use-module (gnu packages nss) + #:use-module (gnu packages ocaml) #:use-module (gnu packages ocr) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) @@ -159,6 +162,88 @@ (define-public capypdf convert data in any way.") (license license:asl2.0))) +(define-public cpdf + (package + (name "cpdf") + (version "2.8.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/johnwhitington/cpdf-source") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0dn4lxbnj7izrpxshil1wcvpc60yv9mwfy52dndpi9b66rm3rbih")))) + (build-system ocaml-build-system) + (arguments + (list + #:tests? #f ;no tests + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'patch-makefile-shell + (lambda _ + (patch-makefile-SHELL "OCamlMakefile"))) + (add-after 'install 'install-bin + (lambda _ + (let ((bin (string-append #$output "/bin"))) + (install-file "cpdf" bin)))) + (add-after 'install-bin 'install-doc + (lambda _ + (let ((doc (string-append #$output "/share/doc/" + #$name "-" #$version)) + (man1 (string-append #$output "/share/man/man1"))) + (install-file "cpdf.1" man1) + (install-file "cpdfmanual.pdf" doc) + (copy-recursively "doc/cpdf/html" + (string-append doc "/html")))))))) + (propagated-inputs (list ocaml-camlpdf)) + (home-page "https://www.coherentpdf.com") + (synopsis "Command-line tool for PDF manipulation") + (description + "Command-line tool and OCaml library designed for manipulating PDF +documents. Key Features include: + +@itemize @bullet +@item +Splitting and merging PDF files (including bookmark preservation and +splitting on bookmarks). +@item +Encryption and decryption (supports AES 128 and AES 256). +@item +Page manipulation: scaling, rotation, cropping, and flipping; fitting +pages to a specific size. +@item +Bookmark management: copying, removing, and adding bookmarks. +@item +Watermarking: stamping logos, page numbers, and multi-line text with +transparency support. +@item +Text and font handling: embedding TrueType fonts, supporting Unicode +UTF-8 input and output, and converting text to PDF. +@item +Presentation features: creating PDF-based presentations and arranging +multiple pages on a single page. +@item +Annotation management: listing, copying, setting, and removing +annotations. +@item +Metadata management: reading and setting document information and +metadata. +@item +Attachment handling: adding and removing file attachments to documents +or pages. +@item +Advanced features: thickening hairlines, blackening text, +reconstructing malformed files, detecting missing fonts and +low-resolution images, exporting/importing in JSON format, and +building table of contents. +@item +Drawing: Adding graphics and text directly onto PDF files. +@end itemize") + (license license:agpl3+))) + (define-public a4pdf (deprecated-package "a4pdf" capypdf))