From patchwork Wed Jun 26 19:26:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65672 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 C5C8327BBEA; Wed, 26 Jun 2024 20:28:02 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 27EED27BBE2 for ; Wed, 26 Jun 2024 20:28:02 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJE-0003MN-Ql; Wed, 26 Jun 2024 15:28:00 -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 1sMYJD-0003ME-Jl for guix-patches@gnu.org; Wed, 26 Jun 2024 15:27:59 -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 1sMYJD-0007cw-BR for guix-patches@gnu.org; Wed, 26 Jun 2024 15:27:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJF-0007DX-P9 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 01/12] gnu: Add lcms2mt. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943006127581 (code B ref 71787); Wed, 26 Jun 2024 19:28:01 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:41 +0000 Received: from localhost ([127.0.0.1]:40310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYIu-0007An-RF for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:41 -0400 Received: from mout01.posteo.de ([185.67.36.65]:50635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYIs-0007AX-Uc for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:39 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 587DD240028 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430049; bh=mxBt0Juw3v99VkahyKJ/F8qT/zCL/dy7Dyq2mVoQujY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=bxwAHYulCYgLIIABg7XrnIxIicuWmwf9DfCaNDgI35B8I8g7hLmld7cLFgsCaPdCh uUdfCXXzySHcHEhsE11E7QyCMvGEzkm8OZh2lp5rmrhq+pKJQepYmFp8o2M1vKhSaU iXqD6uRDTSPBpQbWpKW07f3MKPRZ/1/0ykrwvHtLKNH5A5l4za0BerOkOHcSXdVqsh qSrSw1R6ORSdrRezxPUAUhOacj0qG1QAa2TisB75ZFCjsNbRM7tetIiI9ZXg7RNKj2 r0hMMvNQDk5lP/avynHwemsOfbBH9F6SiZXoplm9ZB/XusP7mKcsktWwVuWMTqinC+ iLy+jBlDoW21A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8WtS58rTz9rxQ; Wed, 26 Jun 2024 21:27:28 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:54 +0000 Message-ID: <20240626192717.12818-1-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/ghostscript.scm (lcms2mt): New variable. --- gnu/packages/ghostscript.scm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 502b41bb99..5f0e2cf3c4 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -10,7 +10,8 @@ ;;; Copyright © 2018, 2020, 2022 Marius Bakke ;;; Copyright © 2019 Mathieu Othacehe ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen -;;; +;;; Copyright © 2024 David Elsing +;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it @@ -43,6 +44,7 @@ (define-module (gnu packages ghostscript) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) + #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1)) @@ -73,6 +75,25 @@ (define-public lcms (home-page "https://www.littlecms.com/") (properties '((cpe-name . "little_cms_color_engine"))))) +;; Fork of LCMS 2 for Ghostscript and MuPDF +(define-public lcms2mt + (package + (inherit lcms) + (name "lcms2mt") + (version "2.16") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "git://git.ghostscript.com/thirdparty-lcms2") + (commit (string-append "lcms" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0dxpq59r1w3r1391fngpvka51r16505zmr32zjs2azjlrz49k3x4")))) + (synopsis "Little CMS, a small-footprint colour management engine +(GhostScript fork)") + (home-page "https://www.ghostscript.com/"))) + (define-public libpaper (package (name "libpaper") From patchwork Wed Jun 26 19:26:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65675 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 781BA27BBEC; Wed, 26 Jun 2024 20:28:35 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 04DBF27BBEA for ; Wed, 26 Jun 2024 20:28:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJX-0003SF-BN; Wed, 26 Jun 2024 15:28:19 -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 1sMYJM-0003P1-VC for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -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 1sMYJD-0007d5-Qm for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJG-0007De-5L for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 02/12] gnu: Add memento. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943006427604 (code B ref 71787); Wed, 26 Jun 2024 19:28:02 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:44 +0000 Received: from localhost ([127.0.0.1]:40316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYIy-0007BA-96 for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:44 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYIw-0007Ac-HO for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:43 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6EC11240101 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430053; bh=iFfAUouB/d+Yx2PNjBB/aKktmD4hGzRAix+jTaoSKLY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Xw4PEhXNkY7TY+elAw1dEPmEJua0UGUILkY+Rt7JFsCpIIjO8V1VqHIeK5M1zVZKY L1ufR7uXk5IqLbLKFLqAlSkAuhwn7Z5/0upD8wFxjwqOonL9tG1giB5FwnVcK2IUiU 64bEJa/kTb8nxZ8nUI9/zBVfNlK0PKeoKP8EP1UEPtkr8QiMeiF7gyf+WXoo+jhi42 IQ4sbbi5nKiDtSSj+XRkyEwlg76I201L0Mkgpt0+zB9BGEiiiFWPgWK0BASael9pY0 7uak/AbfYWtaBR6+iXHlXgks0JzL2JrqO3vcZTxfehLd4PWI6zq0PhPiai6x2EZYtd eJxzyZC6bgX4Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8WtX2D9Xz9rxK; Wed, 26 Jun 2024 21:27:32 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:55 +0000 Message-ID: <20240626192717.12818-2-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/c.scm (memento): New variable. --- gnu/packages/c.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index d13b62b5e2..27be60aa98 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -1678,3 +1678,44 @@ (define-public pcg-c Linear Congruential Generator (LCG) with a permutation function to increase output randomness while retaining speed, simplicity, and conciseness.") (license (list license:expat license:asl2.0))))) ; dual licensed + +(define-public memento + (let ((commit "46f8beaad330b9b9e1dc1678cf41f78c1b902d11") + (revision "0")) + (package + (name "memento") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ArtifexSoftware/memento") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1gmvbybm9s07g3n7k0zswv88s4bkk7yd66ydaljqwvf6w7d9dzg4")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + ;; There are no build system files + (delete 'configure) + (replace 'build + (lambda _ + (invoke #$(cc-for-target) "memento.c" "-O2" "-g" "-shared" + "-o" "libmemento.so"))) + (replace 'install + (lambda _ + (install-file "libmemento.so" (string-append #$output "/lib")) + (install-file "memento.h" (string-append #$output "/include")) + (install-file "docs/README.md" + (string-append #$output "/share/doc/" + #$name "-" #$version))))) + #:tests? #f)) + (home-page "https://github.com/ArtifexSoftware/memento") + (synopsis "Memory debugging library for C and C++ programs") + (description "Memento is a debugging library, which intercepts calls to +malloc, free, realloc etc. to detect memory leaks and errors.") + (license license:isc)))) From patchwork Wed Jun 26 19:26:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65681 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 A6E0B27BBEA; Wed, 26 Jun 2024 20:28:50 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 A98C327BBE2 for ; Wed, 26 Jun 2024 20:28:48 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJb-0003Ur-37; Wed, 26 Jun 2024 15:28:23 -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 1sMYJM-0003Ox-UB for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -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 1sMYJE-0007dH-3F for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJG-0007Dl-H2 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 03/12] gnu: Add extract. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943006827619 (code B ref 71787); Wed, 26 Jun 2024 19:28:02 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:48 +0000 Received: from localhost ([127.0.0.1]:40318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ1-0007BO-K9 for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:48 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYIx-0007Ae-5H for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 59CE3240101 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430054; bh=2mAeAOfRblneaCL+Fg9oeeSiWKGqqFgvxD1Ks7xox7k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=JPdau1b5LeuTcrDcWZQWY1xWEkCSmWPR3QzC1UDC/yZ6ElbBEWo9GfipV5D+pIZaV oVPBNEsNzonCbhijp7aIioblaXlK3+g6MYwlDXPxVnFboOUjr+NPVDe2PlqtyBTNVj abs+yXH2vbRuROrmZubJcE5mYS/1SKVIj+1ccyhPoXqfp19RYBZXbP6rbXH/dbAuUj nPt2IEq6TQ0AiCUEBa3QvvYYJWb2Bwc/42izxXHZC/N1N7TufDfZJFe3h+Enr6QzSu gU+cDsE0fCM1eXI5s4PuL+riL5mSatdDioOSuPw/r3kUGQNN3utV4JeBBSGKbybNqQ HhKz7AUZrzMzw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8WtY4Qdtz9rxG; Wed, 26 Jun 2024 21:27:33 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:56 +0000 Message-ID: <20240626192717.12818-3-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/ghostscript.scm (extract): New variable. * gnu/packages/patches/extract-shared-library.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/ghostscript.scm | 47 +++++++++++++++ .../patches/extract-shared-library.patch | 59 +++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 gnu/packages/patches/extract-shared-library.patch diff --git a/gnu/local.mk b/gnu/local.mk index 282cf30f7f..2fc14e68fe 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1178,6 +1178,7 @@ dist_patch_DATA = \ %D%/packages/patches/eudev-rules-directory.patch \ %D%/packages/patches/exercism-disable-self-update.patch \ %D%/packages/patches/extempore-unbundle-external-dependencies.patch \ + %D%/packages/patches/extract-shared-library.patch \ %D%/packages/patches/extundelete-e2fsprogs-1.44.patch \ %D%/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch \ %D%/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch \ diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 5f0e2cf3c4..2e24904fd4 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -30,6 +30,7 @@ (define-module (gnu packages ghostscript) #:use-module (gnu packages) #:use-module (gnu packages autotools) + #:use-module (gnu packages c) #:use-module (gnu packages compression) #:use-module (gnu packages cups) #:use-module (gnu packages fontutils) @@ -94,6 +95,52 @@ (define-public lcms2mt (GhostScript fork)") (home-page "https://www.ghostscript.com/"))) +(define-public extract + (package + (name "extract") + (version "10.03.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "git://git.ghostscript.com/extract.git") + (commit (string-append "ghostpdl-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17mb96xpsbr26q2l3kahmi3f1mcqzn7n1q1783f40155lrkk88q9")) + (snippet + '(for-each + delete-file + '("src/docx_template.c" "src/docx_template.h" + "src/odt_template.c" "src/odt_template.h" + "src/memento.h" "src/memento.c"))) + (patches (search-patches "extract-shared-library.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:test-target "test" + #:make-flags + `(list + "build=debug-opt" + "flags_compile=-MMD -MP -Iinclude -Isrc -fPIC" + (string-append "CC=" ,(cc-for-target)) + (string-append "CXX=" ,(cxx-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ; no configure script + (replace 'install + (lambda _ + (install-file "libextract.so" (string-append #$output "/lib")) + (copy-recursively + "include" (string-append #$output "/include"))))))) + (inputs (list memento zlib)) + (native-inputs (list python unzip)) + (home-page "https://git.ghostscript.com/?p=extract.git") + (synopsis "Document content extraction library") + (description "extract is a library for exstracting dox, odt, html and text +files from documents.") + (license license:agpl3+))) + (define-public libpaper (package (name "libpaper") diff --git a/gnu/packages/patches/extract-shared-library.patch b/gnu/packages/patches/extract-shared-library.patch new file mode 100644 index 0000000000..b2ab37dcc6 --- /dev/null +++ b/gnu/packages/patches/extract-shared-library.patch @@ -0,0 +1,59 @@ +Adjust the Makefile to build a shared library. + +diff --git a/Makefile b/Makefile +index e8933ea..5cf503c 100644 +--- a/Makefile ++++ b/Makefile +@@ -130,6 +130,7 @@ endif + $(warning gs=$(gs)) + endif + ++build: libextract.so $(exe_dep) $(exe_buffer_test_dep) $(exe_misc_test_dep) $(exe_ziptest_dep) + + # Default target - run all tests. + # +@@ -294,7 +295,7 @@ test/generated/%.pdf.mutool.text.diff: test/generated/%.pdf.mutool.text test/%.p + # Main executable. + # + exe = src/build/extract-$(build).exe +-exe_src = \ ++lib_src = \ + src/alloc.c \ + src/astring.c \ + src/boxer.c \ +@@ -302,10 +303,10 @@ exe_src = \ + src/document.c \ + src/docx.c \ + src/docx_template.c \ +- src/extract-exe.c \ + src/extract.c \ + src/html.c \ + src/join.c \ ++ src/json.c \ + src/mem.c \ + src/odt.c \ + src/odt_template.c \ +@@ -318,16 +319,18 @@ exe_src = \ + + + ifeq ($(build),memento) +- exe_src += src/memento.c ++ lib_src += src/memento.c + ifeq ($(uname),Linux) + flags_compile += -D HAVE_LIBDL + flags_link += -L $(libbacktrace) -l backtrace -l dl + endif + endif +-exe_obj := $(exe_src) +-exe_obj := $(patsubst src/%.c, src/build/%.c-$(build).o, $(exe_obj)) +-exe_obj := $(patsubst src/%.cpp, src/build/%.cpp-$(build).o, $(exe_obj)) +-exe_dep = $(exe_obj:.o=.d) ++lib_obj := $(lib_src) ++lib_obj := $(patsubst src/%.c, src/build/%.c-$(build).o, $(lib_obj)) ++lib_obj := $(patsubst src/%.cpp, src/build/%.cpp-$(build).o, $(lib_obj)) ++lib_dep = $(lib_obj:.o=.d) ++libextract.so: $(lib_obj) ++ $(CXX) $(flags_link) $^ -lz -lm -shared -o $@ + exe: $(exe) + $(exe): $(exe_obj) + $(CXX) $(flags_link) -o $@ $^ -lz -lm From patchwork Wed Jun 26 19:26:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65676 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 1675927BBEA; Wed, 26 Jun 2024 20:28:36 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 930A327BBE2 for ; Wed, 26 Jun 2024 20:28:34 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJX-0003SI-JB; Wed, 26 Jun 2024 15:28:19 -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 1sMYJN-0003P8-1o for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28: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 1sMYJE-0007dI-Fn for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJG-0007Du-TL for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 04/12] gnu: ijs: Remove unneeded files and build shared library. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007127647 (code B ref 71787); Wed, 26 Jun 2024 19:28:02 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:51 +0000 Received: from localhost ([127.0.0.1]:40326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ4-0007Bj-64 for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:50 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ1-0007Av-P6 for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:48 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B04F3240103 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430059; bh=7Acxom93hzIe3JvxuWwrEL5+Jqg8nxmLRuHk8vLLgZs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=pLyonmcqGCWthzRmJvCv6eOlDBeIMsaw1AlGF/j4qZJocydH+C+0sTLz4to18saLs SFg8bUEj5Mk+XUYrHEqWAJwzD+rVqIVhQ5wfxK2yENdOaGM1RJMkx2bhKbl6xZMg+i lGpqUiZFEKL4YgqrOsiyB9JWVB/3PQ15iZiozpe0yIWK0iZt7DkAEJdgyfjmkN7qSS T7Y0jVNH78yp9Si5l2XDXOY/mScXKKQm8p2KLZNpx7nAddfAV4/PUBQiJvBwgSEWHW kZrsQbJEm3vMvmkMFldWz4ZV0Go8PsrqngnLPFzEg6Gqil1iN83ZIqwLMlldkU1dUx R/EB3MqJrTJ9w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtf32jjz9rxL; Wed, 26 Jun 2024 21:27:38 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:57 +0000 Message-ID: <20240626192717.12818-4-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/ghostscript.scm (ijs)[source]: Add snippet. Remove patches. [phases] Rename 'autogen' phase to 'prepare' and adjust. --- gnu/packages/ghostscript.scm | 106 +++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 2e24904fd4..40891676b3 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -368,50 +368,72 @@ (define-public ghostscript/cups (define-public ijs (package - (name "ijs") - (version (package-version ghostscript)) - (source (package-source ghostscript)) - (build-system gnu-build-system) - (native-inputs - (append (if (target-riscv64?) - (list config) - '()) - (list libtool automake autoconf))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'autogen - (lambda _ - ;; need to regenerate macros - (system* "autoreconf" "-if") - ;; do not run configure - (substitute* "autogen.sh" - (("^.*\\$srcdir/configure.*") "")) - (system* "bash" "autogen.sh") - ;; create configure script in ./ijs/ - (chdir "ijs") - ;; do not run configure - (substitute* "autogen.sh" - (("^.*\\$srcdir/configure.*") "") - (("^ + && echo Now type.*$") "")) - (invoke "bash" "autogen.sh"))) - ,@(if (target-riscv64?) - `((add-after 'unpack 'update-config-scripts - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (file) - (install-file - (search-input-file - (or native-inputs inputs) - (string-append "/bin/" file)) "ijs")) - '("config.guess" "config.sub"))))) - '())))) - (synopsis "IJS driver framework for inkjet and other raster devices") - (description - "IJS is a protocol for transmission of raster page images. This package + (name "ijs") + (version (package-version ghostscript)) + (source + (origin + (inherit + (package-source ghostscript)) + (modules '((guix build utils) + (srfi srfi-1) + (ice-9 ftw))) + (snippet + '(begin + (for-each delete-file-recursively + (lset-difference equal? (scandir ".") + '("." ".." "ijs"))) + (chdir "ijs") + (for-each + delete-file + '("compile" + "config.guess" + "config.sub" + "configure" + "ijs_spec.pdf" + "ijs_spec.ps" + "install-sh" + "libtool" + "ltmain.sh" + "Makefile.in" + "missing" + "state.eps" + "state.fig")))) + (patches '()))) + (build-system gnu-build-system) + (native-inputs + (append (if (target-riscv64?) + (list config) + '()) + (list libtool automake autoconf))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'prepare + (lambda _ + (chdir "ijs") + ;; do not run configure + (substitute* "autogen.sh" + (("^.*\\$srcdir/configure.*") "") + (("^ + && echo Now type.*$") "")) + (substitute* "configure.ac" + (("AC_DISABLE_SHARED") "")))) + ,@(if (target-riscv64?) + `((add-after 'unpack 'update-config-scripts + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (file) + (install-file + (search-input-file + (or native-inputs inputs) + (string-append "/bin/" file)) "ijs")) + '("config.guess" "config.sub"))))) + '())))) + (synopsis "IJS driver framework for inkjet and other raster devices") + (description + "IJS is a protocol for transmission of raster page images. This package provides the reference implementation of the raster printer driver architecture.") - (license license:expat) - (home-page (package-home-page ghostscript)))) + (license license:expat) + (home-page (package-home-page ghostscript)))) (define-public font-ghostscript (package From patchwork Wed Jun 26 19:26:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65673 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 0F2F827BBEA; Wed, 26 Jun 2024 20:28:27 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 5BC7427BBE2 for ; Wed, 26 Jun 2024 20:28:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJY-0003T7-IW; Wed, 26 Jun 2024 15:28:20 -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 1sMYJN-0003P5-1X for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28: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 1sMYJF-0007dr-B7 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJH-0007E8-ML for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 05/12] gnu: ghostscript: Unbundle dependencies and remove non-free parts. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007827698 (code B ref 71787); Wed, 26 Jun 2024 19:28:03 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:58 +0000 Received: from localhost ([127.0.0.1]:40342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJA-0007CZ-8T for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ2-0007Ax-4r for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DF4F9240027 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430059; bh=7t+2REqqKph+YlguPVeVlVpNtOhEZJgFwcve+5dSxTA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=MksQIekF5wiIghrSldtTzB6lT1T4dNyIiAYTg36KFdN4w3NQFTahesEjtaU7SLZqL EtYl7Rw4xBdwTW1hg2Nrkzs32w9wjy8UKx7oQVg48e9kql7GL+myD5fNdCv84KTy4l 80qFgVQ6+pqpoqtdgdXbdeJxfvtyrJ29t7FmZKrJB9sDr+7r/Vp77J6Z8TT5N+R8Gp YgAm+fyK1NoeQthFy+Bo7BT/oWSWtWu/nXD/gGADpju3vVUitew4qPDfj5iUNhgTZl ISSEGhuagWyl/bocBAYp79MmkfinXJFEmTJMhtliOLvg/xcQGIUbkf9MSTAst/l+Rx bG/76t97cX6Kw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtg31smz9rxL; Wed, 26 Jun 2024 21:27:39 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:58 +0000 Message-ID: <20240626192717.12818-5-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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 The fonts in pcl/urwfonts and the jpegxr library are non-free. Autogenerated files are removed as well. Due to a circular dependency with python-sphinx, the documentation is not built. * gnu/packages/ghostscript.scm (ghostscript)[source]: Use git-fetch. Adjust snippet. Replace patches. [outputs]: Delete field. [arguments]: Add "--without-xps". Remove "--enable-dynamic". <#:phases>: Add 'unbundle' and 'generate-scfdtab' phases. [native-inputs]: Add autoconf and automake. [inputs]: Add extract, ijs, lcms2mt, memento and openjpeg. [license]: Add missing licenses. (ghostscript/fixed): Delete variable. * gnu/packages/patches/ghostscript-CVE-2023-36664.patch: Delete file. * gnu/packages/patches/ghostscript-CVE-2023-36664-fixup.patch: Delete file. * gnu/packages/patches/ghostscript-leptonica-hurd.patch: Delete file. * gnu/packages/patches/ghostscript-no-header-creationdate.patch: Delete file. * gnu/packages/patches/ghostscript-no-header-id.patch: Delete file. * gnu/packages/patches/ghostscript-no-header-uuid.patch: Delete file. * gnu/packages/patches/ghostscript-reproducibility.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. --- gnu/local.mk | 7 +- gnu/packages/ghostscript.scm | 142 +++++++++++++----- .../ghostscript-CVE-2023-36664-fixup.patch | 56 ------- .../patches/ghostscript-CVE-2023-36664.patch | 142 ------------------ .../patches/ghostscript-leptonica-hurd.patch | 78 ---------- .../ghostscript-no-header-creationdate.patch | 46 ------ .../patches/ghostscript-no-header-id.patch | 57 ------- .../patches/ghostscript-no-header-uuid.patch | 49 ------ .../patches/ghostscript-reproducibility.patch | 26 ++++ 9 files changed, 129 insertions(+), 474 deletions(-) delete mode 100644 gnu/packages/patches/ghostscript-CVE-2023-36664-fixup.patch delete mode 100644 gnu/packages/patches/ghostscript-CVE-2023-36664.patch delete mode 100644 gnu/packages/patches/ghostscript-leptonica-hurd.patch delete mode 100644 gnu/packages/patches/ghostscript-no-header-creationdate.patch delete mode 100644 gnu/packages/patches/ghostscript-no-header-id.patch delete mode 100644 gnu/packages/patches/ghostscript-no-header-uuid.patch create mode 100644 gnu/packages/patches/ghostscript-reproducibility.patch diff --git a/gnu/local.mk b/gnu/local.mk index 2fc14e68fe..c44c21ffa0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1338,12 +1338,7 @@ dist_patch_DATA = \ %D%/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch \ %D%/packages/patches/ghc-memory-fix-32bit.patch \ %D%/packages/patches/ghc-persistent-fix-32bit.patch \ - %D%/packages/patches/ghostscript-CVE-2023-36664.patch \ - %D%/packages/patches/ghostscript-CVE-2023-36664-fixup.patch \ - %D%/packages/patches/ghostscript-leptonica-hurd.patch \ - %D%/packages/patches/ghostscript-no-header-id.patch \ - %D%/packages/patches/ghostscript-no-header-uuid.patch \ - %D%/packages/patches/ghostscript-no-header-creationdate.patch \ + %D%/packages/patches/ghostscript-reproducibility.patch \ %D%/packages/patches/git-filter-repo-generate-doc.patch \ %D%/packages/patches/gklib-suitesparse.patch \ %D%/packages/patches/glib-appinfo-watch.patch \ diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 40891676b3..2bc168db68 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -215,43 +215,61 @@ (define-public psutils (define-public ghostscript (package (name "ghostscript") - (version "9.56.1") - (replacement ghostscript/fixed) + (version "10.03.1") (source (origin - (method url-fetch) - (uri (string-append "https://github.com/ArtifexSoftware/" - "ghostpdl-downloads/releases/download/gs" - (string-delete #\. version) - "/ghostscript-" version ".tar.xz")) + (method git-fetch) + (uri (git-reference + (url "git://git.ghostscript.com/ghostpdl.git") + (commit (string-append "ghostpdl-" version)))) + (file-name (git-file-name name version)) (sha256 (base32 - "1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l")) - (patches (search-patches "ghostscript-no-header-creationdate.patch" - "ghostscript-no-header-id.patch" - "ghostscript-no-header-uuid.patch")) + "1rzgk12vmv3062l8w7vw5kdsgfphmpwbq38alv2qgiz5wpalsrds")) + (patches (search-patches "ghostscript-reproducibility.patch")) (modules '((guix build utils))) (snippet - ;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so - ;; we leave it, at least for now. - ;; TODO Try unbundling ijs, which is developed alongside Ghostscript. - ;; Likewise for the thread-safe lcms2 fork called "lcms2art". '(begin - (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg" - "libpng" "tiff" "zlib")))))) + (for-each + delete-file-recursively + (append + (list + ;; Bundled software (some non-free) + "cups" "expat" "freetype" "ijs" "jbig2dec" "jpeg" "jpegxr" + "lcms2mt" "libpng" "openjpeg" "pcl" "tiff" "xps" "zlib" + ;; Non-free ICC profile + "doc/language-bindings/images" + ;; Contain autogenerated files + "demos/csharp/windows" + "toolbin/Acrobat2Tiff" + "base/scfdtab.c" + "demos/java/jni/gs_jni/com_artifex_gsjava_util_NativePointer.h" + "demos/java/jni/gs_jni/com_artifex_gsjava_GSAPI.h" + "doc/GS9_Color_Management.pdf" + "doc/Ghostscript.pdf" + "doc/pclxps/ghostpdl.pdf") + (find-files "doc/src/_static" "cm-fig.*\\.png"))) + (for-each + (lambda (name) + (delete-file (string-append "arch/" name))) + '("osx-x86-x86_64-ppc-gcc.h" + "windows-arm-msvc.h" + "windows-x64-msvc.h" + "windows-x86-msvc.h")) + (delete-file "base/memento.c") + (delete-file "base/memento.h"))))) (build-system gnu-build-system) - (outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples (arguments (list - #:disallowed-references '("doc") #:configure-flags #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") "--with-system-libtiff" + ;; Requires jpegxr, which has a nonfree license. + "--without-xps" "LIBS=-lz" (string-append "ZLIBDIR=" (dirname (search-input-file %build-inputs "include/zlib.h"))) - "--enable-dynamic" "--disable-compile-inits" (string-append "--with-fontpath=" (search-input-directory @@ -270,16 +288,19 @@ (define-public ghostscript '())) #:phases #~(modify-phases %standard-phases - #$@(if (target-hurd?) - #~((add-after 'unpack 'patch-leptonica - (lambda _ - (let ((patch-file - #$(local-file - (search-patch - "ghostscript-leptonica-hurd.patch")))) - (with-directory-excursion "leptonica" - (invoke "patch" "--force" "-p1" "-i" patch-file)))))) - #~()) + (add-after 'unpack 'unbundle + (lambda _ + (substitute* '("base/lib.mak" "base/tiff.mak" + "devices/dcontrib.mak" "devices/devs.mak" + "psi/int.mak") + ((".*:\\$\\(GLSRC\\)memento\\.h".*) "")) + (substitute* "base/lib.mak" + ((" \\$\\(GLOBJ\\)memento\\.\\$\\(OBJ\\)") "")))) + (add-before 'bootstrap 'patch-autogen + (lambda _ + (substitute* "autogen.sh" + (("^autoreconf.*" orig) + (string-append orig "\nexit\n"))))) (add-before 'configure 'create-output-directory (lambda _ ;; The configure script refuses to function if the directory @@ -287,7 +308,6 @@ (define-public ghostscript (mkdir-p (string-append #$output "/lib")))) (add-after 'configure 'remove-doc-reference (lambda _ - ;; Don't retain a reference to the 'doc' output in 'gs'. ;; The only use of this definition is in the output of ;; 'gs --help', so this change is fine. (substitute* "base/gscdef.c" @@ -305,6 +325,25 @@ (define-public ghostscript (("^AUXEXTRALIBS=(.*)$" _ value) (string-append "AUXEXTRALIBS = -lz " value "\n")))))) '()) + (add-before 'build 'generate-scfdtab + (lambda _ + (invoke "make" "obj/arch.h") + ;; These changes are necessary for cross builds, where there can + ;; be a conflict for int64_t. + (with-directory-excursion "base" + (copy-file "scommon.h" "tmpfile") + (substitute* "scommon.h" + ((".*#include \"stdint_\\.h\".*") "")) + (let ((include-path (getenv "C_INCLUDE_PATH"))) + ;; For cross builds + (setenv "C_INCLUDE_PATH" + (string-append #$(this-package-input "memento") + "/include")) + (invoke "gcc" "-Dfopen=fopen" "-I../obj" + "scfdgen.c" "scfetab.c" "-o" "scfdgen") + (setenv "C_INCLUDE_PATH" include-path)) + (rename-file "tmpfile" "scommon.h") + (invoke "./scfdgen")))) (replace 'build (lambda _ ;; Build 'libgs.so', but don't build the statically-linked 'gs' @@ -320,7 +359,9 @@ (define-public ghostscript (symlink "gsc" (string-append #$output "/bin/gs"))))))) (native-inputs (append - (list perl + (list autoconf + automake + perl pkg-config ;needed for freetype python-minimal-wrapper tcl) @@ -330,14 +371,19 @@ (define-public ghostscript (list zlib libjpeg-turbo) '()))) (inputs - (list fontconfig + (list extract + fontconfig freetype font-ghostscript + ijs jbig2dec + lcms2mt libjpeg-turbo libpaper libpng libtiff + memento + openjpeg zlib)) (synopsis "PostScript and PDF interpreter") (description @@ -346,13 +392,29 @@ (define-public ghostscript capabilities of the PostScript language. It supports a wide variety of output file formats and printers.") (home-page "https://www.ghostscript.com/") - (license license:agpl3+))) - -(define ghostscript/fixed - (package-with-patches - ghostscript - (search-patches "ghostscript-CVE-2023-36664.patch" - "ghostscript-CVE-2023-36664-fixup.patch"))) + (license + (list + ;; Most of the code is distributed under the AGPLv3+. + license:agpl3+ + ;; Some files (or parts of files) are distributed under other, + ;; compatible licenses. + (license:non-copyleft "file://devices/gdev4693.c") + (license:non-copyleft "file://devices/gdevifno.c") + (license:non-copyleft "file://base/icc34.h") + (license:non-copyleft "file://base/CMap/78-EUC-H") + license:asl2.0 + license:bsd-3 + license:expat + license:freetype + license:gpl1+ + license:gpl2+ + license:isc + license:lgpl2.1 + license:public-domain + license:zlib + ;; Additional exception for the font files in Resource/Font for + ;; inclusion in Postscript and PDF files. + (license:non-copyleft "file://LICENSE"))))) (define-public ghostscript/x (package/inherit ghostscript diff --git a/gnu/packages/patches/ghostscript-CVE-2023-36664-fixup.patch b/gnu/packages/patches/ghostscript-CVE-2023-36664-fixup.patch deleted file mode 100644 index c2a222701f..0000000000 --- a/gnu/packages/patches/ghostscript-CVE-2023-36664-fixup.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0974e4f2ac0005d3731e0b5c13ebc7e965540f4d Mon Sep 17 00:00:00 2001 -From: Chris Liddell -Date: Wed, 14 Jun 2023 09:08:12 +0100 -Subject: [PATCH] Bug 706778: 706761 revisit - -Two problems with the original commit. The first a silly typo inverting the -logic of a test. - -The second was forgetting that we actually actually validate two candidate -strings for pipe devices. One with the expected "%pipe%" prefix, the other -using the pipe character prefix: "|". - -This addresses both those. ---- - base/gpmisc.c | 2 +- - base/gslibctx.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/base/gpmisc.c b/base/gpmisc.c -index 58511270e..2b0064bea 100644 ---- a/base/gpmisc.c -+++ b/base/gpmisc.c -@@ -1081,7 +1081,7 @@ gp_validate_path_len(const gs_memory_t *mem, - /* "%pipe%" do not follow the normal rules for path definitions, so we - don't "reduce" them to avoid unexpected results - */ -- if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ if (path[0] == '|' || (len > 5 && memcmp(path, "%pipe", 5) == 0)) { - bufferfull = buffer = (char *)gs_alloc_bytes(mem->thread_safe_memory, len + 1, "gp_validate_path"); - if (buffer == NULL) - return gs_error_VMerror; -diff --git a/base/gslibctx.c b/base/gslibctx.c -index d2a1aa91d..42af99090 100644 ---- a/base/gslibctx.c -+++ b/base/gslibctx.c -@@ -743,7 +743,7 @@ gs_add_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, co - /* "%pipe%" do not follow the normal rules for path definitions, so we - don't "reduce" them to avoid unexpected results - */ -- if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ if (path[0] == '|' || (len > 5 && memcmp(path, "%pipe", 5) == 0)) { - buffer = (char *)gs_alloc_bytes(core->memory, len + 1, "gs_add_control_path_len"); - if (buffer == NULL) - return gs_error_VMerror; -@@ -850,7 +850,7 @@ gs_remove_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, - /* "%pipe%" do not follow the normal rules for path definitions, so we - don't "reduce" them to avoid unexpected results - */ -- if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ if (path[0] == '|' || (len > 5 && memcmp(path, "%pipe", 5) == 0)) { - buffer = (char *)gs_alloc_bytes(core->memory, len + 1, "gs_remove_control_path_len"); - if (buffer == NULL) - return gs_error_VMerror; --- -2.34.1 - diff --git a/gnu/packages/patches/ghostscript-CVE-2023-36664.patch b/gnu/packages/patches/ghostscript-CVE-2023-36664.patch deleted file mode 100644 index e9c53c1f87..0000000000 --- a/gnu/packages/patches/ghostscript-CVE-2023-36664.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 505eab7782b429017eb434b2b95120855f2b0e3c Mon Sep 17 00:00:00 2001 -From: Chris Liddell -Date: Wed, 7 Jun 2023 10:23:06 +0100 -Subject: [PATCH] Bug 706761: Don't "reduce" %pipe% file names for permission - validation - -For regular file names, we try to simplfy relative paths before we use them. - -Because the %pipe% device can, effectively, accept command line calls, we -shouldn't be simplifying that string, because the command line syntax can end -up confusing the path simplifying code. That can result in permitting a pipe -command which does not match what was originally permitted. - -Special case "%pipe" in the validation code so we always deal with the entire -string. ---- - base/gpmisc.c | 31 +++++++++++++++++++-------- - base/gslibctx.c | 56 ++++++++++++++++++++++++++++++++++++------------- - 2 files changed, 64 insertions(+), 23 deletions(-) - -diff --git a/base/gpmisc.c b/base/gpmisc.c -index 5f39ebba7..2fb87f769 100644 ---- a/base/gpmisc.c -+++ b/base/gpmisc.c -@@ -1076,16 +1076,29 @@ gp_validate_path_len(const gs_memory_t *mem, - && !memcmp(path + cdirstrl, dirsepstr, dirsepstrl)) { - prefix_len = 0; - } -- rlen = len+1; -- bufferfull = (char *)gs_alloc_bytes(mem->thread_safe_memory, rlen + prefix_len, "gp_validate_path"); -- if (bufferfull == NULL) -- return gs_error_VMerror; -- -- buffer = bufferfull + prefix_len; -- if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -- return gs_error_invalidfileaccess; -- buffer[rlen] = 0; - -+ /* "%pipe%" do not follow the normal rules for path definitions, so we -+ don't "reduce" them to avoid unexpected results -+ */ -+ if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ bufferfull = buffer = (char *)gs_alloc_bytes(mem->thread_safe_memory, len + 1, "gp_validate_path"); -+ if (buffer == NULL) -+ return gs_error_VMerror; -+ memcpy(buffer, path, len); -+ buffer[len] = 0; -+ rlen = len; -+ } -+ else { -+ rlen = len+1; -+ bufferfull = (char *)gs_alloc_bytes(mem->thread_safe_memory, rlen + prefix_len, "gp_validate_path"); -+ if (bufferfull == NULL) -+ return gs_error_VMerror; -+ -+ buffer = bufferfull + prefix_len; -+ if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -+ return gs_error_invalidfileaccess; -+ buffer[rlen] = 0; -+ } - while (1) { - switch (mode[0]) - { -diff --git a/base/gslibctx.c b/base/gslibctx.c -index eb566ed06..d2a1aa91d 100644 ---- a/base/gslibctx.c -+++ b/base/gslibctx.c -@@ -740,14 +740,28 @@ gs_add_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, co - return gs_error_rangecheck; - } - -- rlen = len+1; -- buffer = (char *)gs_alloc_bytes(core->memory, rlen, "gp_validate_path"); -- if (buffer == NULL) -- return gs_error_VMerror; -+ /* "%pipe%" do not follow the normal rules for path definitions, so we -+ don't "reduce" them to avoid unexpected results -+ */ -+ if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ buffer = (char *)gs_alloc_bytes(core->memory, len + 1, "gs_add_control_path_len"); -+ if (buffer == NULL) -+ return gs_error_VMerror; -+ memcpy(buffer, path, len); -+ buffer[len] = 0; -+ rlen = len; -+ } -+ else { -+ rlen = len + 1; - -- if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -- return gs_error_invalidfileaccess; -- buffer[rlen] = 0; -+ buffer = (char *)gs_alloc_bytes(core->memory, rlen, "gs_add_control_path_len"); -+ if (buffer == NULL) -+ return gs_error_VMerror; -+ -+ if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -+ return gs_error_invalidfileaccess; -+ buffer[rlen] = 0; -+ } - - n = control->num; - for (i = 0; i < n; i++) -@@ -833,14 +847,28 @@ gs_remove_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, - return gs_error_rangecheck; - } - -- rlen = len+1; -- buffer = (char *)gs_alloc_bytes(core->memory, rlen, "gp_validate_path"); -- if (buffer == NULL) -- return gs_error_VMerror; -+ /* "%pipe%" do not follow the normal rules for path definitions, so we -+ don't "reduce" them to avoid unexpected results -+ */ -+ if (len > 5 && memcmp(path, "%pipe", 5) != 0) { -+ buffer = (char *)gs_alloc_bytes(core->memory, len + 1, "gs_remove_control_path_len"); -+ if (buffer == NULL) -+ return gs_error_VMerror; -+ memcpy(buffer, path, len); -+ buffer[len] = 0; -+ rlen = len; -+ } -+ else { -+ rlen = len+1; - -- if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -- return gs_error_invalidfileaccess; -- buffer[rlen] = 0; -+ buffer = (char *)gs_alloc_bytes(core->memory, rlen, "gs_remove_control_path_len"); -+ if (buffer == NULL) -+ return gs_error_VMerror; -+ -+ if (gp_file_name_reduce(path, (uint)len, buffer, &rlen) != gp_combine_success) -+ return gs_error_invalidfileaccess; -+ buffer[rlen] = 0; -+ } - - n = control->num; - for (i = 0; i < n; i++) { --- -2.34.1 - diff --git a/gnu/packages/patches/ghostscript-leptonica-hurd.patch b/gnu/packages/patches/ghostscript-leptonica-hurd.patch deleted file mode 100644 index 124365b3e6..0000000000 --- a/gnu/packages/patches/ghostscript-leptonica-hurd.patch +++ /dev/null @@ -1,78 +0,0 @@ -Upstream status: This patch was taken from leptonica upstream. - -Backported to ghostscripts bundled leptonica. - -From f04da7c816feb1d5f689c34f3d0e7e3621edf1f5 Mon Sep 17 00:00:00 2001 -From: Samuel Thibault -Date: Wed, 1 Feb 2023 19:35:43 +0100 -Subject: [PATCH] Fix GNU/Hurd build - -There is no PATH_MAX limitation on GNU/Hurd, and realpath() can be -safely be used with its second parameter set to NULL (as required by -posix since its version 2001). ---- - src/sarray1.c | 29 +++++++++++++++++++++++------ - 1 file changed, 23 insertions(+), 6 deletions(-) - ---- a/src/sarray1.c 2023-06-13 12:31:13.393672916 +0200 -+++ a/src/sarray1.c 2023-06-13 12:34:13.574237149 +0200 -@@ -1953,7 +1953,11 @@ - SARRAY * - getFilenamesInDirectory(const char *dirname) - { -+#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) -+char *dir; -+#else - char dir[PATH_MAX + 1]; -+#endif - char *realdir, *stat_path, *ignore; - size_t size; - SARRAY *safiles; -@@ -1976,17 +1980,28 @@ - * If the file or directory exists, realpath returns its path; - else it returns NULL. - * If the second arg to realpath is passed in, the canonical path -- is returned there. Use a buffer of sufficient size. If the -- second arg is NULL, the path is malloc'd and returned if the -- file or directory exists. -- We pass in a buffer for the second arg, and check that the canonical -- directory path was made. The existence of the directory is checked -- later, after its actual path is returned by genPathname(). */ -+ is returned there. Use a buffer of sufficient size. -+ We pass in a buffer for the second arg, and check that the -+ canonical directory path was made. The existence of the -+ directory is checked later, after its actual path is returned by -+ genPathname(). -+ With GNU libc or Posix 2001, if the second arg is NULL, the path -+ is malloc'd and returned if the file or directory exists. -+ */ -+#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) -+ dir = realpath(dirname, NULL); -+ if (dir == NULL) -+ return (SARRAY *)ERROR_PTR("dir not made", __func__, NULL); -+#else - dir[0] = '\0'; /* init empty in case realpath() fails to write it */ - ignore = realpath(dirname, dir); - if (dir[0] == '\0') - return (SARRAY *)ERROR_PTR("dir not made", procName, NULL); -+#endif - realdir = genPathname(dir, NULL); -+#if _POSIX_VERSION >= 200112 || defined(__GLIBC__) -+ LEPT_FREE(dir); -+#endif - if ((pdir = opendir(realdir)) == NULL) { - LEPT_FREE(realdir); - return (SARRAY *)ERROR_PTR("pdir not opened", procName, NULL); -@@ -1998,10 +2013,12 @@ - stat_ret = fstatat(dfd, pdirentry->d_name, &st, 0); - #else - size = strlen(realdir) + strlen(pdirentry->d_name) + 2; -+#if _POSIX_VERSION < 200112 && !defined(__GLIBC__) - if (size > PATH_MAX) { - L_ERROR("size = %zu too large; skipping\n", procName, size); - continue; - } -+#endif - stat_path = (char *)LEPT_CALLOC(size, 1); - snprintf(stat_path, size, "%s/%s", realdir, pdirentry->d_name); - stat_ret = stat(stat_path, &st); diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch deleted file mode 100644 index 493693b78d..0000000000 --- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch +++ /dev/null @@ -1,46 +0,0 @@ -This patch makes emission of /CreationDate and /ModDate headers optional. - -If the environment variable GS_GENERATE_UUIDS is set to "0" or "no", it will -not write out the "/ID" field (if that's permissible). - -Upstream does not want to do this. - -See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c -index cb268f62e..c5abefde2 100644 ---- a/devices/vector/gdevpdf.c -+++ b/devices/vector/gdevpdf.c -@@ -425,6 +425,9 @@ pdf_initialize_ids(gx_device_pdf * pdev) - * date and time, rather than (for example) %%CreationDate from the - * PostScript file. We think this is wrong, but we do the same. - */ -+ if (!getenv("GS_GENERATE_UUIDS") || -+ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && -+ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) - { - struct tm tms; - time_t t; -diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c -index ec011d8ba..f083f1e93 100644 ---- a/devices/vector/gdevpdfe.c -+++ b/devices/vector/gdevpdfe.c -@@ -696,6 +696,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) - pdf_xml_attribute_name(s, "xmlns:xmp"); - pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/"); - pdf_xml_tag_end(s); -+ if (!getenv("GS_GENERATE_UUIDS") || -+ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && -+ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) - { - pdf_xml_tag_open_beg(s, "xmp:ModifyDate"); - pdf_xml_tag_end(s); -@@ -704,6 +707,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) - pdf_xml_tag_close(s, "xmp:ModifyDate"); - pdf_xml_newline(s); - } -+ if (!getenv("GS_GENERATE_UUIDS") || -+ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && -+ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) - { - pdf_xml_tag_open_beg(s, "xmp:CreateDate"); - pdf_xml_tag_end(s); diff --git a/gnu/packages/patches/ghostscript-no-header-id.patch b/gnu/packages/patches/ghostscript-no-header-id.patch deleted file mode 100644 index ef518b0fb2..0000000000 --- a/gnu/packages/patches/ghostscript-no-header-id.patch +++ /dev/null @@ -1,57 +0,0 @@ -This patch makes the "/ID" field optional. - -If the environment variable GS_GENERATE_UUIDS is set to "0" or "no", it will -not write out the "/ID" field (if that's permissible). - -Upstream does not want to do this. - -See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c -index c5abefde2..3859fc088 100644 ---- a/devices/vector/gdevpdf.c -+++ b/devices/vector/gdevpdf.c -@@ -1909,8 +1909,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params - * +1 for the linearisation dict and +1 for the primary hint stream. - */ - linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file); -- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<>\nstartxref\r\n0\n%%%%EOF\n \n", -- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0); -+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber); -+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */ -+ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID); -+ gs_snprintf(LDict, sizeof(LDict), "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0); - gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file); - - /* Write document catalog (Part 4) */ -@@ -2445,8 +2448,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params - if (code != 0) - return_error(gs_error_ioerror); - -- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<>\nstartxref\r\n0\n%%%%EOF\n", -- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref); -+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber); -+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */ -+ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID); -+ gs_snprintf(LDict, sizeof(LDict), "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref); - gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile); - - code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET); -@@ -3139,10 +3145,12 @@ pdf_close(gx_device * dev) - stream_puts(s, "trailer\n"); - pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n", - pdev->next_id, Catalog_id, Info_id); -- stream_puts(s, "/ID ["); -- psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0); -- psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0); -- stream_puts(s, "]\n"); -+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) { /* ID is mandatory when encrypting */ -+ stream_puts(s, "/ID ["); -+ psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0); -+ psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0); -+ stream_puts(s, "]\n"); -+ } - if (pdev->OwnerPassword.size > 0) { - pprintld1(s, "/Encrypt %ld 0 R ", Encrypt_id); - } diff --git a/gnu/packages/patches/ghostscript-no-header-uuid.patch b/gnu/packages/patches/ghostscript-no-header-uuid.patch deleted file mode 100644 index b277a4bc2e..0000000000 --- a/gnu/packages/patches/ghostscript-no-header-uuid.patch +++ /dev/null @@ -1,49 +0,0 @@ -This patch makes the UUIDs in the XMP header optional, depending on the -setting of the environment variable GS_GENERATE_UUIDS. - -If the environment variable GS_GENERATE_UUIDS is set to "0" or "no", it will -not write out the Document UUID field and also will write the Instance ID -field value as "". - -Upstream does not want to do this. - -See: https://bugs.ghostscript.com/show_bug.cgi?id=698208 -diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c -index f083f1e93..a19c64ac0 100644 ---- a/devices/vector/gdevpdfe.c -+++ b/devices/vector/gdevpdfe.c -@@ -624,7 +624,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) - return code; - - /* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */ -- if (pdev->PDFA != 0) -+ if (pdev->PDFA != 0 || (getenv("GS_GENERATE_UUIDS") && (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") == 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") == 0))) - instance_uuid[0] = 0x00; - - cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time)); -@@ -730,14 +730,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6]) - pdf_xml_tag_close(s, "rdf:Description"); - pdf_xml_newline(s); - -- pdf_xml_tag_open_beg(s, "rdf:Description"); -- pdf_xml_copy(s, " rdf:about=\"\""); -- pdf_xml_attribute_name(s, "xmlns:xapMM"); -- pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/"); -- pdf_xml_attribute_name(s, "xapMM:DocumentID"); -- pdf_xml_attribute_value(s, document_uuid); -- pdf_xml_tag_end_empty(s); -- pdf_xml_newline(s); -+ if (!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) -+ { -+ pdf_xml_tag_open_beg(s, "rdf:Description"); -+ pdf_xml_copy(s, " rdf:about=\"\""); -+ pdf_xml_attribute_name(s, "xmlns:xapMM"); -+ pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/"); -+ pdf_xml_attribute_name(s, "xapMM:DocumentID"); -+ pdf_xml_attribute_value(s, document_uuid); -+ pdf_xml_tag_end_empty(s); -+ pdf_xml_newline(s); -+ } - - pdf_xml_tag_open_beg(s, "rdf:Description"); - pdf_xml_copy(s, " rdf:about=\"\""); diff --git a/gnu/packages/patches/ghostscript-reproducibility.patch b/gnu/packages/patches/ghostscript-reproducibility.patch new file mode 100644 index 0000000000..9afb052a09 --- /dev/null +++ b/gnu/packages/patches/ghostscript-reproducibility.patch @@ -0,0 +1,26 @@ +Set the OmitDateInfo, OmitXMP and OmitID controls to 1 if the environment +variable GS_GENERATE_UUIDS is set to "0" or "no". + +For reference, see: +https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=1158b25fe28f9d60c65417712f16a0f9cccac95c +and https://bugs.ghostscript.com/show_bug.cgi?id=698208 + +diff --git a/devices/vector/gdevpdfp.c b/devices/vector/gdevpdfp.c +index 1fdfeae..6c79157 100644 +--- a/devices/vector/gdevpdfp.c ++++ b/devices/vector/gdevpdfp.c +@@ -669,6 +669,14 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par + param_signal_error(plist, param_name, code); + } + ++ if (getenv("GS_GENERATE_UUIDS") && ++ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") == 0 || ++ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") == 0)) { ++ pdev->OmitInfoDate = 1; ++ pdev->OmitID = 1; ++ pdev->OmitXMP = 1; ++ } ++ + if (pdev->OmitInfoDate && pdev->PDFX != 0) { + emprintf(pdev->memory, "\nIt is not possible to omit the CreationDate when creating PDF/X\nOmitInfoDate is being ignored.\n"); + pdev->OmitInfoDate = 0; From patchwork Wed Jun 26 19:26:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65683 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 2AD0727BBE9; Wed, 26 Jun 2024 20:29:12 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 99FBC27BBE2 for ; Wed, 26 Jun 2024 20:29:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJd-0003VT-6Z; Wed, 26 Jun 2024 15:28:25 -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 1sMYJN-0003P4-1k for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28: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 1sMYJE-0007dJ-SW for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJH-0007E1-9S for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 06/12] gnu: Add ghostscript/tesseract. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007627690 (code B ref 71787); Wed, 26 Jun 2024 19:28:03 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:56 +0000 Received: from localhost ([127.0.0.1]:40340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ9-0007CW-V6 for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:56 -0400 Received: from mout01.posteo.de ([185.67.36.65]:45305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ3-0007B4-0S for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:49 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E8F01240028 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430060; bh=JZBLSdylE91c0jOfSrfWXNSPsaG+PO70Rtuc1hu/FqA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=AVtDYBiWaXriAdyBYQjDlpgaNRNHkMxWrm7vdedVVnN1ILJvPi0YeD1mo7RXOXqMy Xig2Ruv36kdUmdAUoBlNXTZYBQR2lDl9W+UEzMJdGAMU7k44ZX0bZjFORwRfc+makm M5R6FBrmv6d3KMXsjDsVJHXWL/u9esO0JFlK8y7Wc+/VkpsimTnJXQL7OpCRVoc8Fl RmYiNKOkfGNjDF/lkL4eryTQabM1LsEiUV2QMrq2LTBtCfLJ0ce+OpclDjzqdE7Ds+ xvTiZTlavoP1zeLnRIBAV14Mj5l2znQqbDa+G2eIx5LrifMRV33VkDL2vixyDNOkCx PwTMPx7XddefA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wth368cz9rxL; Wed, 26 Jun 2024 21:27:40 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:26:59 +0000 Message-ID: <20240626192717.12818-6-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/ghostscript.scm (ghostscript/tesseract): New variable. --- gnu/packages/ghostscript.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 2bc168db68..8c4cccb06e 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -36,6 +36,7 @@ (define-module (gnu packages ghostscript) #:use-module (gnu packages fontutils) #:use-module (gnu packages image) #:use-module (gnu packages man) + #:use-module (gnu packages ocr) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -428,6 +429,12 @@ (define-public ghostscript/cups (inputs (modify-inputs (package-inputs ghostscript) (prepend cups-minimal))))) +(define-public ghostscript/tesseract + (package/inherit ghostscript + (name (string-append (package-name ghostscript) "-with-tesseract")) + (inputs (modify-inputs (package-inputs ghostscript) + (prepend tesseract-ocr))))) + (define-public ijs (package (name "ijs") From patchwork Wed Jun 26 19:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65678 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 21D9B27BBEC; Wed, 26 Jun 2024 20:28:43 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 C1FF527BBE2 for ; Wed, 26 Jun 2024 20:28:41 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJc-0003Us-U8; Wed, 26 Jun 2024 15:28:24 -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 1sMYJM-0003P2-WC for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:09 -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 1sMYJF-0007eL-Va for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJI-0007EG-C1 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 07/12] gnu: mupdf: Update to 1.24.4 and unbundle remaining dependencies. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007827707 (code B ref 71787); Wed, 26 Jun 2024 19:28:04 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:58 +0000 Received: from localhost ([127.0.0.1]:40344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJC-0007Ch-2I for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:38089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ4-0007BI-4D for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 12DF2240028 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430062; bh=wHZV62pFYYpvOVpJSneGaFPhgM0p97FTiL5GZQCW29M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=TIW4L2raNRIHyf0+oqZfjKJjPTF0ciEwy2P8cKXZq/PjI9CNEv4h1vgtPxh3ux5fS QgSqHWeBWExxIu5wm12VIZi3KKjs+u+YBywdCAaMEk6ShV3JfSAT0x+hMgvtK10iX4 qcfN1ZwRQQF2hNrCqLLgQzicyFrN5i1Y/OeK6m4nD1WWI/7DZURpa+MeOD/BUlKe/V 787/opqK3zEMaX1su3DJhprNhF5TMP4uKTnZATAlB23J7kVWa2L40hb0fThBp71Wqc WKCqFDPRTHTe+KeMOE917qXbv1TqCp3TyeskzTcU4DxY/9dt0JMq0Rn/Z//1lElcOJ 574OIWNP7spZw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtj4hvkz9rxG; Wed, 26 Jun 2024 21:27:41 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:00 +0000 Message-ID: <20240626192717.12818-7-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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 (mupdf): Update to 1.24.4. [source]: Use git-fetch. Adjust snippet. [inputs]: Add extract, lcms2mt and memento. [arguments]: Set USE_SYSTEM_LCMS2 and USE_SYTEM_GLUT to 'yes'. Remove USE_SYSTEM_LEPTONICA and USE_SYSTEM_TESSERACT. Add "LIBS=...". : Add 'unbundle' and 'symlink-memento-header' phases. --- gnu/packages/pdf.scm | 127 ++++++++++++++++++++++++++++++------------- 1 file changed, 89 insertions(+), 38 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 4e260d614d..232cafcbf1 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -27,6 +27,7 @@ ;;; Copyright © 2023 Felix Gruber ;;; Copyright © 2024 dan ;;; Copyright © 2023 Benjamin Slade +;;; Copyright © 2024 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -64,6 +65,7 @@ (define-module (gnu packages pdf) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages build-tools) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cups) @@ -87,6 +89,7 @@ (define-module (gnu packages pdf) #:use-module (gnu packages lesstif) #:use-module (gnu packages libffi) #:use-module (gnu packages linux) + #:use-module (gnu packages llvm) #:use-module (gnu packages lua) #:use-module (gnu packages man) #:use-module (gnu packages markup) @@ -107,6 +110,7 @@ (define-module (gnu packages pdf) #:use-module (gnu packages sdl) #:use-module (gnu packages sphinx) #:use-module (gnu packages sqlite) + #:use-module (gnu packages swig) #:use-module (gnu packages tex) #:use-module (gnu packages time) #:use-module (gnu packages tcl) @@ -833,28 +837,23 @@ (define-public python-pydyf (define-public mupdf (package (name "mupdf") - (version "1.23.11") + (version "1.24.4") (source (origin - (method url-fetch) - (uri (string-append "https://mupdf.com/downloads/archive/" - "mupdf-" version "-source.tar.lz")) + (method git-fetch) + (uri (git-reference + (url "git://git.ghostscript.com/mupdf") + (commit (string-append version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1kv44zqijkvljc9fcqmgb8zqkj7hmasga70fsz98aimmrfc2rmyv")) - (modules '((guix build utils) - (ice-9 ftw) - (srfi srfi-1))) + (base32 "1h97zkdnnr6wfi42d23x6lr037mkl4cab181f34d9cbri4y5sf39")) (snippet - ;; Remove bundled software. Keep patched variants. - #~(with-directory-excursion "thirdparty" - (let ((keep '("README" "extract" "freeglut" "lcms2"))) - (for-each delete-file-recursively - (lset-difference string=? - (scandir ".") - (cons* "." ".." keep)))))))) + '(begin (delete-file "include/mupdf/memento.h") + (delete-file "source/fitz/memento.c"))))) (build-system gnu-build-system) (inputs (list curl + extract libxrandr libxi freeglut ;for GL/gl.h @@ -865,39 +864,91 @@ (define-public mupdf libjpeg-turbo libx11 libxext + lcms2mt + memento mujs openjpeg openssl zlib)) (native-inputs - (list pkg-config)) + (list + pkg-config + python + python-clang-13 + python-setuptools + swig)) (arguments (list #:tests? #f ;no check target + #:imported-modules `((guix build python-build-system) + ,@%gnu-build-system-modules) + #:modules '(((guix build python-build-system) + #:select (python-version)) + (guix build gnu-build-system) + (guix build utils)) #:make-flags - #~(list "verbose=yes" - (string-append "CC=" #$(cc-for-target)) - "XCFLAGS=-fpic" - "USE_SYSTEM_FREETYPE=yes" - "USE_SYSTEM_GUMBO=yes" - "USE_SYSTEM_HARFBUZZ=yes" - "USE_SYSTEM_JBIG2DEC=yes" - "USE_SYSTEM_JPEGXR=no # not available" - "USE_SYSTEM_LCMS2=no # lcms2mt is strongly preferred" - "USE_SYSTEM_LIBJPEG=yes" - "USE_SYSTEM_MUJS=yes" - "USE_SYSTEM_OPENJPEG=yes" - "USE_SYSTEM_ZLIB=yes" - "USE_SYSTEM_GLUT=no" - "USE_SYSTEM_CURL=yes" - "USE_SYSTEM_LEPTONICA=yes" - "USE_SYSTEM_TESSERACT=yes" - "shared=yes" - (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") - (string-append "prefix=" #$output)) + #~(list + "verbose=yes" + (string-append "CC=" #$(cc-for-target)) + "XCFLAGS=-fpic" + "USE_SYSTEM_LIBS=yes" + "USE_SYSTEM_FREETYPE=yes" + "USE_SYSTEM_GUMBO=yes" + "USE_SYSTEM_HARFBUZZ=yes" + "USE_SYSTEM_JBIG2DEC=yes" + "USE_SYSTEM_JPEGXR=no" ; non-free, also not bundled + "USE_SYSTEM_LCMS2=yes" + "USE_SYSTEM_LIBJPEG=yes" + "USE_SYSTEM_MUJS=yes" + "USE_SYSTEM_OPENJPEG=yes" + "USE_SYSTEM_ZLIB=yes" + "USE_SYSTEM_GLUT=yes" + "USE_SYSTEM_CURL=yes" + "VENV_FLAG=" + "shared=yes" + (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") + (string-append "prefix=" #$output) + (string-append "pydir=" #$output "/lib/python" + (python-version #$(this-package-native-input "python")) + "/site-packages") + "XLIBS=-lextract -lmemento") #:phases - #~(modify-phases %standard-phases - (delete 'configure)))) ;no configure script + #~(let ((memento-header-orig + (string-append #$(this-package-input "memento") + "/include/memento.h")) + (memento-header-out + (string-append #$output "/include/mupdf/memento.h"))) + (modify-phases %standard-phases + (add-after 'unpack 'unbundle + (lambda _ + (substitute* "Makethird" + ((".*THIRD_SRC \\+=.*") "")) + ;; This bundled header is part of the mupdf API. + (symlink memento-header-orig "include/mupdf/memento.h"))) + (delete 'configure) ; no configure script + (replace 'build + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + ;; Run seperately to prevent concurrency problems + (for-each + (lambda (make-targets) + (display (string-append + "Building " (string-join make-targets " ") "\n")) + (apply invoke "make" + `(,@make-targets + ,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags))) + '(("libs" "apps") ("c++") ("python"))))) + ;; Install Python binding + (add-after 'install 'install-python + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "install-shared-python" make-flags))) + ;; Change the copy back to a symlink. + (add-after 'install 'symlink-memento-header + (lambda _ + (delete-file memento-header-out) + (symlink memento-header-orig memento-header-out))))))) (home-page "https://mupdf.com") (synopsis "Lightweight PDF viewer and toolkit") (description From patchwork Wed Jun 26 19:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65677 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 AFBEB27BBE9; Wed, 26 Jun 2024 20:28:40 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 9867027BBE2 for ; Wed, 26 Jun 2024 20:28:39 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJY-0003T2-6O; Wed, 26 Jun 2024 15:28:20 -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 1sMYJN-0003P6-1d for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28: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 1sMYJG-0007eO-BQ for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJI-0007EN-PH for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 08/12] gnu: Add mupdf/tesseract. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007927714 (code B ref 71787); Wed, 26 Jun 2024 19:28:04 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:59 +0000 Received: from localhost ([127.0.0.1]:40346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJC-0007Cq-PM for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:59 -0400 Received: from mout02.posteo.de ([185.67.36.66]:41955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ5-0007BL-Qy for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 366B9240103 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430063; bh=KtjpK3XJF2mE+Ae8MQGc4wF2IVwep8dD9KASbYKJ4pI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=PkBwtgjf9YZkt5fnaWGHRzr57I+KmUprbwiLpt0Sx+xuD5uA616KP3XH0GXPB/M/C MBEVgYoBJAsMMWdxD7fnxJreLwbtyXKGntuOTMPJtVXzs146qQdyP930Jy/rpdpF7j 76jrKw5llcqU1sdJ3XXi57iOo34uTXNPXidkL4YaGsPJVzOXvYf6iBcmbFaQIt6gwQ SsG1152uTC9KvWvJJR+eMVc55+zMPoJoBXWiCUUaFb12aMzY+vChBZvbStEXFPO5Xb GYJIw9NYh9/fx6SY7+WLZedcPI3AGbAA9xrtHf0mHb1j0H9iVcnDM8SoVS7SQ4l8ut lzbRqEAm0Wv/w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtk5YPJz9rxK; Wed, 26 Jun 2024 21:27:42 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:01 +0000 Message-ID: <20240626192717.12818-8-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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 (mupdf/tesseract): New variable. --- gnu/packages/pdf.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 232cafcbf1..9e10264fad 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -966,6 +966,20 @@ (define-public mupdf license:silofl1.1 ;resources/fonts/{han,noto,sil,urw} license:asl2.0)))) ; resources/fonts/droid +(define-public mupdf/tesseract + (package/inherit mupdf + (name (string-append (package-name mupdf) "-with-tesseract")) + (inputs (modify-inputs (package-inputs mupdf) + (prepend leptonica tesseract-ocr))) + (arguments + (substitute-keyword-arguments (package-arguments mupdf) + ((#:make-flags flags) + #~(cons* + "tesseract=yes" + "USE_SYSTEM_LEPTONICA=yes" + "USE_SYSTEM_TESSERACT=yes" + #$flags)))))) + (define-public qpdf (package (name "qpdf") From patchwork Wed Jun 26 19:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65680 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 5569D27BBEC; Wed, 26 Jun 2024 20:28:49 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 C6DD927BBEA for ; Wed, 26 Jun 2024 20:28:48 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJX-0003SH-GK; Wed, 26 Jun 2024 15:28:19 -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 1sMYJN-0003P3-0b for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:09 -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 1sMYJG-0007em-PQ for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJJ-0007EV-4V for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 09/12] gnu: Add python-pymupdf. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007927722 (code B ref 71787); Wed, 26 Jun 2024 19:28:05 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:59 +0000 Received: from localhost ([127.0.0.1]:40348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJD-0007Cx-3c for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:59 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ6-0007BM-9F for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 33FA3240028 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430064; bh=2acnS+NrUh+f6VZWgYPdoYwoZReck4o1N84B3O/SZBk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=L+zaEuQMV9dDmd2YSLG0+6ATC+Lr1EECZ9zDR4ySO2HyM3FXtiS5+QcOXr8J/cWVI x8njQUV0U4R1DJduta45JE3fjLwlUogDgod0ZOkqc9wDV4u4M6eZjVBMG3LMFkF0Sn SaKHDEL604bl3R/pPMv2jzQWJ+kml7GrhF4rx/E+SEtXmazeL+6RZemM62IMU1HcH2 qFw+K8vsiwnwIXieFs7e5Br2OJF48TGu/+JHtrwKPBtZqSIhONy+Ccpo7/Vp9RmSu5 jLfqBTp+S9LKluVqu3kHZ7E740ZV01wqbMx//wS9YKlhhpasxRraS4lkePjZErD0Z4 cZV4Yt30nJG0Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtl5f2Wz9rxG; Wed, 26 Jun 2024 21:27:43 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:02 +0000 Message-ID: <20240626192717.12818-9-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/python-xyz.scm (python-pymupdf): New variable. --- gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index ff507e1855..111a3dd56c 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -8990,6 +8990,55 @@ (define-public python-pdftotext (description "Pdftotext is a Python library of PDF text extraction.") (license license:expat))) +(define-public python-pymupdf + (package + (name "python-pymupdf") + (version "1.24.7") + (source + (origin + (method url-fetch) + (uri (pypi-uri "PyMuPDF" version)) + (sha256 + (base32 "1f2r7c0nfw2g49q8fgf0kwkadihnf6c47pa93zavl5gj0kiflk53")))) + (build-system pyproject-build-system) + (inputs + (list + mupdf/tesseract)) + (native-inputs + (list + python-pillow + python-pytest + python-psutil + swig)) + (propagated-inputs (list mupdf)) + (arguments + (list + ;; Disable failing tests + #:test-flags + '(list + "-k" (string-append + "not test_flake8" + " and not test_fontarchive" + " and not test_subset_fonts" + " and not test_color_count" + " and not test_3050" + " and not test_pylint" + " and not test_textbox3")) + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'setenv + (lambda _ + (setenv "PYMUPDF_SETUP_MUPDF_BUILD" "") + (setenv "PYMUPDF_SETUP_IMPLEMENTATIONS" "b")))))) + (home-page "https://github.com/pymupdf/PyMuPDF") + (synopsis + "Python library for the analysis and manipulation of PDF files") + (description + "This package provides a high performance Python library for data +extraction, analysis, conversion & manipulation of PDF (and other) +documents.") + (license license:agpl3+))) + (define-public python-pluginbase (package (name "python-pluginbase") From patchwork Wed Jun 26 19:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65674 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 3D88B27BBEC; Wed, 26 Jun 2024 20:28:32 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 9B27727BBE2 for ; Wed, 26 Jun 2024 20:28:28 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJW-0003Qs-FK; Wed, 26 Jun 2024 15:28:19 -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 1sMYJM-0003Ow-Sr for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -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 1sMYJH-0007fS-7x for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJJ-0007Ec-Kr for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 10/12] gnu: Add python-svglib. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943007927729 (code B ref 71787); Wed, 26 Jun 2024 19:28:05 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:27:59 +0000 Received: from localhost ([127.0.0.1]:40350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJD-0007D4-Fu for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:59 -0400 Received: from mout02.posteo.de ([185.67.36.66]:44789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ7-0007BP-7G for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 29118240103 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430065; bh=zlhW8nHi/yAkjCbu7Sbzasx6J6TegFpICgmQeqb1uTg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=oT/Dj01Ow4DKmESU0FIIn1ChmqQCxamH5CiCGz7f3p43phksggPaQKzvW43SDX5DF fvi1tk0zH+VS9hG/k78pa27KyayVQcDiwbQl05o0tBhIdmCQ8P0+ZOCPBvu89WR2Wz KpotHJHbfZh+P/5y+U6mEiUCWYez7BOVfXdrVRS0pTeM8TxUaNiDrsXmoXH7BtpwDe WzrvHMbzJkmx1KRpWVmMgfY805VVTIJDrJ+bp2qKIKBZkOIEkPZ/1ZOtfuTLgg+oDy J6mbH8tmOMDBXZwKMpFqIu70obUvHJ0US+HxFrunp6joXe2wpW1lFzmebV0wFDLHxM IPB9vI/R/b2HQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtm5Nljz9rxG; Wed, 26 Jun 2024 21:27:44 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:03 +0000 Message-ID: <20240626192717.12818-10-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/python-xyz.scm (python-svglib): New variable. --- gnu/packages/python-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 111a3dd56c..d1385ffdef 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -29611,6 +29611,47 @@ (define-public python-cairosvg qvarious formats: PDF, PostScript, PNG and even SVG.") (license license:lgpl3+))) +(define-public python-svglib + (package + (name "python-svglib") + (version "1.5.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "svglib" version)) + (sha256 + (base32 "11z5jl38zjbzrmdly197m5x6303axcnlrlml1w6fd7j0m79nbrrs")))) + (build-system pyproject-build-system) + (propagated-inputs + (list python-cssselect2 + python-lxml + python-reportlab + python-tinycss2)) + (native-inputs + (list python-pytest)) + (arguments + (list + #:phases + '(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (if tests? + (setenv "PYTHONPATH" (getcwd)) + (invoke + "pytest" "-vv" + ;; These tests download additional data + "--deselect" + "tests/test_samples.py::TestW3CSVG::test_convert_pdf_png" + "--deselect" + (string-append + "tests/test_samples.py::TestWikipediaFlags" + "::test_convert_pdf")))))))) + (home-page "https://github.com/deeplook/svglib") + (synopsis "Python library for reading and converting SVG files") + (description "This package provides a pure-Python library for reading SVG +files and converting them to other formats.") + (license license:lgpl3+))) + (define-public python-pyphen (package (name "python-pyphen") From patchwork Wed Jun 26 19:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65679 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 F41AF27BBE2; Wed, 26 Jun 2024 20:28:43 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 111A327BBEA for ; Wed, 26 Jun 2024 20:28:42 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYJa-0003UE-OS; Wed, 26 Jun 2024 15:28:22 -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 1sMYJM-0003P0-V6 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -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 1sMYJH-0007fT-Jb for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYJK-0007Ej-19 for guix-patches@gnu.org; Wed, 26 Jun 2024 15:28:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 11/12] gnu: Add python-rst2pdf. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:28:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943008127740 (code B ref 71787); Wed, 26 Jun 2024 19:28:06 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:28:01 +0000 Received: from localhost ([127.0.0.1]:40352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJE-0007DC-SP for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:28:01 -0400 Received: from mout01.posteo.de ([185.67.36.65]:49985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ8-0007Bc-5I for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 18BBE240027 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430066; bh=xQUpDW/HWayDMclhmXSa8NXBRbjascg05+N2Ch60NsU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=hpxvxPOMRn70D9MtHpvwP0GmyURKwgWNtsWTNqJ6b41rh/ld2i4D8DyX9VA0rffmo 5gbg5hHxIdj0ASmmMScHeMnaWVXzQAq4PUCyR1xjO09A3ude1CHdCYHcGRYnlWLkHO QCxwMVPaIvh4nr1LLqU/D9Y3aq/A/XDzu4faIKXf72eIyDxBjtCEoytMUK+/5OL2Rc nx6vUK+kd+//KZevZTJ1yZcVCKknKEjUx1sAvSJrfbZpHdop6wQSj++KugtXGjLw54 EtzZhVyGkStg37xM8uXsa4fF+dRYT+OVnnHy8+eiWkSB7c/u9/7MrP5qsNN4JrpRZm rKWN4c5jQhk5g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtn4fLXz9rxN; Wed, 26 Jun 2024 21:27:45 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:04 +0000 Message-ID: <20240626192717.12818-11-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/python-xyz.scm (python-rst2pdf): New variable. --- gnu/packages/python-xyz.scm | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index d1385ffdef..1688999d56 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -6877,6 +6877,59 @@ (define-public python-docutils ;; licensed under the PFSL, BSD 2-clause, and GPLv3+ licenses. (license (list license:public-domain license:psfl license:bsd-2 license:gpl3+)))) +(define-public python-rst2pdf + (package + (name "python-rst2pdf") + (version "0.102") + (source + (origin + (method url-fetch) + (uri (pypi-uri "rst2pdf" version)) + (sha256 + (base32 "09gl8h457p4ackgmisxy41y4dx8fccj6zbnbvpfkx9skx4j0cc1p")))) + (build-system pyproject-build-system) + (propagated-inputs + (list python-docutils + python-importlib-metadata + python-jinja2 + python-packaging + python-pygments + python-pyyaml + python-reportlab + python-smartypants)) + (native-inputs + (list fontconfig + python-pymupdf + python-pytest + python-svglib)) + (arguments + (list + ;; These tests fail + #:test-flags + '(list + "-k" + (string-join + '("not test-referencing-an-aliased-font" + "test_aafigure" + "test_aafigure_extra" + "test_docutils_math" + "test_issue_231" + "test_issue_349" + "test_issue_363" + "test_issue_73_unicode_box_drawing_characters_renders_without_errors" + "test_issue_785" + "test_math" + "test_math_role" + "test_raw_html" + "test_slides") + " and not ")))) + (home-page "https://rst2pdf.org") + (synopsis "Tool to convert reStructuredText to PDF via ReportLab") + (description + "@code{rst2pdf} is a command line tool for converting @code{reStructured} +text to PDF files via the @code{ReportLab} library.") + (license license:expat))) + ;; awscli refuses to be built with docutils < 0.16. (define-public python-docutils-0.15 (package From patchwork Wed Jun 26 19:27:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 65682 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 9285D27BBE9; Wed, 26 Jun 2024 20:29:11 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 E97AA27BBE2 for ; Wed, 26 Jun 2024 20:29:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYKE-0003x2-Il; Wed, 26 Jun 2024 15:29:02 -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 1sMYKC-0003vO-Cl for guix-patches@gnu.org; Wed, 26 Jun 2024 15:29:00 -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 1sMYKC-00084t-4N for guix-patches@gnu.org; Wed, 26 Jun 2024 15:29:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYKE-0007G7-Ht for guix-patches@gnu.org; Wed, 26 Jun 2024 15:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71787] [PATCH 12/12] gnu: Add ghostscript-documentation. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Jun 2024 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71787@debbugs.gnu.org Cc: David Elsing Received: via spool by 71787-submit@debbugs.gnu.org id=B71787.171943009427851 (code B ref 71787); Wed, 26 Jun 2024 19:29:02 +0000 Received: (at 71787) by debbugs.gnu.org; 26 Jun 2024 19:28:14 +0000 Received: from localhost ([127.0.0.1]:40365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJS-0007F9-Bn for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:28:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYJ9-0007Bk-FW for 71787@debbugs.gnu.org; Wed, 26 Jun 2024 15:27:55 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 67724240101 for <71787@debbugs.gnu.org>; Wed, 26 Jun 2024 21:27:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719430067; bh=zQqO612teFfMvB0tisRmIAWNC2uNZEvQ1IlE/3shbUM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=IuS9Lhwg8Om/TiOjTwux6zZjpXPRGRan4gtShKmryBY/nX6VlY0HBU2GsJqG3sXOi 1Vevk6TywLg8JjR98R7wX0o6z3mIdxUs0yqTxYJGm7LY9MHfsRs84lPq8fLxvn3CHF dQ/QulwclqlJW6owHA7WsZIcoZLtsAQaKq+W6uhOzmucD4cdicDIdXBJXyFoAPinlU ErQwVsJCDQE6QcVe3ihqr9a6xA0cB39EOsGpJW/3iiu8gAv4HDUV7LVtPo+6b6aTaS yZ1k8fV+i8G7dpPaGLq7evDPlZJb7f6Ttj0Xm7yWrSZhe2e9g+JLbKtrCX4//lvKFr Omx/U9mjOQguA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W8Wtq040Yz9rxG; Wed, 26 Jun 2024 21:27:46 +0200 (CEST) From: David Elsing Date: Wed, 26 Jun 2024 19:27:05 +0000 Message-ID: <20240626192717.12818-12-david.elsing@posteo.net> In-Reply-To: <20240626192505.12401-1-david.elsing@posteo.net> References: <20240626192505.12401-1-david.elsing@posteo.net> 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/ghostscript.scm (ghostscript-documentation): New variable. --- gnu/packages/ghostscript.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index 8c4cccb06e..6d2653e26e 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -40,6 +40,8 @@ (define-module (gnu packages ghostscript) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages sphinx) #:use-module (gnu packages tcl) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) @@ -49,6 +51,7 @@ (define-module (gnu packages ghostscript) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module (srfi srfi-1)) (define-public lcms @@ -417,6 +420,39 @@ (define-public ghostscript ;; inclusion in Postscript and PDF files. (license:non-copyleft "file://LICENSE"))))) +;; Put the documentation in a separate package due to a circular dependency of +;; ghostscript with python-sphinx. +(define-public ghostscript-documentation + (package + (inherit ghostscript) + (name (string-append (package-name ghostscript) "-documentation")) + (native-inputs + (list + python + python-pymupdf + python-rst2pdf + python-sphinx + python-sphinx-copybutton + python-sphinx-rtd-theme)) + (inputs '()) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (delete 'bootstrap) + (delete 'configure) + (replace 'build + (lambda _ + (chdir "doc") + (invoke "sphinx-build" "-b" "html" "src" "build"))) + (replace 'install + (lambda _ + (copy-recursively + "build" (string-append #$output "/share/doc/ghostscript/" + #$(package-version this-package)))))))) + (license license:agpl3+))) + (define-public ghostscript/x (package/inherit ghostscript (name (string-append (package-name ghostscript) "-with-x"))