From 74fa77e936d88a82fbb6b625beae49287b8653e9 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 25 Jun 2018 23:22:32 +0200 Subject: gnu: Add docx2txt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/textutils.scm (docx2txt): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/textutils.scm | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 5734bf62d..5dec41428 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2017 Kei Kebreau ;;; Copyright © 2017 Alex Vong ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2018 Pierre Neidhardt ;;; ;;; This file is part of GNU Guix. ;;; @@ -675,3 +676,68 @@ and Cython.") measuring and checking the width of strings, with support east asian text.") (home-page "https://github.com/jessevdk/go-flags") (license license:expat))) + +(define-public docx2txt + (package + (name "docx2txt") + (version "1.4") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/docx2txt/docx2txt/v" + version "/docx2txt-" version ".tgz")) + (sha256 + (base32 + "06vdikjvpj6qdb41d8wzfnyj44jpnknmlgbhbr1w215420lpb5xj")))) + (build-system gnu-build-system) + (inputs + `(("unzip" ,unzip) + ("perl" ,perl))) + (arguments + `(#:tests? #f ; No tests. + #:make-flags (list (string-append "BINDIR=" + (assoc-ref %outputs "out") "/bin") + (string-append "CONFIGDIR=" + (assoc-ref %outputs "out") "/etc") + ;; Makefile seems to be a bit dumb at guessing. + (string-append "INSTALL=install") + (string-append "PERL=perl")) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'install 'fix-install + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (config (string-append out "/etc/docx2txt.config")) + (unzip (assoc-ref inputs "unzip"))) + ;; According to INSTALL, the .sh wrapper can be skipped. + (delete-file (string-append bin "/docx2txt.sh")) + (rename-file (string-append bin "/docx2txt.pl") + (string-append bin "/docx2txt")) + (substitute* config + (("config_unzip => '/usr/bin/unzip',") + (string-append "config_unzip => '" + unzip + "/bin/unzip',"))) + ;; Makefile is wrong. + (chmod config #o644))))))) + (synopsis "Recover text from @file{.docx} files, with good formatting") + (description + "@command{docx2txt} is a Perl based command line utility to convert +Microsoft Office @file{.docx} documents to equivalent text documents. Latest +version supports following features during text extraction. + +@itemize +@item Character conversions; currency characters are converted to respective +names like Euro. +@item Capitalisation of text blocks. +@item Center and right justification of text fitting in a line of +(configurable) 80 columns. +@item Horizontal ruler, line breaks, paragraphs separation, tabs. +@item Indicating hyperlinked text along with the hyperlink (configurable). +@item Handling (bullet, decimal, letter, roman) lists along with (attempt at) +indentation. +@end itemize\n") + (home-page "http://docx2txt.sourceforge.net") + (license license:gpl3+))) -- cgit v1.3 From 483374378bcc6cd0a55f1947547e65206bcbc573 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 12 Jul 2018 16:48:55 +0200 Subject: gnu: oniguruma: Update to 6.8.2. * gnu/packages/textutils.scm (oniguruma): Update to 6.8.2. --- gnu/packages/textutils.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 5dec41428..9cf324ba1 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -338,7 +338,7 @@ as existing hashing techniques, with provably negligible risk of collisions.") (define-public oniguruma (package (name "oniguruma") - (version "5.9.6") + (version "6.8.2") (source (origin (method url-fetch) (uri (string-append "https://github.com/kkos/" @@ -346,7 +346,7 @@ as existing hashing techniques, with provably negligible risk of collisions.") "/onig-" version ".tar.gz")) (sha256 (base32 - "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m")))) + "00s9gjgb3srn5sbmx4x9bssn52mi04d868ghizssdhjlddgxmsmd")))) (build-system gnu-build-system) (home-page "https://github.com/kkos/oniguruma") (synopsis "Regular expression library") -- cgit v1.3 From d5019f9ca750aa2bd49048c5462d9eac220b0644 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 12 Jul 2018 16:59:56 +0200 Subject: gnu: php: Build with an older oniguruma. * gnu/packages/textutils.scm (oniguruma-5): New public variable. * gnu/packages/php.scm (php)[inputs]: Change ONIGURUMA to ONIGURUMA-5. --- gnu/packages/php.scm | 2 +- gnu/packages/textutils.scm | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm index 90e6ab1c1..1acab0de7 100644 --- a/gnu/packages/php.scm +++ b/gnu/packages/php.scm @@ -318,7 +318,7 @@ ("libxpm" ,libxpm) ("libxslt" ,libxslt) ("libx11" ,libx11) - ("oniguruma" ,oniguruma) + ("oniguruma" ,oniguruma-5) ("openldap" ,openldap) ("openssl" ,openssl) ("pcre" ,pcre) diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 9cf324ba1..355683df8 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -355,6 +355,20 @@ characteristic of this library is that different character encoding for every regular expression object can be specified.") (license license:bsd-2))) +;; PHP < 7.3.0 requires this old version. Remove once no longer needed. +(define-public oniguruma-5 + (package + (inherit oniguruma) + (version "5.9.6") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/kkos/" + "oniguruma/releases/download/v" version + "/onig-" version ".tar.gz")) + (sha256 + (base32 + "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m")))))) + (define-public antiword (package (name "antiword") -- cgit v1.3