From patchwork Mon Apr 15 20:02:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Artyom V. Poptsov" X-Patchwork-Id: 63076 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 33C2827BBEB; Mon, 15 Apr 2024 21:04:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 004D927BBE9 for ; Mon, 15 Apr 2024 21:04:02 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwSYS-0001c9-KL; Mon, 15 Apr 2024 16:03:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwSYS-0001c1-3k for guix-patches@gnu.org; Mon, 15 Apr 2024 16:03:52 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwSYR-0005rY-RK for guix-patches@gnu.org; Mon, 15 Apr 2024 16:03:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwSYd-0002bt-Kp for guix-patches@gnu.org; Mon, 15 Apr 2024 16:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70406] [PATCH] gnu: xdot: Update to 1.3. Resent-From: "Artyom V. Poptsov" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Apr 2024 20:04:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70406 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70406@debbugs.gnu.org Cc: "Artyom V. Poptsov" X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17132113889474 (code B ref -1); Mon, 15 Apr 2024 20:04:03 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2024 20:03:08 +0000 Received: from localhost ([127.0.0.1]:39325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwSXh-0002SM-GX for submit@debbugs.gnu.org; Mon, 15 Apr 2024 16:03:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwSXe-0002R2-4l for submit@debbugs.gnu.org; Mon, 15 Apr 2024 16:03:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwSXB-0008MF-T4 for guix-patches@gnu.org; Mon, 15 Apr 2024 16:02:39 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwSX4-0005kM-J6 for guix-patches@gnu.org; Mon, 15 Apr 2024 16:02:28 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5171a529224so4593459e87.0 for ; Mon, 15 Apr 2024 13:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713211344; x=1713816144; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8ZVKIl8PUBpAoJyzewwPPn82xrVnSg56kBKmD8cgd7c=; b=BNfWz1KfBEDErH1JPDXDp9m8u4p9JiB4s8d1Udbuh+s8sFM9eodhEw/A2jhza/L2wc oU+4UTUt6B5AK8IvCMKI2Fe231UGdsL1R41MlNZxyYRjd7rwmYSOMR8EgomVNNMSlNPB qsJMprdCFEfejQXTmOuIuEI0HIdvtBU+TyyHrFhuQK1D0BaQJCBTb/EWCbCvFDLgk6Gj eoxLqvPGxypzDwt1s8hIJSzv5FtDWsXM9YhvhK559pxc5xnVKDYV/3eU6AtqWMfF9k7R /vy6owzuJIgf9suLAuOl6r9kDVIjGC2zRVXGqOU4WMW5bXg6j3HRrdIZRIEoWvpNgwRG 2CBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713211344; x=1713816144; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8ZVKIl8PUBpAoJyzewwPPn82xrVnSg56kBKmD8cgd7c=; b=fKbsTXUacz6n1vxSH5DWk4kvQ74n2gfOvNrdm5VLCYs+49gslTv8FT/gxlr8qQdhvC KR0Vm1yhW285IunZKzIBprS5977HxJRJeqBS2xDlcbex+NI2PdtQONhIp7frYEXD/LRX 4V2ko3UA+x+rqedueIrZgeQijN+raYNZgSAIuU7LHUaByeuStMo32nfGlfY20RPS4D3x gN73DEiIIGwZdmG1wibZ+/NzrMMFhqgGb3W9iO01YpiGVe+rU+ZWnwxVOHQLX9t9x1T6 tdPESvuPaLufAxF0IyHWF6r6QXOo96fGkiTFTcNfwjFvOG8JttAN93UH5UrlSqqrQ18b 9NNA== X-Gm-Message-State: AOJu0YzYJt2Df/JJE0mVNHwdf7f6W8HZZdq58Jpvp6OJdqUvZ+DtraRr DPAuKKE7jDQrKSRauUfDIpYMJcWYqoqZj4DDtWbZmII36dF1wyheuuq0jQ== X-Google-Smtp-Source: AGHT+IGRdO4I+vT2OvxdojdWN22KyPy3jIWn7vmCjdFVzvTLyK2Z+str41CV8D9LRw8ej5ngUSGp0A== X-Received: by 2002:a05:651c:1994:b0:2d8:394c:6e7e with SMTP id bx20-20020a05651c199400b002d8394c6e7emr7234850ljb.15.1713211343988; Mon, 15 Apr 2024 13:02:23 -0700 (PDT) Received: from elephant.. ([5.166.209.213]) by smtp.gmail.com with ESMTPSA id f15-20020a2e6a0f000000b002d868f2939bsm1298551ljc.103.2024.04.15.13.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 13:02:23 -0700 (PDT) From: "Artyom V. Poptsov" Date: Mon, 15 Apr 2024 23:02:09 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=poptsov.artyom@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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(-) base-commit: a54e9abdfb551a08beb41c66fbb2c7f7e970250a 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 ;;; Copyright © 2021 Justin Veilleux ;;; Copyright © 2021 Denis 'GNUtoo' Carikli +;;; Copyright © 2024 Artyom V. Poptsov ;;; ;;; 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.")