me
/
guix
Archived
1
0
Fork 0

gnu: xdot: Update to 1.3.

* 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
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Artyom V. Poptsov 2024-04-15 23:02:09 +03:00 committed by Ludovic Courtès
parent 2aeb9faa42
commit a47fe0fdc4
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 64 additions and 30 deletions

View File

@ -13,6 +13,7 @@
;;; Copyright © 2021 Giacomo Leidi <goodoldpaul@autistici.org> ;;; Copyright © 2021 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li> ;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
;;; Copyright © 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> ;;; Copyright © 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -40,11 +41,13 @@
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison) #:use-module (gnu packages bison)
#:use-module (gnu packages check) #:use-module (gnu packages check)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages fontutils) #:use-module (gnu packages fontutils)
#:use-module (gnu packages gd) #:use-module (gnu packages gd)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib) #:use-module (gnu packages glib)
#:use-module (gnu packages gnome) #:use-module (gnu packages gnome)
#:use-module (gnu packages gtk) #:use-module (gnu packages gtk)
@ -58,6 +61,7 @@
#:use-module (gnu packages sphinx) #:use-module (gnu packages sphinx)
#:use-module (gnu packages swig) #:use-module (gnu packages swig)
#:use-module (gnu packages tex) #:use-module (gnu packages tex)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages xml) #:use-module (gnu packages xml)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module ((guix licenses) #:prefix license:)) #:use-module ((guix licenses) #:prefix license:))
@ -273,42 +277,72 @@ Graphviz and LaTeX.")
(define-public xdot (define-public xdot
(package (package
(name "xdot") (name "xdot")
(version "1.1") (version "1.3")
(source (source
(origin (origin
(method url-fetch) ;; PyPI tarball is missing some test files.
(uri (pypi-uri "xdot" version)) (method git-fetch)
(sha256 (uri (git-reference
(base32 (url "https://github.com/jrfonseca/xdot.py/")
"0cr4rh7dz4dfzyxrk5pzhm0d15gkrgkfp3i5lw178xy81pc56p71")))) (commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "00j147183yf6wp1rnlp26vvsnsz5v56qgffdpd2ijkpvphvyyiyi"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases #~(modify-phases %standard-phases
;; We wrap xdot, so that we don't propagate gtk+ and graphviz (add-before 'build 'start-xserver
(add-after 'install 'wrap (lambda* (#:key inputs native-inputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys) (let ((Xvfb (search-input-file (or native-inputs inputs)
(wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot") "/bin/Xvfb")))
`("GI_TYPELIB_PATH" ":" prefix (system (format #f "~a :1 -screen 0 640x480x24 &"
(,(string-append Xvfb))
(assoc-ref inputs "gtk+") "/lib/girepository-1.0" (setenv "DISPLAY" ":1"))))
":" (assoc-ref inputs "pango") "/lib/girepository-1.0" (add-before 'check 'set-test-environment
":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0" (lambda* (#:key inputs #:allow-other-keys)
":" (assoc-ref inputs "at-spi2-core") "/lib/girepository-1.0" (let ((lib (search-input-file inputs
":" (assoc-ref inputs "harfbuzz") "/lib/girepository-1.0"))) "lib/libvulkan.so.1")))
`("PATH" ":" prefix (setenv "XDG_RUNTIME_DIR"
(,(dirname (search-input-file inputs "bin/dot")))))))))) (getcwd))
(inputs (setenv "LIBGL_ALWAYS_SOFTWARE" "1")
(list at-spi2-core (format (current-error-port) "~a~%"
(librsvg-for-system) (assoc-ref inputs "gtk+"))
harfbuzz (setenv "LD_LIBRARY_PATH"
graphviz (dirname lib)))))
gtk+ ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
python-pycairo (add-after 'install 'wrap
python-pygobject)) (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/") (home-page "https://pypi.org/project/xdot/")
(synopsis "Interactive viewer for graphviz dot files") (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 @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 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.") can be used either as a standalone application, or as a Python library.")