aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2020-05-16 17:24:16 +0800
committer宋文武 <iyzsong@member.fsf.org>2020-05-16 17:24:16 +0800
commita23cd8d9c3bb9b1e7e5fa4558b9d2ef116b193e7 (patch)
tree1d0a3a3c65384fe059d9d2f87849d50c19702dbc /gnu
parent8da0f5048f52d0a461b12e4f4b1c598812eca0b2 (diff)
downloadpatches-a23cd8d9c3bb9b1e7e5fa4558b9d2ef116b193e7.tar
patches-a23cd8d9c3bb9b1e7e5fa4558b9d2ef116b193e7.tar.gz
gnu: Add python-pytidylib.
* gnu/packages/python-xyz.scm (python-pytidylib, python2-pytidylib): New variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 657ebabe93..c26a766d64 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19862,3 +19862,36 @@ module. @code{cmd2} provides a wealth of features on top of @code{cmd} to
make your life easier and eliminates much of the boilerplate code which would
be necessary when using @code{cmd}.")
(license license:expat)))
+
+(define-public python-pytidylib
+ (package
+ (name "python-pytidylib")
+ (version "0.3.2")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "pytidylib" version))
+ (sha256
+ (base32
+ "1wqa9dv5d7swka14rnky862hc7dgk2g3dhlrz57hdn3hb7bwic92"))))
+ (build-system python-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'qualify-libtidy
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((libtidy (string-append (assoc-ref inputs "tidy")
+ "/lib/libtidy.so")))
+ (substitute* "tidylib/tidy.py"
+ (("ctypes\\.util\\.find_library\\('tidy'\\)")
+ (format #f "'~a'" libtidy)))
+ #t))))))
+ (inputs `(("tidy" ,tidy)))
+ (home-page "https://github.com/countergram/pytidylib")
+ (synopsis "Python wrapper for HTML Tidy library")
+ (description
+ "PyTidyLib is a Python package that wraps the HTML Tidy library. This
+allows you, from Python code, to “fix” invalid (X)HTML markup.")
+ (license license:expat)))
+
+(define-public python2-pytidylib
+ (package-with-python2 python-pytidylib))