From cf0f72e4a48ac7029d7f6758b182d4bb559f8f49 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 29 May 2022 01:09:53 +0300 Subject: [PATCH] mu4e: use mu4e-config instead of mu4e-meta All these changes to avoid: ,---- | mu4e/meson.build:92: WARNING: Source item '/home/djcb/Sources/mu/build/mu4e/mu4e-meta.el' cannot be converted to File object, because it is a generated file. This will become a hard error in the future `---- This is because we want to byte-compile a file we just before generated using configure_file. This does not seem like a crazy thing, but meson threatens with breaking the build at some point in the future. So instead, we decide _not_ to compile this (very boring) file. But, users may still have an older mu4e-meta.elc lying around, leading to confusion. So, let's rename that file and we're golden. --- .gitignore | 2 +- configure.ac | 2 +- mu4e/Makefile.am | 2 +- mu4e/meson.build | 39 ++++++++++----------- mu4e/mu4e-actions.el | 1 - mu4e/{mu4e-meta.el.in => mu4e-config.el.in} | 3 +- mu4e/mu4e-helpers.el | 1 + mu4e/mu4e-server.el | 1 - mu4e/mu4e-vars.el | 1 - 9 files changed, 25 insertions(+), 27 deletions(-) rename mu4e/{mu4e-meta.el.in => mu4e-config.el.in} (91%) diff --git a/.gitignore b/.gitignore index 0a647293..88ee280a 100644 --- a/.gitignore +++ b/.gitignore @@ -89,7 +89,7 @@ test-sexp-parser test-scanner /guile/tests/test-mu-guile -mu4e-meta.el +mu4e-config.el mu4e.pdf texinfo.tex texi.texi diff --git a/configure.ac b/configure.ac index 50f9659b..09145888 100644 --- a/configure.ac +++ b/configure.ac @@ -257,7 +257,7 @@ lib/utils/Makefile lib/message/Makefile lib/index/Makefile mu4e/Makefile -mu4e/mu4e-meta.el +mu4e/mu4e-config.el guile/Makefile guile/mu/Makefile guile/examples/Makefile diff --git a/mu4e/Makefile.am b/mu4e/Makefile.am index 48f99b53..92bf39dc 100644 --- a/mu4e/Makefile.am +++ b/mu4e/Makefile.am @@ -37,7 +37,7 @@ dist_lisp_LISP= \ mu4e-main.el \ mu4e-mark.el \ mu4e-message.el \ - mu4e-meta.el \ + mu4e-config.el \ mu4e-org.el \ mu4e-search.el \ mu4e-server.el \ diff --git a/mu4e/meson.build b/mu4e/meson.build index c32d63c1..6369dc20 100644 --- a/mu4e/meson.build +++ b/mu4e/meson.build @@ -14,9 +14,15 @@ ## along with this program; if not, write to the Free Software Foundation, ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# where the lisp goes +lispdir = join_paths(datadir, 'emacs', 'site-lisp', 'mu4e') + +# generate some build data for use in mu4e mu4e_meta = configure_file( - input: 'mu4e-meta.el.in', - output: 'mu4e-meta.el', + input: 'mu4e-config.el.in', + output: 'mu4e-config.el', + install: true, + install_dir: lispdir, configuration: { 'VERSION' : meson.project_version(), # project_build_root() with meson >= 0.56 @@ -24,7 +30,7 @@ mu4e_meta = configure_file( 'MU_DOC_DIR' : join_paths(datadir, 'doc', 'mu'), }) -mu4e_plain_srcs=[ +mu4e_srcs=[ 'mu4e-actions.el', 'mu4e-bookmarks.el', 'mu4e-compose.el', @@ -51,27 +57,20 @@ mu4e_plain_srcs=[ 'obsolete/org-mu4e.el', ] -mu4e_gen_srcs=[ - join_paths(meson.current_build_dir(), 'mu4e-meta.el'), -] - -mu4e_all_srcs = mu4e_plain_srcs -mu4e_all_srcs += mu4e_gen_srcs +# note, we cannot compile mu4e-config.el without incurring +# WARNING: Source item +# '[...]/build/mu4e/mu4e-meta.el' cannot be converted to File object, because +# it is a generated file. This will become a hard error in the future. +# +#... so let's not do that! # hack-around for native compile issue: copy sources to builddir. # see: https://debbugs.gnu.org/db/47/47987.html -foreach src : mu4e_plain_srcs +foreach src : mu4e_srcs configure_file(input: src, output:'@BASENAME@.el', copy:true) endforeach - -# XXX: this yields a warning: mu4e/meson.build:86: WARNING: Source item -# '[...]/build/mu4e/mu4e-meta.el' cannot be converted to File object, because -# it is a generated file. This will become a hard error in the future. -# unsure how to best avoid that. - -lispdir = join_paths(datadir, 'emacs', 'site-lisp', 'mu4e') -foreach src : mu4e_all_srcs +foreach src : mu4e_srcs target_name= '@BASENAME@.elc' target_path = join_paths(meson.current_build_dir(), target_name) target_func = '(setq byte-compile-dest-file-function(lambda(_) "' + target_path + '"))' @@ -92,8 +91,8 @@ foreach src : mu4e_all_srcs '--funcall', 'batch-byte-compile', '@INPUT@']) endforeach -# also install the sources. -install_data(mu4e_all_srcs, install_dir: lispdir) +# also install the sources and the config +install_data(mu4e_srcs, install_dir: lispdir) # install mu4e-about.org install_data('mu4e-about.org', install_dir : join_paths(datadir, 'doc', 'mu')) diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index bd43a701..164ee416 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -32,7 +32,6 @@ (require 'mu4e-helpers) (require 'mu4e-message) (require 'mu4e-search) -(require 'mu4e-meta) ;;; Count lines diff --git a/mu4e/mu4e-meta.el.in b/mu4e/mu4e-config.el.in similarity index 91% rename from mu4e/mu4e-meta.el.in rename to mu4e/mu4e-config.el.in index 47d242db..22a6263f 100644 --- a/mu4e/mu4e-meta.el.in +++ b/mu4e/mu4e-config.el.in @@ -1,4 +1,5 @@ ;; auto-generated + (defconst mu4e-mu-version "@VERSION@" "Required mu binary version; mu4e's version must agree with this.") @@ -8,4 +9,4 @@ (defconst mu4e-doc-dir "@MU_DOC_DIR@" "Mu4e's data-dir.") -(provide 'mu4e-meta) +(provide 'mu4e-config) diff --git a/mu4e/mu4e-helpers.el b/mu4e/mu4e-helpers.el index da1dec68..79999aec 100644 --- a/mu4e/mu4e-helpers.el +++ b/mu4e/mu4e-helpers.el @@ -31,6 +31,7 @@ (require 'ido) (require 'cl-lib) +(require 'mu4e-config) ;;; Customization diff --git a/mu4e/mu4e-server.el b/mu4e/mu4e-server.el index 3ebec34a..d5b17a07 100644 --- a/mu4e/mu4e-server.el +++ b/mu4e/mu4e-server.el @@ -25,7 +25,6 @@ ;;; Code: (require 'mu4e-helpers) -(require 'mu4e-meta) ;;; Configuration diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el index f8fa7769..63281911 100644 --- a/mu4e/mu4e-vars.el +++ b/mu4e/mu4e-vars.el @@ -24,7 +24,6 @@ ;;; Code: -(require 'mu4e-meta) (require 'message) (require 'mu4e-helpers)