From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UOkLC1NQA2MfRAAAbAwnHQ (envelope-from ) for ; Mon, 22 Aug 2022 11:45:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AAIRC1NQA2OwHAEA9RJhRA (envelope-from ) for ; Mon, 22 Aug 2022 11:45:55 +0200 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 EDEACE6D0 for ; Mon, 22 Aug 2022 11:45:54 +0200 (CEST) Received: from localhost ([::1]:60568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQ40I-0003dM-5R for larch@yhetil.org; Mon, 22 Aug 2022 05:45:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ3sh-0003Ws-U1 for guix-patches@gnu.org; Mon, 22 Aug 2022 05:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ3sg-0003mx-OM for guix-patches@gnu.org; Mon, 22 Aug 2022 05:38:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQ3sg-0005Zl-KD for guix-patches@gnu.org; Mon, 22 Aug 2022 05:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57337] [PATCH 2/2] gnu: Add docxbox. Resent-From: Wiktor =?UTF-8?Q?=C5=BBelazny?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 Aug 2022 09:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57337 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57337@debbugs.gnu.org Cc: Wiktor =?UTF-8?Q?=C5=BBelazny?= Received: via spool by 57337-submit@debbugs.gnu.org id=B57337.166116104221359 (code B ref 57337); Mon, 22 Aug 2022 09:38:02 +0000 Received: (at 57337) by debbugs.gnu.org; 22 Aug 2022 09:37:22 +0000 Received: from localhost ([127.0.0.1]:37872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ3s1-0005YQ-Qe for submit@debbugs.gnu.org; Mon, 22 Aug 2022 05:37:22 -0400 Received: from freeshell.de ([116.202.128.144]:38892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ3rz-0005YC-Dj for 57337@debbugs.gnu.org; Mon, 22 Aug 2022 05:37:20 -0400 Received: from localhost.localdomain (cst-prg-68-192.cust.vodafone.cz [46.135.68.192]) (Authenticated sender: wz) by freeshell.de (Postfix) with ESMTPSA id 89D9BB36408E; Mon, 22 Aug 2022 11:37:06 +0200 (CEST) From: Wiktor =?UTF-8?Q?=C5=BBelazny?= Date: Mon, 22 Aug 2022 11:36:51 +0200 Message-Id: <20220822093651.31574-2-wz@freeshell.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220822093651.31574-1-wz@freeshell.de> References: <20220822093651.31574-1-wz@freeshell.de> 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661161555; 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; bh=HhJ3cohqJnBn0DloTAz3eAkdgMsAHKxvfqoqF0LIfwE=; b=cVjrjCsl/7RovD3j+vQJFgJ/1m28uaGQpi2bEywKTSddQvOambPdG4qJHrQHybI/OZF5Fl iXcjh1D6Dj3NP+udTCmQCVAq77wYLXr+8mi0nErGWZzjr9hLBxZuEKrkbKP7XkcTOlI442 1ShBWgHq29Zw1HYCfrrJAvzOlL7msJ+LbjbEL2VI2PMadj1uOrnawdJrpaHFu0E1ZfRRdc N9ldAahU03yXzPMQ1sDNgXTLJ/x6lz98OFVfP7ouGXft0yXJpw6A9zQjgh9/AHt6EK8ov0 yHX+tlnjUACZr2jNZjyQoD8azHr3W1CKZOAj8YI5iU4xstQxIg6F82hQyF5iHw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661161555; a=rsa-sha256; cv=none; b=cpAzf3RLjUS1/R3QO0FnlOHDBdWRGkxCWDQwVOHsKqZKFJdSPCXRD7u8CILV9YtRCBPU2N pGGPhuiv4s89aG4tepp4F4Dn8KB/1QHb1o7mATh+34g9QtF9vth1GLSzWJEorB8w0cgxU/ JNqXV7wKBegZAAD8B1fa3e+G6YPQ85I/aDEJxp39xweuYRvY6PkGvdB5pqfbPifi0T85EM eu+/lF5sN+l3nbB/ot4iMYoyPSG3IkFrxjaZTm5fl/mEoEyfRJ2FGxwzkpkag45h6XVoKS DOEi/GKs6arBxFWBxEJmdUgZf5bVAMPhe9MM8Z1XRmbcvOSq3Zwes2TNidWYFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freeshell.de (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" X-Migadu-Spam-Score: 3.88 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freeshell.de (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" X-Migadu-Queue-Id: EDEACE6D0 X-Spam-Score: 3.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: kx7F+wsYrEoC From: Wiktor Żelazny * gnu/packages/textutils.scm (docxbox): New variable. --- gnu/packages/textutils.scm | 73 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 7898d520f0..41a75c727d 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -18,7 +18,7 @@ ;;; Copyright © 2018 Meiyo Peng ;;; Copyright © 2019 Yoshinori Arai ;;; Copyright © 2019 Mădălin Ionel Patrașcu -;;; Copyright © 2019 Wiktor Żelazny +;;; Copyright © 2019, 2022 Wiktor Żelazny ;;; Copyright © 2020 Maxim Cournoyer ;;; Copyright © 2021 Jean-Baptiste Volatier ;;; Copyright © 2021 Simon Tournier @@ -58,6 +58,7 @@ (define-module (gnu packages textutils) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages gcc) #:use-module (gnu packages golang) #:use-module (gnu packages gettext) @@ -73,7 +74,8 @@ (define-module (gnu packages textutils) #:use-module (gnu packages ruby) #:use-module (gnu packages slang) #:use-module (gnu packages syncthing) - #:use-module (gnu packages web)) + #:use-module (gnu packages web) + #:use-module (gnu packages xml)) (define-public dos2unix (package @@ -1502,3 +1504,70 @@ (define-public ack easily specify file types, match highlighting, Perl-Compatible Regular Expressions, and being faster to type than grep.") (license license:artistic2.0))) + +(define-public docxbox + (package + (name "docxbox") + (version "0.0.5") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/gyselroth/docxbox/archive/refs/tags/" + version ".tar.gz")) + (sha256 + (base32 + "19ik3jhyyk26bj8x2adaxwwj8l4sg1h2kf2d0hw43yhsqki176cb")) + (modules '((guix build utils))) + (snippet '(begin + (for-each delete-file-recursively + '("bin" "vendor/json" "vendor/miniz-cpp" + "vendor/tinyxml2")) #t)))) + (build-system cmake-build-system) + ;; (native-inputs (list bats)) ; Enable after fixing tests, use bash module + (inputs `(("json-modern-cxx-source" ,(package-source json-modern-cxx)) + ("miniz-cpp-source" ,(package-source miniz-cpp)) + ("tinyxml2-source" ,(package-source tinyxml2)))) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'unpack-json-modern-cxx + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "vendor/json-modern-cxx") + (copy-recursively (assoc-ref inputs + "json-modern-cxx-source") + "vendor/json") #t)) + (add-after 'unpack 'unpack-miniz-cpp + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "vendor/miniz-cpp") + (copy-recursively (assoc-ref inputs "miniz-cpp-source") + "vendor/miniz-cpp") #t)) + (add-after 'unpack 'unpack-tinyxml2 + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "vendor/tinyxml2") + (copy-recursively (assoc-ref inputs "tinyxml2-source") + "vendor/tinyxml2") #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/usr/bin"))) + (install-file "bin/linux/docxbox" bin))))) + #:configure-flags (let* ((out (assoc-ref %outputs "out"))) + '("-DCMAKE_CXX_FLAGS=-fpermissive -Wno-error")) + ;; Tests depend on a bundled binary in bin/linux/, and even with the + ;; binary in place, I could not get them to run. To my understanding, + ;; the setup() function in test/functional/_helper.bash is supposed to + ;; copy the binary to the test suite directory. However, this does not + ;; seem to happen when invoking ./test.sh (make check is not + ;; supported), and the script complains about the missing binary in the + ;; directory. The fix could be to copy the binary built by the Guix + ;; daemon to the test suite directory before invoking ./test.sh, but + ;; this is beyond my skills. + #:tests? #f)) + (home-page "https://github.com/gyselroth/docxbox/") + (synopsis "CLI tool for MS Word DOCX templating and analysis") + (description + "@command{docxbox} enables direct and convenient inspection and +manipulation of XML and media files making up a DOCX file. The +capabilities include batch editing, unpacking and indentation for manual +editing in a text editor and subsequent unindentation and repacking, +operations on metadata, and diffing") + (license license:expat))) -- 2.37.2