Changeset 5516569 in dotfiles for guix/.guix-packages/emacs.scm
- Timestamp:
- Oct 6, 2022, 12:26:10 PM (2 years ago)
- Branches:
- master
- Children:
- 2107e51
- Parents:
- a48604f
- git-author:
- Mikhail Kirillov <w96k@…> (10/06/22 12:24:57)
- git-committer:
- Mikhail Kirillov <w96k@…> (10/06/22 12:26:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guix/.guix-packages/emacs.scm
ra48604f r5516569 26 26 #:use-module (ice-9 match)) 27 27 28 (define-public emacs29 (package30 (name "emacs")31 (version "28.1")32 (source (origin33 (method url-fetch)34 (uri (string-append "mirror://gnu/emacs/emacs-"35 version ".tar.xz"))36 (sha25637 (base3238 "1qbmmmhnjhn4lvzsnyk7l5ganbi6wzbm38jc1a7hhyh3k78b7c98"))39 (patches (search-patches "emacs-exec-path.patch"40 "emacs-fix-scheme-indent-function.patch"41 "emacs-source-date-epoch.patch"))42 (modules '((guix build utils)))43 (snippet44 '(with-directory-excursion "lisp"45 ;; Delete the bundled byte-compiled elisp files and generated46 ;; autoloads.47 (for-each delete-file48 (append (find-files "." "\\.elc$")49 (find-files "." "loaddefs\\.el$")50 (find-files "eshell" "^esh-groups\\.el$")))51 52 ;; Make sure Tramp looks for binaries in the right places on53 ;; remote Guix System machines, where 'getconf PATH' returns54 ;; something bogus.55 (substitute* "net/tramp-sh.el"56 ;; Patch the line after "(defcustom tramp-remote-path".57 (("\\(tramp-default-remote-path")58 (format #f "(tramp-default-remote-path ~s ~s ~s ~s "59 "~/.guix-profile/bin" "~/.guix-profile/sbin"60 "/run/current-system/profile/bin"61 "/run/current-system/profile/sbin")))62 63 ;; Make sure Man looks for C header files in the right64 ;; places.65 (substitute* "man.el"66 (("\"/usr/local/include\"" line)67 (string-join68 (list line69 "\"~/.guix-profile/include\""70 "\"/var/guix/profiles/system/profile/include\"")71 " ")))72 #t))))73 (build-system glib-or-gtk-build-system)74 (arguments75 `(#:tests? #f ; no check target76 #:configure-flags (list "--with-modules"77 "--with-cairo"78 "--disable-build-details")79 #:phases80 (modify-phases %standard-phases81 (add-after 'unpack 'patch-program-file-names82 (lambda* (#:key inputs #:allow-other-keys)83 (substitute* '("src/callproc.c"84 "lisp/term.el"85 "lisp/htmlfontify.el"86 "lisp/textmodes/artist.el"87 "lisp/progmodes/sh-script.el")88 (("\"/bin/sh\"")89 (format #f "~s" (which "sh"))))90 (substitute* "lisp/doc-view.el"91 (("\"(gs|dvipdf|ps2pdf)\"" all what)92 (let ((ghostscript (assoc-ref inputs "ghostscript")))93 (if ghostscript94 (string-append "\"" ghostscript "/bin/" what "\"")95 all)))96 (("\"(pdftotext)\"" all what)97 (let ((poppler (assoc-ref inputs "poppler")))98 (if poppler99 (string-append "\"" poppler "/bin/" what "\"")100 all))))101 ;; match ".gvfs-fuse-daemon-real" and ".gvfsd-fuse-real"102 ;; respectively when looking for GVFS processes.103 (substitute* "lisp/net/tramp-gvfs.el"104 (("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process)105 (format #f "(or ~a (tramp-compat-process-running-p ~s))"106 all (string-append "." process "-real"))))107 #t))108 (add-before 'configure 'fix-/bin/pwd109 (lambda _110 ;; Use `pwd', not `/bin/pwd'.111 (substitute* (find-files "." "^Makefile\\.in$")112 (("/bin/pwd")113 "pwd"))114 #t))115 (add-after 'install 'install-site-start116 ;; Use 'guix-emacs' in "site-start.el", which is used autoload the117 ;; Elisp packages found in EMACSLOADPATH.118 (lambda* (#:key inputs outputs #:allow-other-keys)119 (let* ((out (assoc-ref outputs "out"))120 (lisp-dir (string-append out "/share/emacs/site-lisp"))121 (emacs (string-append out "/bin/emacs")))122 123 ;; This is duplicated from emacs-utils to prevent coupling.124 (define* (emacs-byte-compile-directory dir)125 (let ((expr `(progn126 (setq byte-compile-debug t)127 (byte-recompile-directory128 (file-name-as-directory ,dir) 0 1))))129 (invoke emacs "--quick" "--batch"130 (format #f "--eval=~s" expr))))131 132 (copy-file (assoc-ref inputs "guix-emacs.el")133 (string-append lisp-dir "/guix-emacs.el"))134 (with-output-to-file (string-append lisp-dir "/site-start.el")135 (lambda ()136 (display137 (string-append138 "(when (require 'guix-emacs nil t)\n"139 " (guix-emacs-autoload-packages)\n"140 " (advice-add 'package-load-all-descriptors"141 " :after #'guix-emacs-load-package-descriptors))"))))142 ;; Remove the extraneous subdirs.el file, as it causes Emacs to143 ;; add recursively all the the sub-directories of a profile's144 ;; share/emacs/site-lisp union when added to EMACSLOADPATH,145 ;; which leads to conflicts.146 (delete-file (string-append lisp-dir "/subdirs.el"))147 ;; Byte compile the site-start files.148 (emacs-byte-compile-directory lisp-dir))149 #t))150 (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp151 ;; restore the dump file that Emacs installs somewhere in152 ;; libexec/ to its original state153 (lambda* (#:key outputs target #:allow-other-keys)154 (let* ((libexec (string-append (assoc-ref outputs "out")155 "/libexec"))156 ;; each of these ought to only match a single file,157 ;; but even if not (find-files) sorts by string<,158 ;; so the Nth element in one maps to the Nth element of159 ;; the other160 (pdmp (find-files libexec "\\.pdmp$"))161 (pdmp-real (find-files libexec "\\.pdmp-real$")))162 (for-each rename-file pdmp-real pdmp))))163 (add-after 'glib-or-gtk-wrap 'strip-double-wrap164 (lambda* (#:key outputs #:allow-other-keys)165 ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped166 ;; twice. This also fixes a minor issue, where WMs would not be167 ;; able to track emacs back to emacs.desktop.168 (with-directory-excursion (assoc-ref outputs "out")169 (copy-file170 (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$"))171 "bin/emacs")172 #t)))173 (add-after 'strip-double-wrap 'wrap-emacs-paths174 (lambda* (#:key inputs outputs #:allow-other-keys)175 (let* ((out (assoc-ref outputs "out"))176 (lisp-dirs (find-files (string-append out "/share/emacs")177 "^lisp$"178 #:directories? #t)))179 (for-each180 (lambda (prog)181 (wrap-program prog182 ;; emacs-next and variants rely on uname being in PATH for183 ;; Tramp. Tramp paths can't be hardcoded, because they184 ;; need to be portable.185 `("PATH" suffix186 ,(map (lambda (in) (string-append in "/bin"))187 (list (assoc-ref inputs "gzip")188 (assoc-ref inputs "coreutils"))))189 `("EMACSLOADPATH" suffix ,lisp-dirs)))190 (find-files (string-append out "/bin")191 ;; Matches versioned and unversioned emacs binaries.192 ;; We don't patch emacsclient, because it takes its193 ;; environment variables from emacs.194 ;; Likewise, we don't need to patch helper binaries195 ;; like etags, ctags or ebrowse.196 "^emacs(-[0-9]+(\\.[0-9]+)*)?$"))))))))197 (inputs198 `(("gnutls" ,gnutls)199 ("ncurses" ,ncurses)200 201 ;; Required for "core" functionality, such as dired and compression.202 ("coreutils" ,coreutils)203 ("gzip" ,gzip)204 205 ;; Avoid Emacs's limited movemail substitute that retrieves POP3 email206 ;; only via insecure channels. This is not needed for (modern) IMAP.207 ("mailutils" ,mailutils)208 209 ;; TODO: Add the optional dependencies.210 ("gpm" ,gpm)211 ("libx11" ,libx11)212 ("gtk+" ,gtk+)213 ("cairo" ,cairo)214 ("pango" ,pango)215 ("harfbuzz" ,harfbuzz)216 ("libxft" ,libxft)217 ("libtiff" ,libtiff)218 ("giflib" ,giflib)219 ("libjpeg" ,libjpeg-turbo)220 ("acl" ,acl)221 ("jansson" ,jansson)222 ("gmp" ,gmp)223 ("ghostscript" ,ghostscript)224 ("poppler" ,poppler)225 226 ;; When looking for libpng `configure' links with `-lpng -lz', so we227 ;; must also provide zlib as an input.228 ("libpng" ,libpng)229 ("zlib" ,zlib)230 ("librsvg" ,@(if (target-x86-64?)231 (list librsvg-bootstrap)232 (list librsvg-2.40)))233 ("libxpm" ,libxpm)234 ("libxml2" ,libxml2)235 ("libice" ,libice)236 ("libsm" ,libsm)237 ("alsa-lib" ,alsa-lib)238 ("dbus" ,dbus)239 240 ;; multilingualization support241 ("libotf" ,libotf)242 ("m17n-lib" ,m17n-lib)))243 (native-inputs244 `(("guix-emacs.el" ,(search-auxiliary-file "emacs/guix-emacs.el"))245 ("pkg-config" ,pkg-config)246 ("texinfo" ,texinfo)))247 248 (native-search-paths249 (list (search-path-specification250 (variable "EMACSLOADPATH")251 (files '("share/emacs/site-lisp")))252 (search-path-specification253 (variable "INFOPATH")254 (files '("share/info")))))255 256 (home-page "https://www.gnu.org/software/emacs/")257 (synopsis "The extensible, customizable, self-documenting text editor")258 (description259 "GNU Emacs is an extensible and highly customizable text editor. It is260 based on an Emacs Lisp interpreter with extensions for text editing. Emacs261 has been extended in essentially all areas of computing, giving rise to a262 vast array of packages supporting, e.g., email, IRC and XMPP messaging,263 spreadsheets, remote server editing, and much more. Emacs includes extensive264 documentation on all aspects of the system, from basic editing to writing265 large Lisp programs. It has full Unicode support for nearly all human266 languages.")267 (license license:gpl3+)))268 269 (define-public libgccjit-for-gcc270 (mlambda (gcc)271 (package272 (inherit gcc)273 (name "libgccjit")274 (outputs (delete "lib" (package-outputs gcc)))275 (properties (alist-delete 'hidden? (package-properties gcc)))276 (arguments277 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)278 (guix build utils)279 (ice-9 regex)280 (srfi srfi-1)281 (srfi srfi-26))282 ,@(package-arguments gcc))283 ((#:configure-flags flags)284 `(append '("--disable-bootstrap"285 "--disable-libatomic"286 "--disable-libgomp"287 "--disable-libquadmath"288 "--disable-libssp"289 "--enable-host-shared"290 "--enable-checking=release"291 "--enable-languages=jit")292 (remove (cut string-match "--enable-languages.*" <>)293 ,flags)))294 ((#:phases phases)295 `(modify-phases ,phases296 (add-after 'install 'remove-broken-or-conflicting-files297 (lambda* (#:key outputs #:allow-other-keys)298 (for-each delete-file299 (find-files (string-append (assoc-ref outputs "out") "/bin")300 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))301 #t))))))302 (inputs303 (alist-delete "libstdc++"304 (package-inputs gcc)))305 (native-inputs306 `(("gcc" ,gcc)307 ,@(package-native-inputs gcc))))))308 309 (define-public libgccjit-10310 (libgccjit-for-gcc gcc-10))311 312 (define-public libgccjit-11313 (libgccjit-for-gcc gcc-11))314 315 (define-public emacs316 (package317 (inherit emacs)318 (name "emacs")319 (version "28.1")320 (source321 (origin322 (method url-fetch)323 (uri (string-append "mirror://gnu/emacs/emacs-"324 version ".tar.xz"))325 (sha256326 (base32327 "1qbmmmhnjhn4lvzsnyk7l5ganbi6wzbm38jc1a7hhyh3k78b7c98"))))328 (arguments329 (substitute-keyword-arguments330 (package-arguments emacs-next)331 ((#:configure-flags flags ''())332 `(list "--with-imagemagick"333 "--disable-silent-rules"334 "--with-x-toolkit=no"335 "--enable-link-time-optimization"336 "--with-json"337 "--with-jpeg"338 "--with-png"339 "--with-rsvg"340 "--without-xaw3d"341 "--with-threads"342 "--with-included-regex"343 "--with-modules"344 "--without-libotf"345 "--without-libsystemd"346 "--with-mailutils"347 "--without-toolkit-scroll-bars"348 "--without-selinux"349 ;; "--without-harfbuzz"350 ;; "--without-cairo"351 ;; "--with-libxft"352 ;; "--with-xdbe=no"353 "CFLAGS=-O3 -g -fcommon -pipe"354 ))))355 (inputs356 (modify-inputs (package-inputs emacs-next)357 (prepend imagemagick libxaw)))358 (properties '((tunable? . #true)))))359 360 (define-public emacs-with-native-compilation361 (let ((libgccjit (libgccjit-for-gcc gcc-11)))362 (package363 (inherit emacs)364 (name "emacs-with-native-compilation")365 (version "28.1")366 (source367 (origin368 (method url-fetch)369 (uri (string-append "mirror://gnu/emacs/emacs-"370 version ".tar.xz"))371 (sha256372 (base32373 "1qbmmmhnjhn4lvzsnyk7l5ganbi6wzbm38jc1a7hhyh3k78b7c98"))))374 (arguments375 (substitute-keyword-arguments376 (package-arguments emacs-28)377 ((#:make-flags flags ''())378 `(cons* "NATIVE_FULL_AOT=1" ,flags))379 ((#:configure-flags flags ''())380 `(cons* "--with-native-compilation"381 "CFLAGS=-O3 -g -fcommon -fcommon -pipe"382 ,flags))383 ((#:phases phases ''())384 `(modify-phases ,phases385 ;; Required for configure to find libgccjit386 (add-before 'configure 'set-library-path387 (lambda* (#:key inputs #:allow-other-keys)388 (let* ((libgccjit-version ,(package-version libgccjit))389 (libgccjit-libdir390 (string-append391 (assoc-ref inputs "libgccjit") "/lib/gcc/"392 %host-type "/" libgccjit-version "/")))393 (setenv "LIBRARY_PATH"394 (string-append libgccjit-libdir ":"395 (getenv "LIBRARY_PATH"))))))396 ;; Add runtime library paths for libgccjit.397 (add-after 'unpack 'patch-driver-options398 (lambda* (#:key inputs #:allow-other-keys)399 (substitute* "lisp/emacs-lisp/comp.el"400 (("\\(defcustom native-comp-driver-options nil")401 (format402 #f "(defcustom native-comp-driver-options '(~s ~s ~s ~s)"403 (string-append404 "-B" (assoc-ref inputs "binutils") "/bin/")405 (string-append406 "-B" (assoc-ref inputs "glibc") "/lib/")407 (string-append408 "-B" (assoc-ref inputs "libgccjit") "/lib/")409 (string-append410 "-B" (assoc-ref inputs "libgccjit") "/lib/gcc/"))))))))))411 (inputs412 (modify-inputs (package-inputs emacs-28)413 (prepend libgccjit glibc bzip2)))414 (propagated-inputs415 (modify-inputs (package-inputs emacs-28)416 (prepend)))417 (properties '((tunable? . #true))))))418 419 (define-public wkmacs420 (package421 (inherit emacs)422 (name "wkmacs")423 (version "28.1")424 (propagated-inputs425 (list emacs-flycheck426 emacs-pdf-tools427 emacs-debbugs428 emacs-vimrc-mode429 emacs-docker-compose-mode430 emacs-dockerfile-mode431 emacs-docker432 emacs-org-roam433 emacs-web-mode434 emacs-php-mode435 emacs-robe436 emacs-inf-ruby437 emacs-sudo-edit438 emacs-auto-complete439 emacs-visual-fill-column440 emacs-dumb-jump441 emacs-goto-chg442 emacs-gitpatch443 emacs-magit444 emacs-auctex445 emacs-anaconda-mode446 emacs-anzu447 emacs-all-the-icons448 emacs-telega449 emacs-geiser450 emacs-org-webring451 emacs-all-the-icons-dired452 emacs-avy453 emacs-browse-kill-ring454 emacs-haskell-mode455 emacs-idris-mode456 emacs-mwim457 emacs-diminish458 emacs-direnv459 emacs-elpher460 emacs-exec-path-from-shell461 emacs-expand-region462 emacs-geiser-guile463 emacs-guix464 emacs-org-ref465 emacs-git-gutter466 emacs-gnuplot467 emacs-nix-mode468 emacs-sml-mode469 emacs-slime470 emacs-simple-httpd471 emacs-undo-tree472 emacs-yasnippet473 emacs-yasnippet-snippets474 emacs-xref))475 (properties '((tunable? . #true)))))476 477 28 (define-public emacs-pythonic 478 29 (package … … 666 217 (list emacs-request)) 667 218 (build-system emacs-build-system))) 219 220 (define-public emacs-mini-modeline 221 (package 222 (name "emacs-mini-modeline") 223 (version "20211130.604") 224 (source (origin 225 (method git-fetch) 226 (uri (git-reference 227 (url "https://github.com/kiennq/emacs-mini-modeline.git") 228 (commit "434b98b22c69c8b3b08e9c267c935591c49a8301"))) 229 (sha256 230 (base32 231 "063bpi3gxzi6kkc3mb9h4m8lvbsvfw47z559960h912h2l3z6vhq")))) 232 (build-system emacs-build-system) 233 (propagated-inputs (list emacs-dash)) 234 (home-page "https://github.com/kiennq/emacs-mini-modeline") 235 (synopsis "Display modeline in minibuffer") 236 (description 237 "Display modeline in minibuffer. With this we save one display line and also 238 don't have to see redundant information.") 239 (license #f))) 240 241 (define-public emacs-isearch-mb 242 (package 243 (name "emacs-isearch-mb") 244 (version "0.5") 245 (source (origin 246 (method url-fetch) 247 (uri (string-append "https://elpa.gnu.org/packages/isearch-mb-" 248 version ".tar")) 249 (sha256 250 (base32 251 "0fah8dmh9jv05i93ccn9dvl7qmfy32vwxqdzkf1v8gr1plsyjyx7")))) 252 (build-system emacs-build-system) 253 (home-page "https://github.com/astoff/isearch-mb") 254 (synopsis "Control isearch from the minibuffer") 255 (description "") 256 (license license:gpl3+)))
Note:
See TracChangeset
for help on using the changeset viewer.