aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-external.el
blob: f571ffd84506f01077c87fc030dbd355eb18973b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;;; guix-external.el --- External programs  -*- lexical-binding: t -*-

;; Copyright © 2015 Alex Kost <alezost@gmail.com>

;; This file is part of GNU Guix.

;; GNU Guix is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Guix is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This file provides auxiliary code for running external programs.

;;; Code:

(require 'cl-lib)
(require 'guix-config)

(defgroup guix-external nil
  "Settings for external programs."
  :group 'guix)

(defcustom guix-guile-program guix-config-guile-program
  "Name of the 'guile' executable used for Guix REPL.
May be either a string (the name of the executable) or a list of
strings of the form:

  (NAME . ARGS)

Where ARGS is a list of arguments to the guile program."
  :type 'string
  :group 'guix-external)

(defcustom guix-dot-program
  (if (file-name-absolute-p guix-config-dot-program)
      guix-config-dot-program
    (executable-find "dot"))
  "Name of the 'dot' executable."
  :type 'string
  :group 'guix-external)

(defcustom guix-dot-default-arguments
  '("-Tpng")
  "Default arguments for 'dot' program."
  :type '(repeat string)
  :group 'guix-external)

(defcustom guix-dot-file-name-function #'guix-png-file-name
  "Function used to define a file name of a temporary 'dot' file.
The function is called without arguments."
  :type '(choice (function-item guix-png-file-name)
                 (function :tag "Other function"))
  :group 'guix-external)

(defun guix-dot-arguments (output-file &rest args)
  "Return a list of dot arguments for writing a graph into OUTPUT-FILE.
If ARGS is nil, use `guix-dot-default-arguments'."
  (or guix-dot-program
      (error (concat "Couldn't find 'dot'.\n"
                     "Set guix-dot-program to a proper value")))
  (cl-list* guix-dot-program
            (concat "-o" output-file)
            (or args guix-dot-default-arguments)))

(defun guix-dot-file-name ()
  "Call `guix-dot-file-name-function'."
  (funcall guix-dot-file-name-function))

(defun guix-png-file-name ()
  "Return '.png' file name in the `temporary-file-directory'."
  (concat (make-temp-name
           (concat (file-name-as-directory temporary-file-directory)
                   "guix-emacs-graph-"))
          ".png"))

(provide 'guix-external)

;;; guix-external.el ends here
texi. * po/doc/guix-manual.es.po: New file. * po/doc/local.mk: Add guix-manual.es.po. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Miguel Ángel Arruga Vivas 2019-03-14Merge branch 'staging' into core-updatesMarius Bakke 2019-03-13doc: Document the graphical installer some more....* doc/guix.texi (Preparing for Installation): Rewrite to specify the two installation modes. (Guided Graphical Installation): New node. (Manual Installation): New node, with the former sections. (After System Installation): New node. * doc/images/installer-network.png, doc/images/installer-partitions.png, doc/images/installer-resume.png: New files. * doc/local.mk (dist_infoimage_DATA): Add them. Ludovic Courtès 2018-12-11Merge branch 'master' into core-updatesMarius Bakke 2018-11-01doc: Add German translation....* doc/contributing.de.texi: New file. * doc/guix.de.texi: New file * doc/local.mk (TRANSLATED_INFO): Add them. (info_TEXINFOS): Add guix.de.texi. * po/doc/guix-manual.de.po: New file. * po/doc/local.mk (EXTRA_DIST): Add it. * doc/guix.texi: Document the German translation. Julien Lepiller 2018-09-23doc: Describe the Reduced Binary Seed bootstrap....* doc/guix.texi (Reduced Binary Seed Bootstrap): New node. * doc/images/gcc-mesboot-bag-graph.dot: New file. * doc/local.mk (DOT_FILES): Add it. Jan Nieuwenhuizen 2018-04-29build: Use only one domain for guix-manual....* Makefile.am (assert-no-store-file-names): Exclude guix-manual. * po/doc/guix.pot po/doc/contributing.pot: Merge into... * po/doc/guix-manual.pot: ...this. * po/doc/guix.fr.po po/doc/contributing.fr.po: Merge into... * po/doc/guix-manual.fr.po: ...this. * doc/local.mk: Replace old file names. * po/doc/local.mk: Replace old file names. Julien Lepiller 2018-04-25build: Add silent rules for Texinfo xref translation....* Makefile.am (AM_V_POXREF, AM_V_POXREF_, AM_V_POXREF_0): New variables. * doc/local.mk ($(srcdir)/%D%/guix.%.texi) ($(srcdir)/%D%/contributing.%.texi): Use $(AM_V_POXREF). Ludovic Courtès 2018-04-19gnu: doc: Add French documentation....* doc/contributing.fr.texi: New file. * doc/guix.fr.texi: New file. * doc/local.mk (TRANSLATED_INFO): Add them. (info_TEXINFOS): Add guix.fr.texi. * po/doc/contributing.fr.po: New file. * po/doc/guix.fr.po: New file. * po/doc/local.mk (EXTRA_DIST): Add them. Julien Lepiller 2018-04-19gnu: doc: Allow documentation to be translated....* po/doc/contributing.pot: New file. * po/doc/guix.pot: New file. * po/doc/local.mk: New file. * Makefile.am: Include it. Add gettext command. Add silent rules for po4a. * configure.ac: Look for po4a-translate and po4a-updatepo. * doc/local.mk: Add rules to generate translated texi files. (TRANSLATED_INFO): New variable. (BUILT_SOURCES, EXTRA_DIST, MAINTAINERCLEANFILES): Add it. * .gitignore: Add generated files. Julien Lepiller 2018-01-20build: Declare “doc/guix.texi“ dependencies....Fixes <https://bugs.gnu.org/29727>. * doc/local.mk (%C%_guix_TEXINFOS): New variable containing files included by “doc/guix.texi”. (EXTRA_DIST): Remove ‘.texi’ files. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Mathieu Lirzin