diff options
author | Lars-Dominik Braun <ldb@leibniz-psychology.org> | 2021-03-15 10:24:07 +0100 |
---|---|---|
committer | Lars-Dominik Braun <ldb@leibniz-psychology.org> | 2021-03-15 10:53:11 +0100 |
commit | 6f688733b5597d7f2c9727d06a63f69a4329e1a2 (patch) | |
tree | 536fd1d6e05d7468d982fd82c3fdb6878167c409 /gnu | |
parent | 275b7987c0baf66bed2c64c044975b1c3719b22b (diff) | |
download | guix-patches-6f688733b5597d7f2c9727d06a63f69a4329e1a2.tar guix-patches-6f688733b5597d7f2c9727d06a63f69a4329e1a2.tar.gz |
gnu: Add r-antiword.
* gnu/packages/cran.scm (r-antiword): New variable.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/cran.scm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index f7d170ef63..6d95df6e62 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -100,6 +100,7 @@ #:use-module (gnu packages sqlite) #:use-module (gnu packages statistics) #:use-module (gnu packages tcl) + #:use-module (gnu packages textutils) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (gnu packages web) @@ -27745,3 +27746,44 @@ attachments and metadata from a PDF file. Also supports high quality rendering of PDF documents into PNG, JPEG, TIFF format, or into raw bitmap vectors for further processing in R.") (license license:expat))) + +(define-public r-antiword + (package + (name "r-antiword") + (version "1.3") + (source + (origin + (method url-fetch) + (uri (cran-uri "antiword" version)) + (sha256 + (base32 + "034znb0g9wwb8gi1r3z75v3sbb4mh83qrc4y8mbfx5lbgh8zhj6j")) + (modules '((guix build utils))) + (snippet + '(begin + ;; unvendor libantiword + (delete-file-recursively "src") + #t)))) + (properties `((upstream-name . "antiword"))) + (build-system r-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'use-system-antiword + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "R/antiword.R" + (("system.file\\(\"bin\", package = \"antiword\"\\)") + (string-append "\"" (assoc-ref inputs "antiword") "/bin\""))) + #t))))) + (inputs `(("antiword" ,antiword))) + (propagated-inputs `(("r-sys" ,r-sys))) + (home-page + "https://github.com/ropensci/antiword#readme") + (synopsis + "Extract Text from Microsoft Word Documents") + (description + "Wraps the @code{AntiWord} utility to extract text from Microsoft Word +documents. The utility only supports the old @code{doc} format, not the new +xml based @code{docx} format. Use the @code{xml2} package to read the +latter.") + (license license:gpl2))) |