From: "Wiktor Żelazny" <wz@freeshell.de>
To: 57337@debbugs.gnu.org
Cc: ludo@gnu.org
Subject: [bug#57337] [PATCH v3 2/2] gnu: Add docxbox.
Date: Sun, 5 Feb 2023 21:18:33 +0100 [thread overview]
Message-ID: <20230205201833.24156-2-wz@freeshell.de> (raw)
In-Reply-To: <20230205201833.24156-1-wz@freeshell.de>
* gnu/packages/textutils.scm (docxbox): New variable.
---
gnu/packages/textutils.scm | 73 +++++++++++++++++++++++++++++++++++++-
1 file changed, 72 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 151add964e..b75b54e9f4 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -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)
@@ -74,7 +75,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
@@ -1522,3 +1524,72 @@ (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
+ (let ((commit "7c09cfdfd055fedf72676250eae8f03bb8ef7ed5")
+ (revision "1"))
+ (package
+ (name "docxbox")
+ (version (git-version "0.0.5" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gyselroth/docxbox")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0irccm5siy7k6kjnrmm9pxc4cmc3l30377kqpp6vd6y21nk7yc4w"))
+ (modules '((guix build utils)))
+ (snippet '(for-each delete-file-recursively
+ '("bin" "vendor/json" "vendor/miniz-cpp"
+ "vendor/tinyxml2")))))
+ (build-system cmake-build-system)
+ ;; (native-inputs (list bats)) ; Enable after fixing tests, use bash module
+ (inputs (list json-modern-cxx miniz-cpp))
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'unvendor
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "CMakeLists.txt"
+ (("vendor/miniz-cpp/zip_file.hpp")
+ ""))
+ (with-directory-excursion "docxbox"
+ (substitute* (find-files "." "\\.(cc|h)$")
+ (("#include <vendor/json/single_include/")
+ "#include <"))
+ (substitute* (find-files "." "\\.hpp$")
+ (("#include <vendor/miniz-cpp/")
+ "#include <")))))
+ (add-after 'unpack 'unpack-tinyxml2
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "vendor/tinyxml2")
+ (copy-recursively #$(package-source tinyxml2)
+ "vendor/tinyxml2")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/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 "Command-line tool for MS Word @file{.docx} templating and
+analysis")
+ (description
+ "@command{docxbox} enables direct and convenient inspection and
+manipulation of XML and media files making up a @file{.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.39.1
prev parent reply other threads:[~2023-02-05 20:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 9:27 [bug#57337] [PATCH 0/2] Add docxbox Wiktor Żelazny
2022-08-22 9:36 ` [bug#57337] [PATCH 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2022-08-22 9:36 ` [bug#57337] [PATCH 2/2] gnu: Add docxbox Wiktor Żelazny
2022-09-08 12:49 ` [bug#57337] [PATCH 0/2] " Ludovic Courtès
2022-09-23 18:04 ` Wiktor Żelazny
2022-09-08 12:46 ` Ludovic Courtès
2022-09-23 17:46 ` Wiktor Żelazny
2022-09-08 12:44 ` Ludovic Courtès
2022-09-23 18:21 ` Wiktor Żelazny
2022-12-26 14:57 ` [bug#57337] [v2 " Wiktor Żelazny
2022-12-26 14:57 ` [bug#57337] [v2 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2023-01-25 22:17 ` Ludovic Courtès
2022-12-26 14:57 ` [bug#57337] [v2 2/2] gnu: Add docxbox Wiktor Żelazny
2023-01-25 22:21 ` Ludovic Courtès
2023-01-28 19:50 ` Wiktor Żelazny
2023-02-05 20:18 ` [bug#57337] [PATCH v3 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2023-02-05 20:18 ` Wiktor Żelazny [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230205201833.24156-2-wz@freeshell.de \
--to=wz@freeshell.de \
--cc=57337@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.