This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmelpa-overrides
137 lines (129 loc) · 5.64 KB
/
melpa-overrides
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
(use-modules (emacs build-system melpa)
((gnu packages emacs-xyz) #:prefix e/)
(gnu packages gnupg)
(gnu packages sqlite)
(guix build-system gnu)
(guix packages)
(guix utils)
(srfi srfi-1))
(define-syntax define-override
(syntax-rules ()
((_ name var exp)
(let ((var name))
(set! name exp)))))
(define-override emacs-emacsql-sqlite pkg
(package
(inherit pkg)
(arguments
`(,@(package-arguments pkg)
#:modules ((emacs build melpa-build-system)
(guix build utils)
(guix build emacs-utils)
(srfi srfi-26))
#:phases
(modify-phases %standard-phases
(add-before 'install 'patch-elisp-shell-shebangs
(lambda _
(substitute* (find-files "." "\\.el")
(("/bin/sh") (which "sh")))))
(add-after 'patch-elisp-shell-shebangs 'setenv-shell
(lambda _
(setenv "SHELL" "sh")))
(add-after 'setenv-shell 'build-emacsql-sqlite
(lambda _
(invoke "make" "binary" (string-append "CC=" ,(cc-for-target)))))
(add-after 'build-emacsql-sqlite 'install-emacsql-sqlite
;; This build phase installs emacs-emacsql binary.
(lambda* (#:key outputs #:allow-other-keys)
(install-file "sqlite/emacsql-sqlite"
(string-append (assoc-ref outputs "out") "/bin"))))
(add-after 'install-emacsql-sqlite 'patch-emacsql-sqlite.el
;; This build phase removes interactive prompts
;; and makes sure Emacs look for binaries in the right places.
(lambda* (#:key outputs #:allow-other-keys)
(let ((file "emacsql-sqlite.el"))
(chmod file #o644)
(emacs-substitute-sexps file
;; Make sure Emacs looks for ‘GCC’ binary in the right place.
("(executable-find" (which "gcc"))
;; Make sure Emacs looks for ‘emacsql-sqlite’ binary
;; in the right place.
("(defvar emacsql-sqlite-executable-path"
(string-append (assoc-ref outputs "out")
"/bin/emacsql-sqlite")))))))))
(inputs (package-inputs e/emacs-emacsql))))
(define-override emacs-vterm pkg
(package
(inherit pkg)
(arguments
`(#:modules ((emacs build melpa-build-system)
((guix build cmake-build-system) #:prefix cmake:)
(guix build emacs-utils)
(guix build utils))
#:imported-modules (,@%melpa-build-system-modules
(guix build cmake-build-system))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'substitute-vterm-module-path
(lambda* (#:key outputs #:allow-other-keys)
(chmod "vterm.el" #o644)
(emacs-substitute-sexps "vterm.el"
("(require 'vterm-module nil t)"
`(module-load
,(string-append (assoc-ref outputs "out")
"/lib/vterm-module.so"))))))
(add-after 'build 'configure
;; Run cmake.
(lambda* (#:key outputs #:allow-other-keys)
((assoc-ref cmake:%standard-phases 'configure)
#:outputs outputs
#:out-of-source? #f
#:configure-flags '("-DUSE_SYSTEM_LIBVTERM=ON"))))
(add-after 'configure 'make
;; Run make.
(lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
;; Compile the shared object file.
(apply invoke "make" "all" make-flags)
;; Move the file into /lib.
(install-file
"vterm-module.so"
(string-append (assoc-ref outputs "out") "/lib")))))
#:tests? #f))
(native-inputs
(package-native-inputs e/emacs-vterm))))
(define-override emacs-geiser pkg
(package
(inherit pkg)
(native-inputs (package-native-inputs e/emacs-geiser))
(arguments
`(,@(package-arguments pkg)
#:phases
(modify-phases %standard-phases
(add-before 'install 'make-info
(lambda* (#:key outputs #:allow-other-keys)
(with-directory-excursion "doc"
(invoke "makeinfo" "--no-split"
"-o" "geiser.info" "geiser.texi")
(install-file "geiser.info" (string-append (assoc-ref outputs "out") "/share/info"))))))))))
(define-override emacs-geiser-guile pkg
(package
(inherit pkg)
(inputs (package-inputs e/emacs-geiser-guile))))
(define-override emacs-guix pkg
(package
(inherit pkg)
(build-system gnu-build-system)
(arguments (package-arguments e/emacs-guix))
(native-inputs (package-native-inputs e/emacs-guix))
(inputs (package-inputs e/emacs-guix))
(propagated-inputs
(list emacs-dash
emacs-geiser
emacs-geiser-guile
emacs-bui
emacs-magit-popup
emacs-edit-indirect
emacs-transient))))
;; Local Variables:
;; mode: scheme
;; End: