From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +L9DCfFrfGZn/AAAe85BDQ:P1 (envelope-from ) for ; Wed, 26 Jun 2024 19:28:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id +L9DCfFrfGZn/AAAe85BDQ (envelope-from ) for ; Wed, 26 Jun 2024 21:28:49 +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=JPdau1b5; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719430128; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=NQiLq90AulyCwuNnlam1v0MeqzZWPu+pNVVt4LJIFg8=; b=CVG7eXgcB7J7/+a7XVtmWp88VPc/LulrdffzKV4NjLyptLAUYocyH5kcgkb6n2Zz0XmlA3 /NbQS+x9fWHglBWrBSBHDjV1DmpI0z5cHz59ZGA1E9x/AkNpxM1Uf9Zk5QqYnsfmGvlLAK 6K73pR24fmxQ3dAwkU39BkRfRXrRslEbNejPrzLSdxjMbzEaDVcgfO+1xYlYHX+uCr6Cva 4nSAh62pnY8rMHB1yp/QZl5A5p4/YaqEcMv/YbG7NEEuo5y8BoArUgxJxDHb97TnHQM3JR 9k2GOaEHkb7bQSlXOvYYZVt2tiuJTWaqKIxHSAQbq8qBd1FGlgqz0Z2s+X2+cQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=JPdau1b5; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719430128; a=rsa-sha256; cv=none; b=LplnFYIYf/jmBoDlNwxwu/T1mZvavWCQHgf/Rictkzmd8WmafegsbJKMKM0oD+liB1qCaP oe/A8aaYEbX0BbvUJnM0wnUNMPzYFkA0dDF+zpRPd9BNduve2vqBVdFiRFBRcFhpT2CxLn JGzBBPqzbaCuq+dVLagQ+KpnNwGp6KNIBTnutm3MuIKFEal6oxAtuv8DBdcy1WiFK+so2V eC9ozY5svmW6ti8dkFpOtswOMHklmOWkcO/XNRoUFsPHOlXpD+vbjnDGFX3TrKyxT7kLD4 eAz6buIM95ISTD5kSPOZ1HwLjlKgz4o15JH+MLcIFnjz5xCZx3KFQqID8Jkxfw== 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 C39B6766A4 for ; Wed, 26 Jun 2024 21:28:48 +0200 (CEST) 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 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 3.93 X-Migadu-Queue-Id: C39B6766A4 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 3.93 X-TUID: vJT4NMPYlxT3 * 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 -- 2.45.1