From 5de8779ad933faf883348f6cab09671f1e081a67 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:06:48 +0200 Subject: guix: emacs-build-system: Process package source in build tree. * guix/build/emacs-build-system.scm (ensure-package-description) (patch-el-files, make-autoloads): Operate on the current working directory, either implicitly, or through (getcwd). (enable-autoloads-compilation): Deleted variable, logic moved into make-autoloads. (%standard-phases): Adjust accordingly. --- guix/build/emacs-build-system.scm | 85 ++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 3808b60445..aa083c6409 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -132,29 +132,25 @@ environment variable\n" source-directory)) (parameterize ((%emacs emacs)) (emacs-compile-directory (elpa-directory out))))) -(define* (patch-el-files #:key outputs #:allow-other-keys) - "Substitute the absolute \"/bin/\" directory with the right location in the -store in '.el' files." - - (let* ((out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out)) - (el-dir (string-append out %install-dir "/" elpa-name-ver)) - (el-files (find-files (getcwd) "\\.el$"))) - (define (substitute-program-names) - (substitute* el-files - (("\"/bin/([^.]\\S*)\"" _ cmd-name) - (let ((cmd (which cmd-name))) - (unless cmd - (error "patch-el-files: unable to locate " cmd-name)) - (string-append "\"" cmd "\""))))) - - (with-directory-excursion el-dir - ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still - ;; ISO-8859-1-encoded. - (unless (false-if-exception (substitute-program-names)) - (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute-program-names)))) - #t)) +(define* (patch-el-files #:key inputs outputs #:allow-other-keys) + "Substitute the absolute \"/bin/\" and \"/sbin\" directories with the right +locations in the store in '.el' files." + + (define substitute-program-names + (let ((el-files (find-files (getcwd) "\\.el$"))) + (lambda () + (substitute* el-files + (("\"/(s?bin/[^.]\\S*)\"" _ cmd) + (let ((cmd (search-input-file inputs cmd))) + (unless cmd + (error "patch-el-files: unable to locate " (basename cmd))) + (string-append "\"" cmd "\""))))))) + + (unless (false-if-exception (substitute-program-names)) + ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still + ;; ISO-8859-1-encoded. + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute-program-names)))) (define (find-root-library-file name) (let loop ((parts (string-split @@ -224,10 +220,8 @@ store in '.el' files." (emacs-batch-edit-file (string-append name ".el") %write-pkg-file-form))) - (let* ((out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out))) - (with-directory-excursion (elpa-directory out) - (and=> (find-root-library-file elpa-name-ver) write-pkg-file)))) + (let ((name (store-directory->elpa-name-version (assoc-ref outputs "out")))) + (and=> (find-root-library-file name) write-pkg-file))) (define* (check #:key tests? (test-command '("make" "check")) (parallel-tests? #t) #:allow-other-keys) @@ -306,24 +300,15 @@ parallel. PARALLEL-TESTS? is ignored when using a non-make TEST-COMMAND." info-files))) #t)) -(define* (make-autoloads #:key outputs inputs #:allow-other-keys) +(define* (make-autoloads #:key outputs #:allow-other-keys) "Generate the autoloads file." - (let* ((emacs (search-input-file inputs "/bin/emacs")) - (out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out)) - (elpa-name (package-name->name+version elpa-name-ver)) - (el-dir (elpa-directory out))) - (parameterize ((%emacs emacs)) - (emacs-generate-autoloads elpa-name el-dir)))) - -(define* (enable-autoloads-compilation #:key outputs #:allow-other-keys) - "Remove the NO-BYTE-COMPILATION local variable embedded in the generated -autoload files." - (let* ((out (assoc-ref outputs "out")) - (autoloads (find-files out "-autoloads.el$"))) - (substitute* autoloads - ((";; no-byte-compile.*") "")) - #t)) + (emacs-generate-autoloads + (package-name->name+version (store-directory->elpa-name-version + (assoc-ref outputs "out"))) + (getcwd)) + ;; Ensure that autoloads can be byte-compiled. + (substitute* (find-files "." "-autoloads\\.el$") + ((";; no-byte-compile.*") ""))) (define* (validate-compiled-autoloads #:key outputs #:allow-other-keys) "Verify whether the byte compiled autoloads load fine." @@ -358,7 +343,11 @@ for libraries following the ELPA convention." (define %standard-phases (modify-phases gnu:%standard-phases (replace 'unpack unpack) + (add-after 'unpack 'ensure-package-description + ensure-package-description) (add-after 'unpack 'expand-load-path expand-load-path) + (add-after 'unpack 'patch-el-files patch-el-files) + (add-after 'expand-load-path 'make-autoloads make-autoloads) (add-after 'expand-load-path 'add-install-to-native-load-path add-install-to-native-load-path) (delete 'bootstrap) @@ -366,14 +355,8 @@ for libraries following the ELPA convention." (delete 'build) (replace 'check check) (replace 'install install) - (add-after 'install 'make-autoloads make-autoloads) - (add-after 'make-autoloads 'enable-autoloads-compilation - enable-autoloads-compilation) - (add-after 'enable-autoloads-compilation 'patch-el-files patch-el-files) - (add-after 'patch-el-files 'ensure-package-description - ensure-package-description) ;; The .el files are byte compiled directly in the store. - (add-after 'ensure-package-description 'build build) + (add-after 'install 'build build) (add-after 'build 'validate-compiled-autoloads validate-compiled-autoloads) (add-after 'validate-compiled-autoloads 'move-doc move-doc))) -- cgit v1.2.3 From 61832f00a1b6abb9797ed370abb0704eeab4fbd7 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:14:30 +0200 Subject: gnu: skktools: Build autoloads before installing them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/language.scm (skktools)[#:phases]: Move ‘make-autoloads’ after ‘unpack’. --- gnu/packages/language.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm index faf3114b84..275b1da422 100644 --- a/gnu/packages/language.scm +++ b/gnu/packages/language.scm @@ -1003,15 +1003,15 @@ and manipulation.") "convert2skk/skk2list") (find-files "filters" "\\.rb$")))))) ;; Install and make autoloads for skk-xml.el. + (add-after 'unpack 'make-autoloads + (assoc-ref emacs:%standard-phases + 'make-autoloads)) (add-after 'install 'install-emacs-files (assoc-ref emacs:%standard-phases 'install)) (add-after 'install-emacs-files 'compile-emacs-files (assoc-ref emacs:%standard-phases 'build)) - (add-after 'compile-emacs-files 'make-autoloads - (assoc-ref emacs:%standard-phases - 'make-autoloads)) (add-after 'install 'install-docs (lambda* (#:key outputs #:allow-other-keys) (let ((doc (string-append (assoc-ref outputs "out") -- cgit v1.2.3 From 84f41058775c82c1bff87b91ff4df50ee90fb5af Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:29:26 +0200 Subject: gnu: translate-shell: Build autoloads before installing them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/dictionaries.scm (translate-shell)[#:phases]: Move ‘emacs-make-autoloads’ before ‘unpack’. Drop ‘emacs-autoload-compilation’. --- gnu/packages/dictionaries.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm index 06b5c4362c..19fe9b6f11 100644 --- a/gnu/packages/dictionaries.scm +++ b/gnu/packages/dictionaries.scm @@ -272,12 +272,10 @@ and a Python library.") curl "/bin:" fribidi "/bin:" rlwrap "/bin"))))))) + (add-after 'unpack 'emacs-make-autoloads + (assoc-ref emacs:%standard-phases 'make-autoloads)) (add-after 'install 'emacs-install (assoc-ref emacs:%standard-phases 'install)) - (add-after 'emacs-install 'emacs-make-autoloads - (assoc-ref emacs:%standard-phases 'make-autoloads)) - (add-after 'emacs-make-autoloads 'emacs-autoloads-compilation - (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation))) #:make-flags (list (string-append "PREFIX=" %output) "NETWORK_ACCESS=no test") #:imported-modules (,@%gnu-build-system-modules -- cgit v1.2.3 From d1b98d7c927f53fb510e2e5345d9e73ac1c5de74 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:30:53 +0200 Subject: gnu: translate-shell: Compile emacs bytecode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/dictionaries.scm (translate-shell)[#:phases]: Add ‘emacs-build’. --- gnu/packages/dictionaries.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm index 19fe9b6f11..9f493d91ad 100644 --- a/gnu/packages/dictionaries.scm +++ b/gnu/packages/dictionaries.scm @@ -276,6 +276,8 @@ and a Python library.") (assoc-ref emacs:%standard-phases 'make-autoloads)) (add-after 'install 'emacs-install (assoc-ref emacs:%standard-phases 'install)) + (add-after 'emacs-install 'emacs-build + (assoc-ref emacs:%standard-phases 'build))) #:make-flags (list (string-append "PREFIX=" %output) "NETWORK_ACCESS=no test") #:imported-modules (,@%gnu-build-system-modules -- cgit v1.2.3 From a5eb6fa52f320675b7007831957ce4408aff31e1 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:53:11 +0200 Subject: gnu: emacs-mew: Adjust to changes in emacs-build-system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/mail.scm (emacs-mew)[arguments]: Only let-bind icon-dir. <#:modules>: Add (guix build emacs-build-system). <#:imported-modules>: Use %emacs-build-system-modules. <#:configure-flags>: Set elispdir with emacs:elpa-directory. <#:phases>: Move ‘generate-autoloads’ after ‘unpack’. Generate the autoloads locally. Also enable compilation. --- gnu/packages/mail.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 89087b0708..a69154e653 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -1167,17 +1167,17 @@ repository and Maildir/IMAP as LOCAL repository.") "0xazygwdc328m5l31rxjazq9giv2xrygp2p2q455lf3jhdxwq1km")))) (build-system gnu-build-system) (arguments - (let ((elisp-dir #~(string-append #$output "/share/emacs/site-lisp")) - (icon-dir #~(string-append #$output "/share/mew"))) + (let ((icon-dir #~(string-append #$output "/share/mew"))) (list #:modules '((guix build gnu-build-system) (guix build utils) + ((guix build emacs-build-system) #:prefix emacs:) (guix build emacs-utils)) - #:imported-modules `(,@%gnu-build-system-modules - (guix build emacs-utils)) + #:imported-modules %emacs-build-system-modules #:tests? #f #:configure-flags - #~(list (string-append "--with-elispdir=" #$elisp-dir) + #~(list (string-append "--with-elispdir=" + (emacs:elpa-directory #$output)) (string-append "--with-etcdir=" #$icon-dir)) #:phases #~(modify-phases %standard-phases @@ -1188,9 +1188,15 @@ repository and Maildir/IMAP as LOCAL repository.") `(progn (add-to-list 'image-load-path 'mew-icon-directory) ,#$icon-dir))))) - (add-after 'install 'generate-autoloads + (add-after 'unpack 'generate-autoloads (lambda _ - (emacs-generate-autoloads "mew" #$elisp-dir))))))) + (emacs-generate-autoloads "mew" "elisp") + (substitute* "elisp/mew-autoloads.el" + ((";; no-byte-compile.*") "")) + ;; Add generated autoloads to Makefile, so they get compiled + (substitute* "elisp/Makefile" + (("OBJS =") "OBJS = mew-autoloads.elc") + (("SRCS =") "SRCS = mew-autoloads.el")))))))) (native-inputs (list emacs)) (propagated-inputs -- cgit v1.2.3 From c36a91284b02aa8be05dd8ceaf4b76973d6ca04e Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:03:54 +0200 Subject: gnu: crm114: Adjust to changes in emacs-build-system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/mail.scm (crm114)[#:phases]: Move ‘make-autoloads’ after ‘unpack’. Delete ‘enable-autoloads-compilation’. Adjust ordering of other phases accordingly. --- gnu/packages/mail.scm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index a69154e653..7e81bd8dc9 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -4743,14 +4743,12 @@ ex-like commands on it.") (for-each (lambda (file) (install-file file (string-append out "/bin"))) (list "mailfilter.crm" "mailreaver.crm" "mailtrainer.crm"))))) - (add-after 'install 'install-emacs-mode - (assoc-ref emacs:%standard-phases 'install)) ;; Run phases from the emacs build system. - (add-after 'install-emacs-mode 'make-autoloads + (add-after 'unpack 'make-autoloads (assoc-ref emacs:%standard-phases 'make-autoloads)) - (add-after 'make-autoloads 'enable-autoloads-compilation - (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation)) - (add-after 'enable-autoloads-compilation 'emacs-build + (add-after 'install 'install-emacs-mode + (assoc-ref emacs:%standard-phases 'install)) + (add-after 'install-emacs-mode 'emacs-build (assoc-ref emacs:%standard-phases 'build)) (add-after 'emacs-build 'validate-compiled-autoloads (assoc-ref emacs:%standard-phases 'validate-compiled-autoloads))))) -- cgit v1.2.3 From 5a780b1b1a30f606092c27fb42e66a5e904fc1e9 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:09:54 +0200 Subject: gnu: guile-wisp: Build autoloads before installing them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/guile-xyz.scm (guile-wisp)[#:phases]: Move ‘make-autoloads’ after ‘unpack’. --- gnu/packages/guile-xyz.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 0eec87f768..75f7b1a271 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -2182,12 +2182,12 @@ user which package sets would they like to install from it.") (invoke "guild" "compile" "-L" module-dir file "-o" go))) (find-files module-dir "\\.scm$"))))) + (add-after 'unpack 'make-autoloads + (assoc-ref emacs:%standard-phases 'make-autoloads)) (add-after 'install 'install-emacs-files (assoc-ref emacs:%standard-phases 'install)) (add-after 'install-emacs-files 'compile-emacs-files - (assoc-ref emacs:%standard-phases 'build)) - (add-after 'compile-emacs-files 'make-autoloads - (assoc-ref emacs:%standard-phases 'make-autoloads))))) + (assoc-ref emacs:%standard-phases 'build))))) (home-page "https://www.draketo.de/english/wisp") (inputs (list guile-3.0)) -- cgit v1.2.3 From b520ad2781b7be1660adeccdc4f7ddc09e7f2b49 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:16:18 +0200 Subject: gnu: uim: Keep Emacs files in subdirectory. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/xorg.scm (uim)[arguments]<#:configure-flags>: Drop “--with-lispdir”. <#:phases>: Drop ‘fix-install-path’. Adjust ‘make-autoloads’ accordingly. --- gnu/packages/xorg.scm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index f65ffa7476..bbaa432142 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -6298,7 +6298,6 @@ X11 servers, Windows, or macOS.") (guix build emacs-utils)) #:configure-flags (list "--with-anthy-utf8" - (string-append "--with-lispdir=" %output "/share/emacs") ;; Set proper runpath (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib") "CFLAGS=-O2 -g -fcommon") @@ -6312,21 +6311,11 @@ X11 servers, Windows, or macOS.") ("uim-el-agent" (string-append out "/bin/uim-el-agent")) ("uim-el-helper-agent" (string-append out "/bin/uim-el-helper-agent")))) #t)) - ;; Fix installation path by renaming share/emacs/uim-el to - ;; share/emacs/site-lisp - (add-after 'install 'fix-install-path - (lambda* (#:key outputs #:allow-other-keys) - (let ((share-emacs (string-append (assoc-ref outputs "out") - "/share/emacs"))) - (rename-file (string-append share-emacs "/uim-el") - (string-append share-emacs "/site-lisp"))) - #t)) - ;; Generate emacs autoloads for uim.el (add-after 'fix-install-path 'make-autoloads (lambda* (#:key outputs #:allow-other-keys) (emacs-generate-autoloads ,name (string-append (assoc-ref outputs "out") - "/share/emacs/site-lisp")) + "/share/emacs/site-lisp/uim-el")) #t))))) (home-page "https://github.com/uim/uim") (synopsis "Multilingual input method framework") -- cgit v1.2.3 From d9d725976406588c9644f16f3a2ecc2c17084d5f Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:10:15 +0200 Subject: gnu: emacs-geiser-guile: Process autoloads in-tree. * gnu/packages/emacs-xyz.scm (emacs-geiser-guile)[#:phases]: Resolve "geiser-guile-autoloads.el" in the current working directory. --- gnu/packages/emacs-xyz.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index fabd519ca7..7429ac8e0e 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -543,8 +543,7 @@ API key.") (search-input-file inputs "bin/guile")))))) (add-after 'make-autoloads 'patch-autoloads (lambda _ - (substitute* (string-append (elpa-directory #$output) - "/geiser-guile-autoloads.el") + (substitute* "geiser-guile-autoloads.el" ;; Activating implementations fails when Geiser is not yet ;; loaded, so let's defer that until it is. (("\\(geiser-activate-implementation .*\\)" all) -- cgit v1.2.3 From 9335307b913b2e1c216b61e39ed5d165e70ae6d4 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:20:08 +0200 Subject: gnu: emacs-geiser-gauche: Process autoloads in-tree. * gnu/packages/emacs-xyz.scm (emacs-geiser-gauche)[#:phases]: Resolve "geiser-gauche-autoloads.el" in the current working directory. --- gnu/packages/emacs-xyz.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 7429ac8e0e..a1bb6e6666 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -612,8 +612,7 @@ using geiser.") (search-input-file inputs "bin/gosh"))))) (add-after 'make-autoloads 'patch-autoloads (lambda _ - (substitute* (string-append (elpa-directory #$output) - "/geiser-gauche-autoloads.el") + (substitute* "geiser-gauche-autoloads.el" ;; Activating implementations fails when Geiser is not yet ;; loaded, so let's defer that until it is. (("\\(geiser-activate-implementation .*\\)" all) -- cgit v1.2.3 From 32446edab0b65a957e2e51acf88fa7e95c203e5a Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:20:50 +0200 Subject: gnu: emacs-geiser-racket: Process autoloads in-tree. * gnu/packages/emacs-xyz.scm (emacs-geiser-racket)[#:phases]: Resolve "geiser-racket-autoloads.el" in the current working directory. --- gnu/packages/emacs-xyz.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index a1bb6e6666..26cdcb63a9 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -657,8 +657,7 @@ a generic Scheme interaction mode for the GNU Emacs editor.") (search-input-file inputs "bin/racket")))))) (add-after 'make-autoloads 'patch-autoloads (lambda _ - (substitute* (string-append (elpa-directory #$output) - "/geiser-racket-autoloads.el") + (substitute* "geiser-racket-autoloads.el" ;; Activating implementations fails when Geiser is not yet ;; loaded, so let's defer that until it is. (("\\(geiser-activate-implementation .*\\)" all) -- cgit v1.2.3 From 927eee08dec36927e7f35b99e1945b5ad3336736 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:21:31 +0200 Subject: gnu: emacs-geiser-chez: Process autoloads in-tree. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez)[#:phases]: Resolve "geiser-chez-autoloads.el" in the current working directory. --- gnu/packages/emacs-xyz.scm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 26cdcb63a9..7d76236ee4 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -695,9 +695,7 @@ a generic Scheme interaction mode for the GNU Emacs editor.") (modify-phases %standard-phases (add-after 'make-autoloads 'patch-autoloads (lambda* (#:key outputs #:allow-other-keys) - (substitute* (string-append - (elpa-directory (assoc-ref outputs "out")) - "/geiser-chez-autoloads.el") + (substitute* "geiser-chez-autoloads.el" ;; Activating implementations fails when Geiser is not yet ;; loaded, so let's defer that until it is. ;; See . -- cgit v1.2.3 From 95fec09d4ba640bcb3e6f116c239c0a86551cd5a Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:28:21 +0200 Subject: gnu: emacs-libgit: Adjust to changes in emacs-build-system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs-xyz.scm (emacs-libgit)[#:phases]: Move ‘make-autoloads’ after ‘unpack’. Drop ‘enable-autoloads-compilation’. Move ‘emacs-build’ after ‘install’. --- gnu/packages/emacs-xyz.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 7d76236ee4..d0e9d1b226 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -1483,13 +1483,11 @@ on stdout instead of using a socket as the Emacsclient does.") emacs:%default-include))))) (add-after 'unpack 'emacs-add-install-to-native-load-path (assoc-ref emacs:%standard-phases 'add-install-to-native-load-path)) - (add-after 'install 'make-autoloads + (add-after 'unpack 'make-autoloads (assoc-ref emacs:%standard-phases 'make-autoloads)) - (add-after 'make-autoloads 'enable-autoloads-compilation - (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation)) - (add-after 'enable-autoloads-compilation 'patch-el-files + (add-after 'unpack 'patch-el-files (assoc-ref emacs:%standard-phases 'patch-el-files)) - (add-after 'patch-el-files 'emacs-build + (add-after 'install 'emacs-build (assoc-ref emacs:%standard-phases 'build)) (add-after 'emacs-build 'validate-compiled-autoloads (assoc-ref emacs:%standard-phases 'validate-compiled-autoloads))))) -- cgit v1.2.3 From ec7d68bcefd70679c5b97502d394afbca26a785b Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:31:54 +0200 Subject: gnu: emacs-eweouz: Build autoloads before installing them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs-xyz.scm (emacs-eweouz)[#:phases]: Move ‘emacs-make-autoloads’ after ‘enter-lisp-dir’. --- gnu/packages/emacs-xyz.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index d0e9d1b226..ba08dcd20f 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -3756,6 +3756,8 @@ defined in RFC 2425 and RFC 2426 to/from The Insidious Big Brother Database (emacs-substitute-sexps "eweouz.el" ("eweouz-helper-dirs" `(list ,(string-append #$output "/libexec/eweouz")))))) + (add-after 'enter-lisp-dir 'emacs-make-autoloads + (assoc-ref emacs:%standard-phases 'make-autoloads)) (add-after 'emacs-patch-variables 'emacs-expand-load-path (assoc-ref emacs:%standard-phases 'expand-load-path)) (add-after 'emacs-expand-load-path 'emacs-add-install-to-native-load-path @@ -3763,9 +3765,7 @@ defined in RFC 2425 and RFC 2426 to/from The Insidious Big Brother Database (add-after 'emacs-add-install-to-native-load-path 'emacs-install (assoc-ref emacs:%standard-phases 'install)) (add-after 'emacs-install 'emacs-build - (assoc-ref emacs:%standard-phases 'build)) - (add-after 'emacs-install 'emacs-make-autoloads - (assoc-ref emacs:%standard-phases 'make-autoloads))))) + (assoc-ref emacs:%standard-phases 'build))))) (native-inputs (list autoconf automake -- cgit v1.2.3 From 60c97924e9519361494aaf0686e28eb831a42315 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 07:38:00 +0200 Subject: gnu: emacs-pdf-tools: Build autoloads before installing them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs-xyz.scm (emacs-pdf-tools)[#:phases]: Move ‘emacs-make-autoloads’ after ‘enter-lisp-dir’. --- gnu/packages/emacs-xyz.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ba08dcd20f..9bb07663ee 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -5375,6 +5375,8 @@ during idle time, while Emacs is doing nothing else.") ;; upgrading" that pdf-tools tries to perform. (emacs-substitute-variables "pdf-tools.el" ("pdf-tools-handle-upgrades" '())))) + (add-after 'enter-lisp-dir 'emacs-make-autoloads + (assoc-ref emacs:%standard-phases 'make-autoloads)) (add-after 'emacs-patch-variables 'emacs-expand-load-path (assoc-ref emacs:%standard-phases 'expand-load-path)) (add-after 'emacs-expand-load-path 'emacs-add-install-to-native-load-path @@ -5382,9 +5384,7 @@ during idle time, while Emacs is doing nothing else.") (add-after 'emacs-add-install-to-native-load-path 'emacs-install (assoc-ref emacs:%standard-phases 'install)) (add-after 'emacs-install 'emacs-build - (assoc-ref emacs:%standard-phases 'build)) - (add-after 'emacs-install 'emacs-make-autoloads - (assoc-ref emacs:%standard-phases 'make-autoloads))))) + (assoc-ref emacs:%standard-phases 'build))))) (native-inputs (list autoconf automake emacs-minimal pkg-config)) (inputs -- cgit v1.2.3 From aae61f54ff6acf5cc0e0355dc85babf29f625660 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 18 Jan 2024 20:45:30 +0100 Subject: gnu: emacs-minimal: Update to 29.2. * gnu/packages/emacs.scm (emacs-minimal): Update to 29.2. --- gnu/packages/emacs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 26bbbc6c9f..5f27c551e0 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -100,14 +100,14 @@ (define-public emacs-minimal (package (name "emacs-minimal") - (version "29.1") + (version "29.2") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/emacs/emacs-" version ".tar.xz")) (sha256 (base32 - "009f7q08vg919b90k2jrsznq73s3n224avz80dd2y7i3rjjq3y6j")) + "1p3h4sz8da8vhix5140g2qkdy8mz11d7mmvsym5vy847k1428gbx")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" "emacs-native-comp-driver-options.patch" -- cgit v1.2.3 From 833ccf20a947e44b0eac3cefdaa185f0eb05b027 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: gnu: emacs: Build trampolines. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs.scm (emacs-no-x)[#:phases]: Add ‘build-trampolines’. Change-Id: I33303bcbaf6cbda15867a5546e793c05d1f0e67b --- gnu/packages/emacs.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 5f27c551e0..e4119ec21d 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -376,7 +376,10 @@ editor (console only)") (string-append "-B" #$(this-package-input "libgccjit") "/lib/") (string-append - "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))))))) + "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))) + (add-after 'build 'build-trampolines + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "trampolines" make-flags))))))) (inputs (modify-inputs (package-inputs emacs-minimal) (prepend gnutls -- cgit v1.2.3 From e2b04973fdcf835d6e6bb9dab1375d7653108f76 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: gnu: emacs: Don't hash file names in native compilation. * gnu/packages/patches/emacs-native-comp-fix-filenames.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/emacs.scm (emacs-minimal)[source]: Use it here. Change-Id: I2b7f6b45742a985760f0097bb53910f068e3d8e5 --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 1 + .../patches/emacs-native-comp-fix-filenames.patch | 338 +++++++++++++++++++++ 3 files changed, 340 insertions(+) create mode 100644 gnu/packages/patches/emacs-native-comp-fix-filenames.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3d1afd4555..7e6a0c5006 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1121,6 +1121,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-kv-fix-tests.patch \ %D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \ %D%/packages/patches/emacs-native-comp-driver-options.patch \ + %D%/packages/patches/emacs-native-comp-fix-filenames.patch \ %D%/packages/patches/emacs-next-exec-path.patch \ %D%/packages/patches/emacs-next-native-comp-driver-options.patch \ %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index e4119ec21d..182de0204d 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -111,6 +111,7 @@ (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" "emacs-native-comp-driver-options.patch" + "emacs-native-comp-fix-filenames.patch" "emacs-pgtk-super-key-fix.patch")) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/emacs-native-comp-fix-filenames.patch b/gnu/packages/patches/emacs-native-comp-fix-filenames.patch new file mode 100644 index 0000000000..169323f290 --- /dev/null +++ b/gnu/packages/patches/emacs-native-comp-fix-filenames.patch @@ -0,0 +1,338 @@ +Upstream hashes both the absolute file name and the content of a file +to derive the name for the natively compiled files. This breaks the +staged install used in guix, as any $GUIX_PROFILE is distinct from +the build directory. It also breaks grafts, as hardcoded store file +names get rewritten; thus changing the file hash. + +In addition, this patch changes how native-comp-eln-load-path is +constructed. Upstream, an entry of the directory “../lisp” is added +supposedly for bootstrap only, but this directory appears to find its +way into the actual variable despite attempts to remove it by calling +‘startup--update-eln-cache’. +The user-visible procedure ‘startup-redirect-eln-cache’ is kept, as +packages may require it, but only pushes the new value now. + +Index: emacs-29.2/src/comp.c +=================================================================== +--- emacs-29.2.orig/src/comp.c ++++ emacs-29.2/src/comp.c +@@ -4396,26 +4396,17 @@ DEFUN ("comp-el-to-eln-rel-filename", Fc + Scomp_el_to_eln_rel_filename, 1, 1, 0, + doc: /* Return the relative name of the .eln file for FILENAME. + FILENAME must exist, and if it's a symlink, the target must exist. +-If FILENAME is compressed, it must have the \".gz\" extension, +-and Emacs must have been compiled with zlib; the file will be +-uncompressed on the fly to hash its contents. +-Value includes the original base name, followed by 2 hash values, +-one for the file name and another for its contents, followed by .eln. */) ++FILENAME is resolved relative to `load-path' and only the suffix of ++the first matching path is kept. If FILENAME is not found to be relative ++to any directory `load-path', it is used as-is to construct the return ++value. */) + (Lisp_Object filename) + { + CHECK_STRING (filename); + +- /* Resolve possible symlinks in FILENAME, so that path_hash below +- always compares equal. (Bug#44701). */ +- filename = Fexpand_file_name (filename, Qnil); +- char *file_normalized = realpath (SSDATA (ENCODE_FILE (filename)), NULL); +- if (file_normalized) +- { +- filename = DECODE_FILE (make_unibyte_string (file_normalized, +- strlen (file_normalized))); +- xfree (file_normalized); +- } ++ Lisp_Object rel_name = filename; + ++ filename = Fexpand_file_name (filename, Qnil); + if (NILP (Ffile_exists_p (filename))) + xsignal1 (Qfile_missing, filename); + +@@ -4423,64 +4414,55 @@ one for the file name and another for it + filename = Fw32_long_file_name (filename); + #endif + +- Lisp_Object content_hash = comp_hash_source_file (filename); +- +- if (suffix_p (filename, ".gz")) +- filename = Fsubstring (filename, Qnil, make_fixnum (-3)); +- +- /* We create eln filenames with an hash in order to look-up these +- starting from the source filename, IOW have a relation +- +- /absolute/path/filename.el + content -> +- eln-cache/filename-path_hash-content_hash.eln. +- +- 'dlopen' can return the same handle if two shared with the same +- filename are loaded in two different times (even if the first was +- deleted!). To prevent this scenario the source file content is +- included in the hashing algorithm. +- +- As at any point in time no more then one file can exist with the +- same filename, should be possible to clean up all +- filename-path_hash-* except the most recent one (or the new one +- being recompiled). +- +- As installing .eln files compiled during the build changes their +- absolute path we need an hashing mechanism that is not sensitive +- to that. For this we replace if match PATH_DUMPLOADSEARCH or +- *PATH_REL_LOADSEARCH with '//' before computing the hash. */ +- +- if (NILP (loadsearch_re_list)) +- { +- Lisp_Object sys_re = +- concat2 (build_string ("\\`[[:ascii:]]+"), +- Fregexp_quote (build_string ("/" PATH_REL_LOADSEARCH "/"))); +- Lisp_Object dump_load_search = +- Fexpand_file_name (build_string (PATH_DUMPLOADSEARCH "/"), Qnil); +-#ifdef WINDOWSNT +- dump_load_search = Fw32_long_file_name (dump_load_search); +-#endif +- loadsearch_re_list = list2 (sys_re, Fregexp_quote (dump_load_search)); +- } ++ Lisp_Object tail = Vload_path; ++ Lisp_Object name_len = Flength (filename); + +- Lisp_Object lds_re_tail = loadsearch_re_list; +- FOR_EACH_TAIL (lds_re_tail) ++ FOR_EACH_TAIL_SAFE (tail) + { +- Lisp_Object match_idx = +- Fstring_match (XCAR (lds_re_tail), filename, Qnil, Qnil); +- if (BASE_EQ (match_idx, make_fixnum (0))) ++ Lisp_Object directory = Ffile_name_as_directory (XCAR (tail)); ++ Lisp_Object len = Flength (directory); ++ if (XFIXNUM (name_len) < XFIXNUM (len)) ++ continue; ++ else if (EQ (Qt, Fcompare_strings (filename, make_fixnum (0), len, ++ directory, make_fixnum (0), len, ++ Qnil))) + { +- filename = +- Freplace_match (build_string ("//"), Qt, Qt, filename, Qnil); ++ filename = Fsubstring (filename, len, Qnil); + break; + } + } +- Lisp_Object separator = build_string ("-"); +- Lisp_Object path_hash = comp_hash_string (filename); +- filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil, +- make_fixnum (-3))), +- separator); +- Lisp_Object hash = concat3 (path_hash, separator, content_hash); +- return concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX)); ++ ++ if (file_name_absolute_p (filename)) /* no match in load-path */ ++ filename = rel_name; ++ ++ Lisp_Object bogus_dirs = ++ Fgetenv_internal (build_string ("NATIVE_COMP_BOGUS_DIRS"), Qnil); ++ ++ if (!NILP (bogus_dirs)) ++ { ++ tail = CALL2I (split-string, bogus_dirs, build_string (":")); ++ ++ FOR_EACH_TAIL_SAFE (tail) ++ { ++ Lisp_Object directory = Ffile_name_as_directory (XCAR (tail)); ++ Lisp_Object len = Flength (directory); ++ if (XFIXNUM (name_len) < XFIXNUM (len)) ++ continue; ++ else if (EQ (Qt, Fcompare_strings (filename, make_fixnum (0), len, ++ directory, make_fixnum (0), len, ++ Qnil))) ++ { ++ filename = Fsubstring (filename, len, Qnil); ++ break; ++ } ++ } ++ } ++ ++ if (suffix_p (filename, ".gz")) ++ filename = Fsubstring (filename, Qnil, make_fixnum (-3)); ++ ++ return concat2(Fsubstring (filename, Qnil, make_fixnum (-3)), ++ build_string (NATIVE_ELISP_SUFFIX)); + } + + DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename, +@@ -4494,13 +4476,7 @@ If BASE-DIR is non-nil, use it as the di + non-absolute BASE-DIR is interpreted as relative to `invocation-directory'. + If BASE-DIR is omitted or nil, look for the first writable directory + in `native-comp-eln-load-path', and use as BASE-DIR its subdirectory +-whose name is given by `comp-native-version-dir'. +-If FILENAME specifies a preloaded file, the directory for the .eln +-file is the \"preloaded/\" subdirectory of the directory determined +-as described above. FILENAME is considered to be a preloaded file if +-the value of `comp-file-preloaded-p' is non-nil, or if FILENAME +-appears in the value of the environment variable LISP_PRELOADED; +-the latter is supposed to be used by the Emacs build procedure. */) ++whose name is given by `comp-native-version-dir'. */) + (Lisp_Object filename, Lisp_Object base_dir) + { + Lisp_Object source_filename = filename; +@@ -4548,10 +4524,11 @@ the latter is supposed to be used by the + Lisp_Object lisp_preloaded = + Fgetenv_internal (build_string ("LISP_PRELOADED"), Qnil); + base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir); ++ bool preloaded = comp_file_preloaded_p; + if (comp_file_preloaded_p + || (!NILP (lisp_preloaded) +- && !NILP (Fmember (CALL1I (file-name-base, source_filename), +- Fmapcar (intern_c_string ("file-name-base"), ++ && !NILP (Fmember (CALL1I (file-name-sans-extension, source_filename), ++ Fmapcar (intern_c_string ("file-name-sans-extension"), + CALL1I (split-string, lisp_preloaded)))))) + base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir); + +@@ -5863,10 +5840,7 @@ The last directory of this list is assum + the system *.eln files, which are the files produced when building + Emacs. */); + +- /* Temporary value in use for bootstrap. We can't do better as +- `invocation-directory' is still unset, will be fixed up during +- dump reload. */ +- Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); ++ Vnative_comp_eln_load_path = Qnil; + + DEFVAR_LISP ("native-comp-enable-subr-trampolines", + Vnative_comp_enable_subr_trampolines, +Index: emacs-29.2/lisp/startup.el +=================================================================== +--- emacs-29.2.orig/lisp/startup.el ++++ emacs-29.2/lisp/startup.el +@@ -545,9 +545,6 @@ DIRS are relative." + (defvar native-comp-jit-compilation) + (defvar native-comp-enable-subr-trampolines) + +-(defvar startup--original-eln-load-path nil +- "Original value of `native-comp-eln-load-path'.") +- + (defun startup-redirect-eln-cache (cache-directory) + "Redirect the user's eln-cache directory to CACHE-DIRECTORY. + CACHE-DIRECTORY must be a single directory, a string. +@@ -558,22 +555,10 @@ to `user-emacs-directory'. + For best results, call this function in your early-init file, + so that the rest of initialization and package loading uses + the updated value." +- ;; Remove the original eln-cache. +- (setq native-comp-eln-load-path (cdr native-comp-eln-load-path)) +- ;; Add the new eln-cache. + (push (expand-file-name (file-name-as-directory cache-directory) + user-emacs-directory) + native-comp-eln-load-path)) + +-(defun startup--update-eln-cache () +- "Update the user eln-cache directory due to user customizations." +- ;; Don't override user customizations! +- (when (equal native-comp-eln-load-path +- startup--original-eln-load-path) +- (startup-redirect-eln-cache "eln-cache") +- (setq startup--original-eln-load-path +- (copy-sequence native-comp-eln-load-path)))) +- + (defun normal-top-level () + "Emacs calls this function when it first starts up. + It sets `command-line-processed', processes the command-line, +@@ -1362,12 +1347,6 @@ please check its value") + startup-init-directory))) + (setq early-init-file user-init-file) + +- ;; Amend `native-comp-eln-load-path', since the early-init file may +- ;; have altered `user-emacs-directory' and/or changed the eln-cache +- ;; directory. +- (when (featurep 'native-compile) +- (startup--update-eln-cache)) +- + ;; If any package directory exists, initialize the package system. + (and user-init-file + package-enable-at-startup +@@ -1502,12 +1481,6 @@ please check its value") + startup-init-directory)) + t) + +- ;; Amend `native-comp-eln-load-path' again, since the early-init +- ;; file may have altered `user-emacs-directory' and/or changed the +- ;; eln-cache directory. +- (when (featurep 'native-compile) +- (startup--update-eln-cache)) +- + (when (and deactivate-mark transient-mark-mode) + (with-current-buffer (window-buffer) + (deactivate-mark))) +Index: emacs-29.2/lisp/loadup.el +=================================================================== +--- emacs-29.2.orig/lisp/loadup.el ++++ emacs-29.2/lisp/loadup.el +@@ -53,6 +53,14 @@ + (setq redisplay--inhibit-bidi t) + + (message "Dump mode: %s" dump-mode) ++;; Compensate for native-comp-eln-load-path being empty by Guix' default. ++(and (featurep 'native-compile) ++ dump-mode ++ (setq ++ native-comp-eln-load-path ++ (cons (expand-file-name "../native-lisp" invocation-directory) ++ native-comp-eln-load-path) ++ comp-file-preloaded-p t)) + + ;; Add subdirectories to the load-path for files that might get + ;; autoloaded when bootstrapping or running Emacs normally. +@@ -494,22 +502,20 @@ lost after dumping"))) + (concat eln-dest-dir "native-lisp/" comp-native-version-dir "/")) + (maphash (lambda (_ cu) + (let* ((file (native-comp-unit-file cu)) +- (preloaded (equal (substring (file-name-directory file) +- -10 -1) +- "preloaded")) +- (eln-dest-dir-eff (if preloaded +- (expand-file-name "preloaded" +- eln-dest-dir) +- eln-dest-dir))) ++ (native-lisp-needle ++ (regexp-quote (concat "native-lisp/" ++ comp-native-version-dir "/")))) + (native-comp-unit-set-file + cu + (cons + ;; Relative filename from the installed binary. +- (file-relative-name (expand-file-name +- (file-name-nondirectory +- file) +- eln-dest-dir-eff) +- bin-dest-dir) ++ (file-relative-name ++ (expand-file-name ++ (save-match-data ++ (string-match native-lisp-needle file) ++ (substring file (match-end 0))) ++ eln-dest-dir) ++ bin-dest-dir) + ;; Relative filename from the built uninstalled binary. + (file-relative-name file invocation-directory))))) + comp-loaded-comp-units-h))) +@@ -557,7 +563,9 @@ lost after dumping"))) + (equal dump-mode "pdump")) + ;; Don't enable this before bootstrap is completed, as the + ;; compiler infrastructure may not be usable yet. +- (setq native-comp-enable-subr-trampolines t)) ++ (setq native-comp-enable-subr-trampolines t ++ ;; We loaded everything we could. ++ comp-file-preloaded-p nil)) + (message "Dumping under the name %s" output) + (condition-case () + (delete-file output) +Index: emacs-29.2/src/Makefile.in +=================================================================== +--- emacs-29.2.orig/src/Makefile.in ++++ emacs-29.2/src/Makefile.in +@@ -553,6 +553,7 @@ shortlisp := $(filter-out ${shortlisp_fi + ## We don't really need to sort, but may as well use it to remove duplicates. + shortlisp := loaddefs.el loadup.el $(sort ${shortlisp}) + export LISP_PRELOADED = ${shortlisp} ++export NATIVE_COMP_BOGUS_DIRS = + lisp = $(addprefix ${lispsource}/,${shortlisp}) + + ## Construct full set of libraries to be linked. -- cgit v1.2.3 From 35fc3027f372eddbd21a2c6b5a591453591a6825 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 24 Feb 2024 07:18:52 +0100 Subject: gnu: emacs: Check integrity of native-compiled files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the previous commit, we've added a patch that potentially messes with how built-in (especially preloaded) Lisp libraries are loaded. Thus, we might want to assert that these files still load fine, as reported when querying the builtin documentation of functions provided by them. * gnu/packages/aux-files/emacs/comp-integrity.el: New file. * gnu/Makefile.am (dist_noinst_DATA): Register it here. * gnu/packages/emacs.scm (emacs-no-x)[#:phases]: Add ‘validate-comp-integrity’. --- Makefile.am | 1 + gnu/packages/aux-files/emacs/comp-integrity.el | 126 +++++++++++++++++++++++++ gnu/packages/emacs.scm | 13 ++- 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/emacs/comp-integrity.el diff --git a/Makefile.am b/Makefile.am index d3b9532c7a..6837c4c87c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -421,6 +421,7 @@ dist_noinst_DATA = \ # Auxiliary files for packages. AUX_FILES = \ gnu/packages/aux-files/chromium/master-preferences.json \ + gnu/packages/aux-files/emacs/comp-integrity.el \ gnu/packages/aux-files/emacs/guix-emacs.el \ gnu/packages/aux-files/findclass.php \ gnu/packages/aux-files/guix.vim \ diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el new file mode 100644 index 0000000000..ed6a348fed --- /dev/null +++ b/gnu/packages/aux-files/emacs/comp-integrity.el @@ -0,0 +1,126 @@ +(require 'ert) + +(eval-when-compile + (require 'help-fns) + + (defmacro expect-help (fun result &optional feature) + `(progn + (eval-when-compile (when ',feature + (require ',feature))) + + (ert-deftest ,(intern (concat "expect-" (symbol-name fun) + "-" (symbol-name result))) + () + (should + (eq ',result + (let ((desc (substring-no-properties + (with-output-to-string + (help-fns-function-description-header ',fun))))) + (cond ((string-search "native-compiled" desc) 'native) + ((string-search "byte-compiled" desc) 'byte) + ((string-search "built-in" desc) 'built-in) + (t nil)))))))) + + (defmacro expect-native (fun &optional feature) + `(progn (expect-help ,fun native ,feature))) + + (defmacro expect-builtin (fun &optional feature) + `(progn (expect-help ,fun built-in ,feature)))) + +(expect-native abbrev-mode) +(expect-native backquote-process) +(expect-native mode-line-widen) +(expect-native buffer-menu) +(expect-native button-mode) +(expect-native byte-run-strip-symbol-positions) +(expect-native case-table-get-table) +(expect-native cconv-convert) +(expect-native use-default-char-width-table) +(expect-native cl-generic-p) +(expect-native cl-struct-define) +(expect-native x-setup-function-keys) +(expect-native encode-composition-rule) +(expect-native custom-declare-face) +(expect-native minibuffer-prompt-properties--setter) +(expect-native custom-add-choice) +(expect-native debug-early) +(expect-native display-table-slot disp-table) +(expect-native dnd-open-file) +(expect-native dos-mode25 dos-fns) +(expect-native find-file-text dos-w32) +(expect-native dynamic-setting-handle-config-changed-event) +(expect-native easy-menu-item-present-p) +(expect-native eldoc-mode) +(expect-native electric-indent-mode) +(expect-native elisp-mode-syntax-propertize) +(expect-native getenv) +(expect-native epa-file-find-file-hook) +(expect-native face-list) +(expect-native find-file-noselect) +(expect-native fill-region) +(expect-native font-lock-change-mode) +(expect-native font-lock-add-keywords) +(expect-native fontset-plain-name) +(expect-native format-read) +(expect-native frame-edges) +(expect-native fringe-mode) +(expect-native help-quick) +(expect-native image-type) +(expect-native indent-region) +(expect-native indian-compose-regexp) +(expect-native msdos-setup-keyboard term/internal) +(expect-native isearch-abort) +(expect-native iso-transl-set-language) +(expect-native jit-lock-mode) +(expect-native jka-compr-build-file-regexp) +(expect-native keymap-global-set) +(expect-native forward-sexp) +(expect-native lisp-string-in-doc-position-p) +(expect-native ls-lisp-set-options ls-lisp) +(expect-native macroexp-compiling-p) +(expect-native map-y-or-n-p) +(expect-native menu-find-file-existing) +(expect-native completion-boundaries) +(expect-native egyptian-shape-grouping) +(expect-native mouse-double-click-time) +(expect-native convert-define-charset-argument) +(expect-native coding-system-change-eol-conversion) +(expect-native store-substring mule-util) +(expect-native mouse-wheel-change-button) +(expect-native advice-function-mapc) +(expect-native comment-string-strip) +(expect-native obarray-make) +(expect-native oclosure-type) +(expect-native forward-page) +(expect-native sentence-end) +(expect-native show-paren-function) +(expect-native pgtk-dnd-init-frame pgtk-dnd) +(expect-native prog-context-menu) +(expect-native regexp-opt) +(expect-native get-register) +(expect-native query-replace-descr) +(expect-native rfn-eshadow-setup-minibuffer) +(expect-native read-multiple-choice) +(expect-native scroll-bar-scale) +(expect-native gui-select-text) +(expect-native seq-first) +(expect-native hack-read-symbol-shorthands) +(expect-native next-error-find-buffer) +(expect-native exit-splash-screen) +(expect-native buffer-local-boundp) +(expect-native syntax-propertize-multiline) +(expect-native tab-bar-mode) +(expect-native tabulated-list-put-tag) +(expect-native text-mode) +(expect-native timer-activate) +(expect-native tool-bar-mode) +(expect-native tooltip-mode) +(expect-native tty-color-desc) +(expect-native ucs-normalize-hfs-nfd-comp-p ucs-normalize) +(expect-native uniquify-item-p) +(expect-native vc-mode) +(expect-native emacs-version) +(expect-native define-widget) +(expect-native window-right) +(expect-native x-dnd-init-frame) +(expect-native x-handle-no-bitmap-icon) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 182de0204d..f0200ad27c 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -380,7 +380,18 @@ editor (console only)") "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))) (add-after 'build 'build-trampolines (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "trampolines" make-flags))))))) + (apply invoke "make" "trampolines" make-flags))) + (add-after 'validate-runpath 'validate-comp-integrity + (lambda* (#:key outputs #:allow-other-keys) + (if #$(%current-target-system) + (display "Cannot validate native-comp on cross builds.\n") + (invoke + (string-append (assoc-ref outputs "out") "/bin/emacs") + "--batch" + "--load" + #$(local-file + (search-auxiliary-file "emacs/comp-integrity.el")) + "-f" "ert-run-tests-batch-and-exit")))))))) (inputs (modify-inputs (package-inputs emacs-minimal) (prepend gnutls -- cgit v1.2.3 From 3621493e4cc9f83253d7f191b783fd11212c7045 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: gnu: emacs: Disable jit compilation. * gnu/packages/patches/emacs-disable-jit-compilation.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/emacs.scm (emacs-minimal)[patches]: Use it here. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 3 ++- .../patches/emacs-disable-jit-compilation.patch | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/emacs-disable-jit-compilation.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7e6a0c5006..9121f13b39 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1112,6 +1112,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch \ %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \ %D%/packages/patches/emacs-elpy-dup-test-name.patch \ + %D%/packages/patches/emacs-disable-jit-compilation.patch \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-git-email-missing-parens.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index f0200ad27c..e6f2b699ac 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -108,7 +108,8 @@ (sha256 (base32 "1p3h4sz8da8vhix5140g2qkdy8mz11d7mmvsym5vy847k1428gbx")) - (patches (search-patches "emacs-exec-path.patch" + (patches (search-patches "emacs-disable-jit-compilation.patch" + "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" "emacs-native-comp-driver-options.patch" "emacs-native-comp-fix-filenames.patch" diff --git a/gnu/packages/patches/emacs-disable-jit-compilation.patch b/gnu/packages/patches/emacs-disable-jit-compilation.patch new file mode 100644 index 0000000000..8b1ac5a9df --- /dev/null +++ b/gnu/packages/patches/emacs-disable-jit-compilation.patch @@ -0,0 +1,19 @@ +Index: emacs-29.2/src/comp.c +=================================================================== +--- emacs-29.2.orig/src/comp.c ++++ emacs-29.2/src/comp.c +@@ -5648,8 +5648,12 @@ For internal use. */); + doc: /* If non-nil, compile loaded .elc files asynchronously. + + After compilation, each function definition is updated to use the +-natively-compiled one. */); +- native_comp_jit_compilation = true; ++natively-compiled one. This variable is enabled by default upstream, ++but disabled in Guix to better make use of precompiled packages. ++Notably, Guix removes the hashes that prevent inadvertent shadowing ++frm the file names of compiled libraries in order to facilitate grafts. ++Enable at your own risk! */); ++ native_comp_jit_compilation = false; + + DEFSYM (Qnative_comp_speed, "native-comp-speed"); + DEFSYM (Qnative_comp_debug, "native-comp-debug"); -- cgit v1.2.3 From 56a7c1308a1f1601299b8c7706fb4d00d5c185d0 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: build-system: emacs: Compute relative file names. With the previous commit, relative file names are expanded relative to ELN_DIR -- more or less. To make use of this in emacs-build-system, we must also pass relative file names. * guix/build/emacs-build-system.scm (emacs-compile-directory): Compute the relative file names of the files to compile. Change-Id: I8983f80fb0fe1573e46748222403ba8873f1599f --- guix/build/emacs-utils.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 8e12b5b6d4..eca42bf305 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -146,7 +146,9 @@ If native code is not supported, compile to bytecode instead." (cadr native-comp-eln-load-path)))) (if byte+native-compile (native-compile file - (comp-el-to-eln-filename file eln-dir)) + (comp-el-to-eln-filename + (file-relative-name file ,dir) + eln-dir)) (byte-compile-file file)) ;; After native compilation, write the bytecode file. (unless (null byte-to-native-output-buffer-file) -- cgit v1.2.3 From 6c43744210652d4031a4ca0dd5b6630b6adc40e1 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: gnu: emacs-org: Fix native builds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs-xyz.scm (emacs-org)[#:phases]: Wrap ‘build’ in a directory excursion to the actual lisp directory. Change-Id: Ifa10f9e91fe21cd4c34da11b68ddb77a03d847ca --- gnu/packages/emacs-xyz.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index fc3c9e00be..e2aebe971e 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -16752,6 +16752,10 @@ passive voice.") (substitute* "testing/lisp/test-org.el" (("test-org/org-(encode-time|time-string-to-time) .*" all) (string-append all " (skip-unless nil)\n"))))) + (replace 'build + (lambda args + (with-directory-excursion "lisp" + (apply (assoc-ref %standard-phases 'build) args)))) (replace 'install (lambda _ (let ((elpa (elpa-directory #$output)) -- cgit v1.2.3 From 9160cccd767cdfa55f7a460750c6b0f7544c12eb Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 13 Feb 2024 19:30:50 +0100 Subject: gnu: emacs-magit: Fix native builds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emacs-xyz.scm (emacs-magit)[#:phases]: Also wrap ‘build’ in a directory excursion. Change-Id: I332325989a1bbaa95552c2cbf50f336f0075c1c4 --- gnu/packages/emacs-xyz.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index e2aebe971e..a0ac8f5a57 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -1590,7 +1590,11 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.") (replace 'install (lambda args (with-directory-excursion "lisp" - (apply (assoc-ref %standard-phases 'install) args))))))) + (apply (assoc-ref %standard-phases 'install) args)))) + (replace 'build + (lambda args + (with-directory-excursion "lisp" + (apply (assoc-ref %standard-phases 'build) args))))))) (native-inputs (list texinfo)) (inputs -- cgit v1.2.3 From 7f3f70eedbbec74481a0ca9fea4c19250961685e Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 2 Mar 2024 16:56:13 +0100 Subject: guix: emacs-utils: Make emacs-compile-directory forwards-compatible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer (development) builds of Emacs 30 mark a number of functions related to native compilation as ‘internal’. Since we rely on such functions and there does not appear to be a high-level replacement at the moment, let's work around this case. * guix/build/emacs-utils.scm (emacs-compile-directory): Require comp early and check if ‘comp-write-bytecode-file’ is available. Fixes: Upstream renamed comp-write-bytecode-file --- guix/build/emacs-utils.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index eca42bf305..aeb364133a 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -136,7 +136,14 @@ If native code is not supported, compile to bytecode instead." (emacs-batch-eval `(let ((byte-compile-debug t) ; for proper exit status (byte+native-compile (native-comp-available-p)) - (files (directory-files-recursively ,dir "\\.el$"))) + (files (directory-files-recursively ,dir "\\.el$")) + (write-bytecode + (and (native-comp-available-p) + (progn + (require 'comp) + (if (fboundp 'comp-write-bytecode-file) + 'comp-write-bytecode-file + 'comp--write-bytecode-file))))) (mapc (lambda (file) (let (byte-to-native-output-buffer-file @@ -152,7 +159,7 @@ If native code is not supported, compile to bytecode instead." (byte-compile-file file)) ;; After native compilation, write the bytecode file. (unless (null byte-to-native-output-buffer-file) - (comp-write-bytecode-file nil)))) + (funcall write-bytecode nil)))) files)) #:dynamic? #t)) -- cgit v1.2.3 From 84e125eb27bc97dc00c260bb03238447134f6d5c Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 2 Mar 2024 17:13:32 +0100 Subject: gnu: emacs-next-minimal: Update to 30.0.50-2.170c655. * gnu/packages/emacs.scm (emacs-next-minimal): Update to 30.0.50-2.170c655. * gnu/packages/aux-files/emacs/comp-integrity.el: Adjust accordingly. --- gnu/packages/aux-files/emacs/comp-integrity.el | 5 ++++- gnu/packages/emacs.scm | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el index ed6a348fed..9692d9bf97 100644 --- a/gnu/packages/aux-files/emacs/comp-integrity.el +++ b/gnu/packages/aux-files/emacs/comp-integrity.el @@ -89,7 +89,10 @@ (expect-native mouse-wheel-change-button) (expect-native advice-function-mapc) (expect-native comment-string-strip) -(expect-native obarray-make) +(if (>= emacs-major-version 30) + (expect-builtin obarray-make) + (expect-native obarray-make)) +(expect-native obarray-map) (expect-native oclosure-type) (expect-native forward-page) (expect-native sentence-end) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index e6f2b699ac..e89c6cff16 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -549,8 +549,8 @@ editor (with wide ints)" ) #~(cons "--with-wide-int" #$flags)))))) (define-public emacs-next-minimal - (let ((commit "9d27b95b263473fb41a30e3f6ea5607c99e93a61") - (revision "1")) + (let ((commit "170c6557922dad7e6e9bc0d6dadf6c080108fd42") + (revision "2")) (package (inherit emacs-minimal) (name "emacs-next-minimal") @@ -563,7 +563,7 @@ editor (with wide ints)" ) (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "00mwpq1msr3jij281w5piqmbwq968xr8dn9hqbf4r947ck754kn9")) + (base32 "04carva3b6h9fnlzazrsxsj41hcnjc26kxjij07l159azi40l6sk")) (patches (search-patches "emacs-next-exec-path.patch" "emacs-fix-scheme-indent-function.patch" -- cgit v1.2.3 From 19fc252ab7e86ad1443a8d16f68467c61bf23179 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Mon, 4 Mar 2024 20:54:49 +0100 Subject: aux-files: comp-integrity: Adjust for emacs-pgtk. * gnu/packages/aux-files/emacs/comp-integrity.el (x-dnd-init-frame): Require x-dnd. (x-handle-no-bitmap-icon): Only test this if it's bound. --- gnu/packages/aux-files/emacs/comp-integrity.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el index 9692d9bf97..191e2ddb98 100644 --- a/gnu/packages/aux-files/emacs/comp-integrity.el +++ b/gnu/packages/aux-files/emacs/comp-integrity.el @@ -125,5 +125,6 @@ (expect-native emacs-version) (expect-native define-widget) (expect-native window-right) -(expect-native x-dnd-init-frame) -(expect-native x-handle-no-bitmap-icon) +(expect-native x-dnd-init-frame x-dnd) +(and (boundp 'x-handle-no-bitmap-icon) + (expect-native x-handle-no-bitmap-icon)) -- cgit v1.2.3 From 9e22ef64adefbc226d0e4ceb99b5823d9df99a3f Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Fri, 22 Mar 2024 22:45:13 +0100 Subject: gnu: emacs: Only verify integrity of bound symbols. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some variants, like emacs-no-x, come with a reduced set of preloaded symbols, so don't expect them to always be native. * gnu/packages/aux-files/emacs/comp-integrity.el (expect-native-if-bound): New function. (x-setup-function-keys, dynamic-setting-handle-config-changed-event) (fontset-plain-name, fringe-mode, image-type, regexp-opt, scroll-bar-scale): Use ‘expect-native-if-bound’. (x-handle-no-bitmap-icon): Likewise, was already conditional. --- gnu/packages/aux-files/emacs/comp-integrity.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el index 191e2ddb98..abe7e7c0c9 100644 --- a/gnu/packages/aux-files/emacs/comp-integrity.el +++ b/gnu/packages/aux-files/emacs/comp-integrity.el @@ -24,6 +24,9 @@ (defmacro expect-native (fun &optional feature) `(progn (expect-help ,fun native ,feature))) + (defmacro expect-native-if-bound (fun) + `(and (boundp ',fun) (expect-help ,fun native))) + (defmacro expect-builtin (fun &optional feature) `(progn (expect-help ,fun built-in ,feature)))) @@ -38,7 +41,7 @@ (expect-native use-default-char-width-table) (expect-native cl-generic-p) (expect-native cl-struct-define) -(expect-native x-setup-function-keys) +(expect-native-if-bound x-setup-function-keys) (expect-native encode-composition-rule) (expect-native custom-declare-face) (expect-native minibuffer-prompt-properties--setter) @@ -48,7 +51,7 @@ (expect-native dnd-open-file) (expect-native dos-mode25 dos-fns) (expect-native find-file-text dos-w32) -(expect-native dynamic-setting-handle-config-changed-event) +(expect-native-if-bound dynamic-setting-handle-config-changed-event) (expect-native easy-menu-item-present-p) (expect-native eldoc-mode) (expect-native electric-indent-mode) @@ -60,12 +63,12 @@ (expect-native fill-region) (expect-native font-lock-change-mode) (expect-native font-lock-add-keywords) -(expect-native fontset-plain-name) +(expect-native-if-bound fontset-plain-name) (expect-native format-read) (expect-native frame-edges) -(expect-native fringe-mode) +(expect-native-if-bound fringe-mode) (expect-native help-quick) -(expect-native image-type) +(expect-native-if-bound image-type) (expect-native indent-region) (expect-native indian-compose-regexp) (expect-native msdos-setup-keyboard term/internal) @@ -86,7 +89,7 @@ (expect-native convert-define-charset-argument) (expect-native coding-system-change-eol-conversion) (expect-native store-substring mule-util) -(expect-native mouse-wheel-change-button) +(expect-native-if-bound mouse-wheel-change-button) (expect-native advice-function-mapc) (expect-native comment-string-strip) (if (>= emacs-major-version 30) @@ -99,12 +102,12 @@ (expect-native show-paren-function) (expect-native pgtk-dnd-init-frame pgtk-dnd) (expect-native prog-context-menu) -(expect-native regexp-opt) +(expect-native-if-bound regexp-opt) (expect-native get-register) (expect-native query-replace-descr) (expect-native rfn-eshadow-setup-minibuffer) (expect-native read-multiple-choice) -(expect-native scroll-bar-scale) +(expect-native-if-bound scroll-bar-scale) (expect-native gui-select-text) (expect-native seq-first) (expect-native hack-read-symbol-shorthands) @@ -126,5 +129,4 @@ (expect-native define-widget) (expect-native window-right) (expect-native x-dnd-init-frame x-dnd) -(and (boundp 'x-handle-no-bitmap-icon) - (expect-native x-handle-no-bitmap-icon)) +(expect-native-if-bound x-handle-no-bitmap-icon) -- cgit v1.2.3 From c7252a2c1475bf34b5d4ae940ccafc2cdcd36bb2 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 26 Mar 2024 21:55:08 +0100 Subject: gnu: emacs: Update to 29.3. * gnu/packages/emacs.scm (emacs-minimal): Update to 29.3. --- gnu/packages/emacs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index e89c6cff16..40a44f6e0c 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -100,14 +100,14 @@ (define-public emacs-minimal (package (name "emacs-minimal") - (version "29.2") + (version "29.3") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/emacs/emacs-" version ".tar.xz")) (sha256 (base32 - "1p3h4sz8da8vhix5140g2qkdy8mz11d7mmvsym5vy847k1428gbx")) + "1822swrk4ifmkd4h9l0h37zifcpa1w3sy3vsgyffsrp6mk9hak63")) (patches (search-patches "emacs-disable-jit-compilation.patch" "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" -- cgit v1.2.3 From a9e65e0341d5045e425e3cf8d741a3d13cfa35a1 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 26 Mar 2024 22:09:51 +0100 Subject: gnu: emacs-org: Update to 9.6.24. * gnu/packages/emacs-xyz.scm (emacs-org): Update to 9.6.24. --- gnu/packages/emacs-xyz.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 24399879d8..b8d2946cba 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -16886,7 +16886,7 @@ passive voice.") (define-public emacs-org (package (name "emacs-org") - (version "9.6.19") + (version "9.6.24") (source (origin (method git-fetch) @@ -16895,7 +16895,7 @@ passive voice.") (commit (string-append "release_" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0yxicr9z6drsaybp8jl0jmslcqbz0np4gzzkr70j8pq3x9y69i7z")))) + (base32 "1ry7zqv25zbh2lvmirm8vyxc55zggf7s7508nkf4yfs4yayr7rnw")))) (build-system emacs-build-system) (arguments (list -- cgit v1.2.3 From ce999ae3a2e73c69d29e1e88c6537f90f813e1ea Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Thu, 28 Mar 2024 19:20:04 +0100 Subject: gnu: emacs-no-x: Skip integrity test on armhf-linux. * gnu/packages/emacs.scm (emacs-no-x)[#:phases]: Move checks to GExpression expansion. Add check against armhf-linux. --- gnu/packages/emacs.scm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 40a44f6e0c..a30e0b9b40 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -384,15 +384,19 @@ editor (console only)") (apply invoke "make" "trampolines" make-flags))) (add-after 'validate-runpath 'validate-comp-integrity (lambda* (#:key outputs #:allow-other-keys) - (if #$(%current-target-system) - (display "Cannot validate native-comp on cross builds.\n") - (invoke - (string-append (assoc-ref outputs "out") "/bin/emacs") - "--batch" - "--load" - #$(local-file - (search-auxiliary-file "emacs/comp-integrity.el")) - "-f" "ert-run-tests-batch-and-exit")))))))) + #$(cond + ((%current-target-system) + #~(display "Cannot validate native-comp on cross builds.\n")) + ((string=? (%current-system) "armhf-linux") + #~(display "Integrity test is broken on armhf.\n")) + (else + #~(invoke + (string-append (assoc-ref outputs "out") "/bin/emacs") + "--batch" + "--load" + #$(local-file + (search-auxiliary-file "emacs/comp-integrity.el")) + "-f" "ert-run-tests-batch-and-exit"))))))))) (inputs (modify-inputs (package-inputs emacs-minimal) (prepend gnutls -- cgit v1.2.3