unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable.
@ 2015-10-15 19:48 Alex Kost
  2015-10-16  8:20 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-10-15 19:48 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

What about modifying ‘guix’ package to make various "View graph" actions
in "M-x guix" work by default (without installing graphviz)?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-guix-Set-guix-dot-program-emacs-variable.patch --]
[-- Type: text/x-patch, Size: 2840 bytes --]

From fb077a89b89bb255b464fa21d4f1e715f86239bf Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Thu, 15 Oct 2015 20:57:20 +0300
Subject: [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable.

* gnu/packages/package-management.scm (guix-devel)[arguments]: Add
  'patch-exec-paths' phase to set 'guix-dot-program' emacs variable.
---
 gnu/packages/package-management.scm | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 8fbe5b3..08a72c5 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -189,18 +189,31 @@ the Nix package manager.")
                   "1zgjj5knpz3qbbqdjm4yh436bzfgasc6p0k3xnx58hfjd88mdsga"))
                 (file-name (string-append "guix-" version "-checkout"))))
       (arguments
-       (substitute-keyword-arguments (package-arguments guix-0.8.3)
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after
-              'unpack 'bootstrap
-              (lambda _
-                ;; Make sure 'msgmerge' can modify the PO files.
-                (for-each (lambda (po)
-                            (chmod po #o666))
-                          (find-files "." "\\.po$"))
-
-                (zero? (system* "sh" "bootstrap"))))))))
+       (let ((args `(#:modules ((guix build gnu-build-system)
+                                (guix build utils)
+                                (guix build emacs-utils))
+                     #:imported-modules (,@%gnu-build-system-modules
+                                         (guix build emacs-utils))
+                     ,@(package-arguments guix-0.8.3))))
+         (substitute-keyword-arguments args
+           ((#:phases phases)
+            `(modify-phases ,phases
+               (add-after 'unpack 'bootstrap
+                 (lambda _
+                   ;; Make sure 'msgmerge' can modify the PO files.
+                   (for-each (lambda (po)
+                               (chmod po #o666))
+                             (find-files "." "\\.po$"))
+                   (zero? (system* "sh" "bootstrap"))))
+               (add-before 'build 'patch-exec-paths
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((graphviz (assoc-ref inputs "graphviz"))
+                         (file "emacs/guix-external.el"))
+                     (chmod file #o644)
+                     (emacs-substitute-variables file
+                       ("guix-dot-program" (string-append graphviz
+                                                          "/bin/dot")))
+                     #t))))))))
       (native-inputs
        `(("autoconf" ,(autoconf-wrapper))
          ("automake" ,automake)
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-19 15:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 19:48 [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable Alex Kost
2015-10-16  8:20 ` Ludovic Courtès
2015-10-16 18:21   ` Alex Kost
2015-10-17 13:34     ` Ludovic Courtès
2015-10-17 15:46       ` Alex Kost
2015-10-18 16:50         ` Ludovic Courtès
2015-10-19 14:49           ` Alex Kost
2015-10-19 15:41             ` Ludovic Courtès

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).