AtlatestRepositorycore-channel

core-channel / tree / src / core / packageseditors.sgl

1;;; Terminal editors.
2;;;
3;;; This is where the dependency model shows itself. A dependency is now a
4;;; SIBLING PACKAGE VALUE -- `dependencies: (list ncurses)` -- imported from
5;;; another channel module like any other binding. The sealed object records a
6;;; (name, package-identity) pair, and the engine turns that identity into a
7;;; realized output hash when, and only when, it constructs the build.
8;;;
9;;; What that replaced: `dependencies:` used to be a bare SHA-256 of an
10;;; already-realized output tree. It could not be computed without building,
11;;; nothing checked it was the output of the package it was named after, and it
12;;; differed on every machine and in every store root -- so publishing a
13;;; dependency tree meant a human transcribing hashes between topological
14;;; levels. The `(core outputs)` module that named those hashes is gone.
15(define-library (core packages editors)
16 (import (sigil core)
17 (core build-environments)
18 (core packages compression)
19 (core packages terminal)
20 (core packages xml)
21 (core packages databases)
22 (core packages parsing)
23 (sigil env package)
24 (sigil build external))
25 (export vim emacs)
26 (begin
27 (define vim
28 (package
29 name: "vim"
30 version: "9.1.1164"
31 source: (external-source
32 location: "https://github.com/vim/vim/archive/refs/tags/v9.1.1164.tar.gz"
33 sha256: "101526fa580d015edc5b5fb059d8b396cd8b05c29b0ec9ceb2a8763083293979")
34 buildenv: core-buildenv
35 ;; ncurses' own `search-paths:` puts include/ncursesw on the compile
36 ;; path. vim does not have to know that layout, and neither does the
37 ;; builder any more.
38 dependencies: (list ncurses)
39 phases: (list
40 (external-phase
41 kind: 'configure
42 args: (list "--prefix=${out}"
43 "--with-features=normal"
44 "--with-tlib=ncursesw"
45 "--enable-multibyte"
46 "--disable-gui"
47 "--without-x"
48 "--disable-gtk2-check"
49 "--disable-gnome-check"
50 "--disable-motif-check"
51 "--disable-athena-check"
52 "--disable-fontset"
53 "--disable-acl"
54 "--disable-gpm"
55 "--disable-canberra"
56 "--disable-libsodium"
57 "--disable-selinux"
58 "--disable-nls"
59 "--disable-netbeans"
60 "--with-compiledby=Sigil"))
61 (external-phase
62 kind: 'make
63 args: (list "VIMRCLOC=${out}/share/vim"
64 "VIMRUNTIMEDIR=${out}/share/vim/vim91"))
65 (external-phase kind: 'install))))
67 ;; A terminal Emacs that is actually worth using, as opposed to the
68 ;; `emacs-nox` recipe in recipes/, which disabled essentially everything.
69 ;;
70 ;; Enabled here: ncurses, zlib decompression, libxml2 (shr/eww), sqlite3
71 ;; (org-roam and friends), tree-sitter (*-ts-mode), and dynamic modules.
72 ;; JSON needs no dependency at all -- Emacs 30 has it in-tree at src/json.c,
73 ;; so jansson, which Guix still lists for emacs-no-x, is not a dependency of
74 ;; this version.
75 ;;
76 ;; Dependencies are DIRECT only; the engine computes the closure. Every
77 ;; package listed here happens to be a leaf today, so this list is both.
78 ;; When gnutls lands, its own module names nettle/gmp/libtasn1/libunistring/
79 ;; p11-kit and this list gains ONE entry, not six.
80 ;;
81 ;; Deliberately absent, decided rather than forgotten:
82 ;; * native compilation (libgccjit) -- means building GCC itself, which
83 ;; needs a multi-stage bootstrap and a per-package toolchain. The
84 ;; format can express both now; whether GCC bootstraps under `zig cc`
85 ;; is unmeasured, so it stays out until someone measures it.
86 ;; * gnutls and gpm -- not yet ported; these flags flip to --with-gnutls
87 ;; and --with-gpm once they land. NOTE that gnutls is also found via
88 ;; PKG_CHECK_MODULES, so any .pc in its Requires chain is exposed to the
89 ;; same seed pkgconf bug that libxml2 needed a patch for.
90 (define emacs
91 (package
92 name: "emacs"
93 version: "30.2"
94 source: (external-source
95 location: "https://ftp.gnu.org/gnu/emacs/emacs-30.2.tar.xz"
96 sha256: "b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9")
97 buildenv: core-buildenv
98 dependencies: (list ncurses zlib libxml2 sqlite tree-sitter)
99 ;; A portable dump is a memory image written once the build root is
100 ;; known. external-normalize-build-root! pads build-root strings inside
101 ;; outputs, but it cannot make a dump bit-identical across two runs, so
102 ;; the bounded allowance the original recipe carried still earns its
103 ;; place. It is a budget, not a blanket: anything outside *.pdmp, or
104 ;; more than 64 bytes inside it, is still a hard determinism failure.
105 divergences: (list (external-divergence
106 file-glob: "libexec/emacs/*/*.pdmp"
107 max-differing-bytes: 64))
108 phases: (list
109 (external-phase
110 kind: 'configure
111 args: (list "--prefix=${out}"
112 ;; omit host name and build date from the
113 ;; binary; this channel cares about
114 ;; reproducibility more than about `M-x
115 ;; emacs-version` naming a machine
116 "--disable-build-details"
117 ;; features we are deliberately turning ON
118 "--with-tree-sitter"
119 "--with-modules"
120 ;; This was --without-xml2 in the port, blocked
121 ;; by the seed's pkgconf aborting on libxml2's
122 ;; empty `Requires:` field. The channel patch
123 ;; in (core packages xml) deletes that field at
124 ;; its source, so detection runs for real again.
125 "--with-xml2"
126 ;; no window system
127 "--without-x"
128 "--with-x-toolkit=no"
129 "--without-xft"
130 "--without-harfbuzz"
131 "--without-libotf"
132 "--without-m17n-flt"
133 "--without-cairo"
134 "--without-lcms2"
135 "--without-gif"
136 "--without-jpeg"
137 "--without-png"
138 "--without-rsvg"
139 "--without-tiff"
140 "--without-webp"
141 "--without-xpm"
142 ;; no system integration we cannot pin
143 "--without-dbus"
144 "--without-gsettings"
145 "--without-libsystemd"
146 "--without-selinux"
147 "--without-sound"
148 ;; not yet ported
149 "--without-gnutls"
150 "--without-gpm"
151 ;; movemail: no Kerberos/Hesiod/mailutils here
152 "--without-pop"
153 "--without-mailutils"))
154 (external-phase kind: 'make)
155 (external-phase kind: 'install))))))