From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WIGJEOprfGZeFgAAqHPOHw:P1 (envelope-from ) for ; Wed, 26 Jun 2024 19:28:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id WIGJEOprfGZeFgAAqHPOHw (envelope-from ) for ; Wed, 26 Jun 2024 21:28:42 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=TIW4L2ra; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719430122; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=urqiqaOM+K8GezssYEt0amsrcHGDBCV2th2Rx9ag3nU=; b=MspjWu+Opd4oc2erhmLBKa+OXUJGu9xoURtUUwOe8/NS+lC6t3g420yogeQUZDZfzLL93n ScFSzTX4gcjh7tCypg/3DP2QSFeQIuP5McYVFBjuo5OeBkS+YC+SInrmrw/SquTCEHVYk/ hTMrJRI0mwZfDjKUSLtAk9h92h/jo9W49HO6V7pXXQuQWG/FmhwrdF2pH/4dPxDjbOBgeI eD8RLvFMX6NKpxFyxI2tCaURh9bH2imNN33EngzESA7VfOLVvGFSAf+7kFoMxPxWtcz1je 7FnUBcstVMoaOHIHOmPEjW6kDdT4mi80vysB4Z8+2ug5isvLNCTdgyprSozJ1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719430122; a=rsa-sha256; cv=none; b=DNA1AZUvXSqZSfKavPkqORvSLfyI4lF2NB98Uk03yWIT3ta0bekUNBzo0g9iXZTqBaeTXe slrpRDLbXDK5V2qfX3XsEPUOAvU/gkMwgOK0BaRx6HOT3ko4WbybxoKK7TwcxwefLNTuRO eOO2gEBcb9De4fckc5jNRd2yOvkicD+8bfYNxLTZzrX8Y8xL6owZx/Wa2t8927MqXXbKeT 2EgvAOa9ywnzfmy98J1H05zEUJI2w2xHdTqxyNveggd2pzF1Gf5vBSN/lmit4w4aT1zSfM ezB5ldPuO5i8wRctnLkpUtzDt8Wx72VFNITFh+hsBmBqd3s2WIKZaswpCHSHzQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=TIW4L2ra; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D9EBD7350F for ; Wed, 26 Jun 2024 21:28:41 +0200 (CEST) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.47 X-Spam-Score: -1.47 X-Migadu-Queue-Id: D9EBD7350F X-Migadu-Scanner: mx11.migadu.com X-TUID: bXl37/Dj3KmX * 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 -- 2.45.1