diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-12-24 14:30:23 +0200 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-12-24 14:36:35 +0200 |
| commit | da246bba4439271bff04fca6ea4aaba5bad3ca4b (patch) | |
| tree | 68f8e15cd62ed7e2951942d8f5f093c2f7e77760 /mu4e | |
| parent | 42731b141140d7e3e334eb5f4474c9f36ad8a51b (diff) | |
mu4e: install non-byte-compiled elisp files
Even when we're not able to byte-compile some elisp files (mu4e-transient,
mu4e-dbus), we should still install the corresponding el file, as the runtime
emacs may be able to use it.
Issue #2894.
Diffstat (limited to 'mu4e')
| -rw-r--r-- | mu4e/meson.build | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/mu4e/meson.build b/mu4e/meson.build index 5f0da4d..fab8565 100644 --- a/mu4e/meson.build +++ b/mu4e/meson.build @@ -73,18 +73,27 @@ mu4e_srcs=[ 'mu4e.el' ] +# 'bc'->byte-compile. The above should always be byte-compiled. +mu4e_bc_srcs = mu4e_srcs + # emacs 28 is guaranteed to have transient # not very elegant, but # https://stackoverflow.com/questions/49221792/byte-compile-file-only-when-library-is-found +mu4e_srcs += 'mu4e-transient.el' if emacs28.found() - mu4e_srcs += 'mu4e-transient.el' + mu4e_bc_srcs += 'mu4e-transient.el' +else + message('mu4e-transient.el cannot be byte-compiled') endif # do have we have dbus support? +mu4e_srcs += 'mu4e-dbus.el' emacs_dbus = run_command(emacs, '--batch', '--eval', '(kill-emacs (if (featurep \'dbusbind) 0 1))', check: false) if emacs_dbus.returncode() == 0 - mu4e_srcs += 'mu4e-dbus.el' + mu4e_bc_srcs += 'mu4e-dbus.el' +else + message('mu4e-dbus.el cannot be byte-compiled') endif # note, we cannot compile mu4e-config.el without incurring @@ -94,17 +103,13 @@ endif # #... so let's not do that! -foreach src : mu4e_srcs +# byte compile the sources that can be byte-compiled. This may exclude mu4e-transient.el and +# mu4e-dbus.el +foreach src : mu4e_bc_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 + '"))' - # hack-around for native compile issue: copy sources to builddir. - # see: https://debbugs.gnu.org/db/47/47987.html - configure_file(input: src, output:'@BASENAME@.el', copy:true, - install_mode: 'r--r--r--') - # seems meson ignores 'install_mode' for copy (1.5.1, 1.6.1) - custom_target(src.underscorify() + '_el', build_by_default: true, input: src, @@ -125,6 +130,14 @@ foreach src : mu4e_srcs '--funcall', 'batch-byte-compile', '@INPUT@']) endforeach +# hack-around for native compile issue: copy sources to builddir. +# see: https://debbugs.gnu.org/db/47/47987.html +foreach src : mu4e_srcs + configure_file(input: src, output:'@BASENAME@.el', copy:true, + install_mode: 'r--r--r--') + # seems meson ignores 'install_mode' for copy (1.5.1, 1.6.1) +endforeach + # this depends on the above hack: all mu4e elisp files needs to be in builddir mu4e_autoloads = configure_file( output: 'mu4e-autoloads.el', |
