all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable.
Date: Thu, 15 Oct 2015 22:48:06 +0300	[thread overview]
Message-ID: <877fmnkj61.fsf@gmail.com> (raw)

[-- 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


             reply	other threads:[~2015-10-15 19:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 19:48 Alex Kost [this message]
2015-10-16  8:20 ` [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable 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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fmnkj61.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.