From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
To: 70406@debbugs.gnu.org
Cc: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Subject: [bug#70406] [PATCH] gnu: xdot: Update to 1.3.
Date: Mon, 15 Apr 2024 23:02:09 +0300 [thread overview]
Message-ID: <d7e8ee71b29fbb831d8f03e6ad9b74d70e5b5491.1713211329.git.poptsov.artyom@gmail.com> (raw)
* gnu/packages/graphviz.scm (xdot): Update to 1.3.
[source]: Download the sources from GitHub as the PyPI tarbal is missing
some test files.
[arguments]: Use Gexps. Add "start-xserver" and "set-test-environment"
to setup test environment properly. Simplify "wrap" phase. Replace "check"
phase to run "test.py".
[native-inputs]: Add "gobject-introspection" and "xorg-server-for-tests".
[inputs]: Add "bash-minimal", "mesa", "mesa-opencl", "python-numpy"
and "vulkan-loader".
Change-Id: I7a68e9f5c1b66a6539b83623a457e16edacff012
---
gnu/packages/graphviz.scm | 94 ++++++++++++++++++++++++++-------------
1 file changed, 64 insertions(+), 30 deletions(-)
diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index c5507e036c..0fc5c6024e 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2021 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
;;; Copyright © 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -40,11 +41,13 @@ (define-module (gnu packages graphviz)
#:use-module (guix gexp)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gd)
+ #:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gtk)
@@ -58,6 +61,7 @@ (define-module (gnu packages graphviz)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages swig)
#:use-module (gnu packages tex)
+ #:use-module (gnu packages vulkan)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module ((guix licenses) #:prefix license:))
@@ -273,42 +277,72 @@ (define-public gts
(define-public xdot
(package
(name "xdot")
- (version "1.1")
+ (version "1.3")
(source
(origin
- (method url-fetch)
- (uri (pypi-uri "xdot" version))
- (sha256
- (base32
- "0cr4rh7dz4dfzyxrk5pzhm0d15gkrgkfp3i5lw178xy81pc56p71"))))
+ ;; PyPI tarball is missing some test files.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/jrfonseca/xdot.py/")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "00j147183yf6wp1rnlp26vvsnsz5v56qgffdpd2ijkpvphvyyiyi"))))
(build-system python-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
- (add-after 'install 'wrap
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot")
- `("GI_TYPELIB_PATH" ":" prefix
- (,(string-append
- (assoc-ref inputs "gtk+") "/lib/girepository-1.0"
- ":" (assoc-ref inputs "pango") "/lib/girepository-1.0"
- ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
- ":" (assoc-ref inputs "at-spi2-core") "/lib/girepository-1.0"
- ":" (assoc-ref inputs "harfbuzz") "/lib/girepository-1.0")))
- `("PATH" ":" prefix
- (,(dirname (search-input-file inputs "bin/dot"))))))))))
- (inputs
- (list at-spi2-core
- (librsvg-for-system)
- harfbuzz
- graphviz
- gtk+
- python-pycairo
- python-pygobject))
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'build 'start-xserver
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (let ((Xvfb (search-input-file (or native-inputs inputs)
+ "/bin/Xvfb")))
+ (system (format #f "~a :1 -screen 0 640x480x24 &"
+ Xvfb))
+ (setenv "DISPLAY" ":1"))))
+ (add-before 'check 'set-test-environment
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((lib (search-input-file inputs
+ "lib/libvulkan.so.1")))
+ (setenv "XDG_RUNTIME_DIR"
+ (getcwd))
+ (setenv "LIBGL_ALWAYS_SOFTWARE" "1")
+ (format (current-error-port) "~a~%"
+ (assoc-ref inputs "gtk+"))
+ (setenv "LD_LIBRARY_PATH"
+ (dirname lib)))))
+ ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
+ (python-path (getenv "GUIX_PYTHONPATH")))
+ (wrap-program (string-append out "/bin/xdot")
+ `("GI_TYPELIB_PATH" ":" prefix
+ (,gi-typelib-path))
+ `("GUIX_PYTHONPATH" ":" prefix
+ (,python-path))))))
+ (replace 'check
+ (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (invoke "python" "test.py")))))))
+ (native-inputs (list gobject-introspection xorg-server-for-tests))
+ (inputs (list at-spi2-core
+ bash-minimal
+ (librsvg-for-system)
+ mesa
+ mesa-opencl
+ harfbuzz
+ graphviz
+ gtk+
+ python-numpy
+ python-pycairo
+ python-pygobject
+ vulkan-loader))
(home-page "https://pypi.org/project/xdot/")
(synopsis "Interactive viewer for graphviz dot files")
- (description "Xdot is an interactive viewer for graphs written in
+ (description
+ "Xdot is an interactive viewer for graphs written in
@code{graphviz}’s dot language. Internally, it uses the xdot output format as
an intermediate format, and @code{gtk} and @code{cairo} for rendering. Xdot
can be used either as a standalone application, or as a Python library.")
base-commit: a54e9abdfb551a08beb41c66fbb2c7f7e970250a
--
2.41.0
next reply other threads:[~2024-04-15 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 20:02 Artyom V. Poptsov [this message]
2024-05-01 20:55 ` bug#70406: [PATCH] gnu: xdot: Update to 1.3 Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7e8ee71b29fbb831d8f03e6ad9b74d70e5b5491.1713211329.git.poptsov.artyom@gmail.com \
--to=poptsov.artyom@gmail.com \
--cc=70406@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).