[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
199/242: gnu: weasyprint: Update to 54.3.
From: |
guix-commits |
Subject: |
199/242: gnu: weasyprint: Update to 54.3. |
Date: |
Thu, 12 May 2022 14:14:34 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit 84943a4e0ed49510c0f6ea49ed6bcff9e195b088
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed Apr 20 00:46:18 2022 -0400
gnu: weasyprint: Update to 54.3.
* gnu/packages/pdf.scm (weasyprint): Update to 54.3.
[source]: Update git URL.
[phases]: Use gexps.
{disable-linters}: Delete phase.
{register-dejavu-font}: Remove obsolete phase.
{patch-library-paths}: Adjust for code changes. Use search-input-file.
{check}: Streamline and use xdist.
{build, install}: Override to o a PEP 517 build.
[inputs]: Add harfbuzz.
[propagated-inputs]: Add python-fonttools-full, python-pillow and
python-pydyf.
[native-inputs]: Remove python-pytest-cov and python-pytest-runner.
Add ghostscript, python-flit-core, python-pypa-build, python-pytest and
python-pytest-xdist.
---
gnu/packages/pdf.scm | 101 +++++++++++++++++++++++++--------------------------
1 file changed, 50 insertions(+), 51 deletions(-)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index b791a2fc8b..db04f21242 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -88,6 +88,7 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-check)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
@@ -1480,77 +1481,75 @@ manipulating PDF documents from the command line. It
supports
(define-public weasyprint
(package
(name "weasyprint")
- (version "52.1")
+ (version "54.3")
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/FelixSchwarz/WeasyPrint")
+ (url "https://github.com/Kozea/WeasyPrint")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
- "0rcj9yah3bp6bbvkmny3w4csx4l5v49lc7mrk29g0x77qnwswjy7"))))
+ "0cn8gpgyic6pmrnhp0540nbgplpsd5aybi7k89anz6m1sshgjzgs"))))
(build-system python-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'patch-library-paths
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((fontconfig (assoc-ref inputs "fontconfig"))
- (glib (assoc-ref inputs "glib"))
- (pango (assoc-ref inputs "pango"))
- (pangoft2 (assoc-ref inputs "pangoft2")))
- (substitute* "weasyprint/fonts.py"
- (("'fontconfig'")
- (format #f "'~a/lib/libfontconfig.so'" fontconfig))
- (("'pangoft2-1.0'")
- (format #f "'~a/lib/libpangoft2-1.0.so'" pango)))
- (substitute* "weasyprint/text.py"
- (("'gobject-2.0'")
- (format #f "'~a/lib/libgobject-2.0.so'" glib))
- (("'pango-1.0'")
- (format #f "'~a/lib/libpango-1.0.so'" pango))
- (("'pangocairo-1.0'")
- (format #f "'~a/lib/libpangocairo-1.0.so'" pango)))
- #t)))
- (add-after 'unpack 'disable-linters
- ;; Their check fails; none of our business.
- (lambda _
- (substitute* "setup.cfg"
- ((".*pytest-flake8.*") "")
- ((".*pytest-isort.*") "")
- (("--flake8") "")
- (("--isort") ""))
- #t))
- (add-before 'check 'register-dejavu-font
- (lambda* (#:key inputs #:allow-other-keys)
- ;; TODO: fix FreeType so that fonts found in XDG_DATA_DIRS are
- ;; honored.
- (let* ((HOME "/tmp")
- (dejavu (assoc-ref inputs "font-dejavu"))
- (fonts-dir (string-append HOME "/.fonts")))
- (setenv "HOME" HOME)
- (mkdir-p fonts-dir)
- (symlink (string-append dejavu "/share/fonts/truetype")
- (string-append fonts-dir "/truetype"))
- (invoke "fc-cache" "-rv")))))))
- (inputs
- `(("fontconfig" ,fontconfig)
- ("glib" ,glib)
- ("pango" ,pango)))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-library-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "weasyprint/text/ffi.py"
+ (("'gobject-2.0-0'")
+ (format #f "~s"
+ (search-input-file inputs "lib/libgobject-2.0.so")))
+ (("'pango-1.0-0'")
+ (format #f "~s"
+ (search-input-file inputs "lib/libpango-1.0.so")))
+ (("'harfbuzz'")
+ (format #f "~s"
+ (search-input-file inputs "lib/libharfbuzz.so")))
+ (("'fontconfig-1'")
+ (format #f "~s"
+ (search-input-file inputs "lib/libfontconfig.so")))
+ (("'pangoft2-1.0-0'")
+ (format #f "~s"
+ (search-input-file inputs
+ "lib/libpangoft2-1.0.so"))))))
+ ;; XXX: PEP 517 manual build copied from python-isort.
+ (replace 'build
+ (lambda _
+ (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv" "-c" "/dev/null"
+ "-n" (number->string (parallel-job-count))))))
+ (replace 'install
+ (lambda _
+ (let ((whl (car (find-files "dist" "\\.whl$"))))
+ (invoke "pip" "--no-cache-dir" "--no-input"
+ "install" "--no-deps" "--prefix" #$output whl)))))))
+ (inputs (list fontconfig glib harfbuzz pango))
(propagated-inputs
(list gdk-pixbuf
python-cairocffi
python-cairosvg
python-cffi
python-cssselect2
+ python-fonttools-full
python-html5lib
+ python-pillow
+ python-pydyf
python-pyphen
python-tinycss2))
(native-inputs
- (list font-dejavu ;tests depend on it
- python-pytest-cov python-pytest-runner))
+ (list font-dejavu ;tests depend on it
+ ghostscript
+ python-flit-core
+ python-pypa-build
+ python-pytest
+ python-pytest-xdist))
(home-page "https://weasyprint.org/")
(synopsis "Document factory for creating PDF files from HTML")
(description "WeasyPrint helps web developers to create PDF documents. It
- 166/242: gnu: python-sparqlkernel: Use gexps and fix inputs., (continued)
- 166/242: gnu: python-sparqlkernel: Use gexps and fix inputs., guix-commits, 2022/05/12
- 169/242: gnu: xeus: Update to 2.4.1., guix-commits, 2022/05/12
- 173/242: gnu: mbed-tools: Update to 7.53.0 and relax click version requirement., guix-commits, 2022/05/12
- 184/242: gnu: sshoot: Update to 1.5.1., guix-commits, 2022/05/12
- 182/242: gnu: python-bitstruct: Update to 8.14.0., guix-commits, 2022/05/12
- 181/242: gnu: Add python-argparse-addons., guix-commits, 2022/05/12
- 196/242: gnu: python-miio: Update to 0.5.11., guix-commits, 2022/05/12
- 177/242: gnu: python-can: Update to 4.0.0., guix-commits, 2022/05/12
- 189/242: gnu: Add python-mdx-gh-links., guix-commits, 2022/05/12
- 190/242: gnu: python-mkdocs: Update to 1.3.0., guix-commits, 2022/05/12
- 199/242: gnu: weasyprint: Update to 54.3.,
guix-commits <=
- 211/242: gnu: python2-sqlalchemy: Skip a failing test., guix-commits, 2022/05/12
- 217/242: gnu: python-sphinx-click: Update to 4.0.3 and enable tests., guix-commits, 2022/05/12
- 224/242: gnu: python-sphinx-autodoc-typehints: Update to 1.18.1., guix-commits, 2022/05/12
- 222/242: gnu: Add python-beartype., guix-commits, 2022/05/12
- 225/242: gnu: python-sphinxext-opengraph: Update to 0.6.3., guix-commits, 2022/05/12
- 226/242: gnu: python-sphinx-rtd-theme: Update to 1.0.0., guix-commits, 2022/05/12
- 57/242: gnu: Add python-pip-run., guix-commits, 2022/05/12
- 10/242: gnu: python-ipython: Update to 8.2.0 [fixes CVE-2022-21699]., guix-commits, 2022/05/12
- 19/242: gnu: Add python-pcpp., guix-commits, 2022/05/12
- 36/242: gnu: Add python-types-toml., guix-commits, 2022/05/12