From b43e9c8ecd44b597936033eb441f50980d00c398 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 27 Apr 2021 11:52:40 +0200 Subject: gnu: Add html2text. * gnu/packages/textutils.scm (html2text): New variable. --- gnu/packages/textutils.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index c2eb7ca1dad..398bfc28cae 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -1011,6 +1011,39 @@ indentation. (home-page "http://docx2txt.sourceforge.net") (license license:gpl3+))) +(define-public html2text + ;; Use commit directly to get the fixes to the installation phase + ;; that are not in a release yet. + (let ((commit "05364c1028026a87d6f45130a8e86e1ee67704d2") + (revision "1")) + (package + (name "html2text") + (version (git-version "2.0.1_pre" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/grobian/html2text") + (commit (string-append commit)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0n6pl0nijcn4z3p0dvf3gmvvpjq261pagnk84s9f78c4c55bw5cm")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-paths + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Makefile.in" + (("/usr/local") + (assoc-ref outputs "out")))))))) + (home-page "https://github.com/grobian/html2text") + (synopsis "HTML to plain text converter") + (description + "@code{html2text} is a command line utility that converts HTML +documents into plain text.") + (license license:gpl2+)))) + (define-public odt2txt (package (name "odt2txt") -- cgit v1.3 From b0020938e17ac4d7f9f87d9bb7ff2d2dbdd7c33f Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 27 Apr 2021 13:54:41 +0200 Subject: gnu: html2text: Run ./configure without errors. * gnu/packages/textutils.scm (html2text)[arguments]: Add a custom 'configure phase. Replace the custom 'fix-paths phase with the customary #:make-flags equivalent. --- gnu/packages/textutils.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 398bfc28cae..0df8399ffd7 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -1030,13 +1030,15 @@ indentation. (base32 "0n6pl0nijcn4z3p0dvf3gmvvpjq261pagnk84s9f78c4c55bw5cm")))) (build-system gnu-build-system) (arguments - `(#:phases + `(#:make-flags + (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) + #:phases (modify-phases %standard-phases - (add-after 'unpack 'fix-paths + (replace 'configure + ;; The configure script is not from autotools and does not accept + ;; ‘--style’ options. There is no proper error handling. (lambda* (#:key outputs #:allow-other-keys) - (substitute* "Makefile.in" - (("/usr/local") - (assoc-ref outputs "out")))))))) + (invoke "./configure")))))) (home-page "https://github.com/grobian/html2text") (synopsis "HTML to plain text converter") (description -- cgit v1.3 From 5c81cbda5e1c97b5234f48f36de28adcccaa3555 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 27 Apr 2021 13:57:35 +0200 Subject: gnu: html2text: Fix cross-compilation. * gnu/packages/textutils.scm (html2text)[arguments]: Set $CXX to the correct (CC-FOR-TARGET). --- gnu/packages/textutils.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 0df8399ffd7..96bb7be468c 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -1038,7 +1038,8 @@ indentation. ;; The configure script is not from autotools and does not accept ;; ‘--style’ options. There is no proper error handling. (lambda* (#:key outputs #:allow-other-keys) - (invoke "./configure")))))) + (invoke "./configure" + (string-append "CXX=" ,(cxx-for-target)))))))) (home-page "https://github.com/grobian/html2text") (synopsis "HTML to plain text converter") (description -- cgit v1.3 From e009b8d7126531a2983701413c5b97e620e495e4 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 27 Apr 2021 14:01:23 +0200 Subject: gnu: html2text: Add informative BSD-4 licence. * gnu/packages/textutils.scm (html2text)[license]: Add bsd-4. --- gnu/packages/textutils.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 96bb7be468c..e7968c31858 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -1045,7 +1045,8 @@ indentation. (description "@code{html2text} is a command line utility that converts HTML documents into plain text.") - (license license:gpl2+)))) + (license (list license:bsd-4 ; cmp_nocase.cpp & sgml.h + license:gpl2+))))) ; everything else (define-public odt2txt (package -- cgit v1.3 From 1059d1570b7078e6a83e067577b42ed24ee25b55 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 28 Apr 2021 20:33:44 +0200 Subject: gnu: ustr: Cross-compile. Also fix . * gnu/packages/text-utils.scm (ustr)[arguments]: Use CC-FOR-TARGET. Add a new 'fix-cross-compilation phase. --- gnu/packages/textutils.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index e7968c31858..b04abbd13c2 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -315,7 +315,7 @@ input bits thoroughly but are not suitable for cryptography.") (build-system gnu-build-system) (arguments `(#:make-flags - (list "CC=gcc" + (list (string-append "CC=" ,(cc-for-target)) "HIDE=" ;; Override "/sbin/ldconfig" with "echo" because we don't need ;; "ldconfig". @@ -324,6 +324,18 @@ input bits thoroughly but are not suitable for cryptography.") "all-shared") #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-cross-compilation + ;; The Makefile contains more insults than cross-compilation support. + ;; It poorly reinvents autotools by compiling C programmes with $CC, + ;; then tries to run them during the build. Hard-code the results. + (lambda _ + (substitute* "Makefile" + (("\\./autoconf_64b") + ,(if (target-64bit? (or (%current-target-system) + (%current-system))) + "echo 1" + "echo 0")) + (("\\./autoconf_vsnprintf") "echo 1")))) (add-after 'unpack 'disable-check-for-stdint (lambda _ ;; Of course we have stdint.h, just not in /usr/include -- cgit v1.3 From 7f9888516f783e07aa679332f4a58a4df2c2dba5 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 28 Apr 2021 21:39:13 +0200 Subject: gnu: ustr: Don't use vsnprintf. This follows up on 1059d1570b7078e6a83e067577b42ed24ee25b55, which caused new tests failures on non-cross builds. * gnu/packages/textutils.scm (ustr)[arguments]: Return "0" for ./autoconf_vsnprintf. --- gnu/packages/textutils.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index b04abbd13c2..a51d689134f 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -335,7 +335,7 @@ input bits thoroughly but are not suitable for cryptography.") (%current-system))) "echo 1" "echo 0")) - (("\\./autoconf_vsnprintf") "echo 1")))) + (("\\./autoconf_vsnprintf") "echo 0")))) (add-after 'unpack 'disable-check-for-stdint (lambda _ ;; Of course we have stdint.h, just not in /usr/include -- cgit v1.3 From ad35e2f8eca260a83fe029396d1cc5da5eefaf79 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 29 Apr 2021 00:31:50 +0200 Subject: gnu: ustr: Omit static libraries. * gnu/packages/textutils.scm (ustr)[arguments]: Add a new 'omit-static-libraries phase. --- gnu/packages/textutils.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gnu/packages/textutils.scm') diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index a51d689134f..ab343737054 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -336,6 +336,11 @@ input bits thoroughly but are not suitable for cryptography.") "echo 1" "echo 0")) (("\\./autoconf_vsnprintf") "echo 0")))) + (add-after 'unpack 'omit-static-libraries + ;; These are needed to build & test ustr, but don't install them. + (lambda _ + (substitute* "Makefile" + ((".*install.*LIB_STATIC.*") "")))) (add-after 'unpack 'disable-check-for-stdint (lambda _ ;; Of course we have stdint.h, just not in /usr/include -- cgit v1.3