[PATCH 0/3] Add 'graphviz-minimal' and have Guix depend on it

  • Done
  • quality assurance status badge
Details
One participant
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 20 May 2023 18:01
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
cover.1684598152.git.ludo@gnu.org
Hi!

patch set adds ‘graphviz-minimal’ and uses it in (guix self)
and as a dependency of the ‘guix’ package, thereby reducing
the closure of the development environment and also the
number of things that need to be built before we have ‘guix’.

Thoughts?

Ludo’.

Ludovic Courtès (3):
gnu: graphviz: Add "minimal" variant.
self: Build against "graphviz-minimal".
gnu: guix: Depend on 'graphviz-minimal'.

gnu/packages/graphviz.scm | 9 ++++++++-
gnu/packages/package-management.scm | 11 ++++++++++-
guix/self.scm | 11 +++++++++--
3 files changed, 27 insertions(+), 4 deletions(-)


base-commit: bac28a52cb7cbc42d7fabbce0e47028367e69a61
--
2.40.1
L
L
Ludovic Courtès wrote on 20 May 2023 18:11
[PATCH 2/3] self: Build against "graphviz-minimal".
(address . 63610@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
238c5c71317fffbb2c7b88387d62b7759201c3d8.1684598152.git.ludo@gnu.org
Reported by Andreas Enge <andreas@enge.fr>.

* guix/self.scm (%packages): Change "graphviz" to refer to
"graphviz-minimal". Add "font-ghostscript".
(info-manual): Define 'font-ghostscript'.
[build]: Set XDG_DATA_DIRS.
---
guix/self.scm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

Toggle diff (43 lines)
diff --git a/guix/self.scm b/guix/self.scm
index 74c953bd50..9e0aa82698 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;;
;;; This file is part of GNU Guix.
@@ -72,7 +72,8 @@ (define %packages
("gettext-minimal" . ,(ref 'gettext 'gettext-minimal))
("gcc-toolchain" . ,(ref 'commencement 'gcc-toolchain))
("glibc-utf8-locales" . ,(ref 'base 'glibc-utf8-locales))
- ("graphviz" . ,(ref 'graphviz 'graphviz))
+ ("graphviz" . ,(ref 'graphviz 'graphviz-minimal))
+ ("font-ghostscript" . ,(ref 'ghostscript 'font-ghostscript))
("texinfo" . ,(ref 'texinfo 'texinfo)))))
(define (specification->package name)
@@ -404,6 +405,9 @@ (define (info-manual source)
(define graphviz
(specification->package "graphviz"))
+ (define font-ghostscript
+ (specification->package "font-ghostscript"))
+
(define glibc-utf8-locales
(specification->package "glibc-utf8-locales"))
@@ -444,6 +448,9 @@ (define (info-manual source)
;; Build graphs.
(mkdir-p (string-append #$output "/images"))
+
+ (setenv "XDG_DATA_DIRS" ;fonts needed by 'dot'
+ #+(file-append font-ghostscript "/share"))
(for-each (lambda (dot-file)
(invoke #+(file-append graphviz "/bin/dot")
"-Tpng" "-Gratio=.9" "-Gnodesep=.005"
--
2.40.1
L
L
Ludovic Courtès wrote on 20 May 2023 18:11
[PATCH 1/3] gnu: graphviz: Add "minimal" variant.
(address . 63610@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
aafb612cadecd2f960dac66fd776108eca892bb3.1684598152.git.ludo@gnu.org
* gnu/packages/graphviz.scm (graphviz-minimal): New variable.
---
gnu/packages/graphviz.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index 26ee96afd4..30dd6d3405 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
;;; Copyright © 2017, 2018, 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
@@ -124,6 +124,13 @@ (define-public graphviz
'((release-monitoring-url . "https://graphviz.org/download/source/")))
(license license:epl1.0)))
+(define-public graphviz-minimal
+ (package/inherit graphviz
+ (name "graphviz-minimal")
+ (inputs (modify-inputs (package-inputs graphviz)
+ (delete "libxrender" "libx11" "pango" "libxaw")))
+ (synopsis "Graph visualization software (without X11 support)")))
+
(define-public python-graphviz
(package
(name "python-graphviz")
--
2.40.1
L
L
Ludovic Courtès wrote on 20 May 2023 18:11
[PATCH 3/3] gnu: guix: Depend on 'graphviz-minimal'.
(address . 63610@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
c42820d3d488ccfc4efa61b9d07cae65c73c7d8f.1684598152.git.ludo@gnu.org
* gnu/packages/package-management.scm (guix)[arguments]: Add
'set-font-path' phase.
[native-inputs]: Change GRAPHVIZ to GRAPHVIZ-MINIMAL. Add
FONT-GHOSTSCRIPT.
---
gnu/packages/package-management.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 67de4930ff..1da40f4cab 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -68,6 +68,7 @@ (define-module (gnu packages package-management)
#:use-module (gnu packages flex)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
+ #:use-module (gnu packages ghostscript)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gnupg)
@@ -273,6 +274,13 @@ (define-public guix
(("\"[^\"]*/bin//xz")
(string-append "\"" xz "/bin/xz")))))
#t))
+ (add-before 'build 'set-font-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Tell 'dot' where to look for fonts.
+ (setenv "XDG_DATA_DIRS"
+ (dirname
+ (search-input-directory inputs
+ "share/fonts")))))
(add-before 'check 'copy-bootstrap-guile
(lambda* (#:key system target inputs #:allow-other-keys)
;; Copy the bootstrap guile tarball in the store
@@ -431,7 +439,8 @@ (define-public guix
("automake" ,automake)
("gettext" ,gettext-minimal)
("texinfo" ,texinfo)
- ("graphviz" ,graphviz)
+ ("graphviz" ,graphviz-minimal)
+ ("font-ghostscript" ,font-ghostscript) ;fonts for 'dot'
("help2man" ,help2man)
("po4a" ,po4a)))
(inputs
--
2.40.1
L
L
Ludovic Courtès wrote on 24 May 2023 15:06
Re: bug#63610: [PATCH 0/3] Add 'graphviz-minimal' and have Guix depend on it
(address . 63610-done@debbugs.gnu.org)
87ilchop3q.fsf@gnu.org
Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (4 lines)
> gnu: graphviz: Add "minimal" variant.
> self: Build against "graphviz-minimal".
> gnu: guix: Depend on 'graphviz-minimal'.

Applied, with an additional change to remove “font-ghostscript” from the
inputs of ‘guix-daemon’.

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 63610@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 63610
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch