[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
199/233: gnu: weasyprint: Update to 54.3.
From: |
guix-commits |
Subject: |
199/233: gnu: weasyprint: Update to 54.3. |
Date: |
Sun, 24 Apr 2022 23:40:05 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit ef2de75206369b5f7e534218071d453fa3b0620e
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 8d8e9e0ac1..b95ba7575b 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)
@@ -1478,77 +1479,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
- 145/233: gnu: python-sqlalchemy: Run tests in parallel via xdist., (continued)
- 145/233: gnu: python-sqlalchemy: Run tests in parallel via xdist., guix-commits, 2022/04/24
- 146/233: gnu: python-sqlalchemy: Update to 1.4.35., guix-commits, 2022/04/24
- 153/233: gnu: Add python-jupyterlab-server., guix-commits, 2022/04/24
- 158/233: gnu: python-pandas: Build and run tests in parallel., guix-commits, 2022/04/24
- 162/233: gnu: python-umap-learn: Update to 0.5.3., guix-commits, 2022/04/24
- 167/233: gnu: python-jupyter-protocol: Update to 0.2.0., guix-commits, 2022/04/24
- 170/233: gnu: python-types-dataclasses: Fix typo., guix-commits, 2022/04/24
- 177/233: gnu: python-can: Update to 4.0.0., guix-commits, 2022/04/24
- 178/233: gnu: python-amqp: Update to 5.1.1 and enable tests., guix-commits, 2022/04/24
- 187/233: gnu: Add python-pyyaml-env-tag., guix-commits, 2022/04/24
- 199/233: gnu: weasyprint: Update to 54.3.,
guix-commits <=
- 203/233: gnu: setzer: Add python-wrapper to fix build., guix-commits, 2022/04/24
- 208/233: gnu: python-flask-wtf: Update to 1.0.1., guix-commits, 2022/04/24
- 209/233: gnu: python-flask-login: Update to 0.6.0., guix-commits, 2022/04/24
- 215/233: gnu: python-pydata-sphinx-theme: Update to 0.7.2., guix-commits, 2022/04/24
- 216/233: gnu: python-sphinx-copybutton: Update to 0.5.0., guix-commits, 2022/04/24
- 218/233: gnu: python-sphinxcontrib-websupport: Update to 1.2.4., guix-commits, 2022/04/24
- 223/233: gnu: Add python-nptyping., guix-commits, 2022/04/24
- 226/233: gnu: python-sphinx-rtd-theme: Update to 1.0.0., guix-commits, 2022/04/24
- 229/233: gnu: python-pudb: Update to 2022.1.1 and rename from pudb., guix-commits, 2022/04/24
- 233/233: gnu: python-matplotlib-documentation: Fix build., guix-commits, 2022/04/24