mirror of https://github.com/djcb/mu.git
build: make meson the default build system
We still support autotools for now, but it is no longer the default.
This commit is contained in:
parent
286d6f70c8
commit
975604d3ee
|
@ -0,0 +1,43 @@
|
||||||
|
## Copyright (C) 2008-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
|
##
|
||||||
|
## This program is free software; you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation; either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program; if not, write to the Free Software Foundation,
|
||||||
|
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
|
# Makefile with some useful targets for meson/ninja
|
||||||
|
|
||||||
|
NINJA ?= ninja
|
||||||
|
BUILDDIR ?= $(CURDIR)/build
|
||||||
|
MESON ?= meson
|
||||||
|
|
||||||
|
all: $(BUILDDIR)
|
||||||
|
$(NINJA) -C $(BUILDDIR)
|
||||||
|
|
||||||
|
$(BUILDDIR):
|
||||||
|
$(MESON) $(BUILDDIR)
|
||||||
|
|
||||||
|
check: test
|
||||||
|
|
||||||
|
test: $(BUILDDIR)
|
||||||
|
@cd $(BUILDDIR); $(MESON) test
|
||||||
|
|
||||||
|
dist: $(BUILDDIR)
|
||||||
|
@cd $(BUILDDIR); $(MESON) dist
|
||||||
|
|
||||||
|
install: $(BUILDDIR)
|
||||||
|
@cd $(BUILDDIR); $(MESON) install
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@test -d $(BUILDDIR) && $(NINJA) -C $(BUILDDIR) clean
|
||||||
|
|
31
autogen.sh
31
autogen.sh
|
@ -1,34 +1,29 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Run this to generate all the initial makefiles, etc.
|
# Run this to generate all the initial makefiles, etc.
|
||||||
|
|
||||||
|
echo "*** meson build setup"
|
||||||
|
|
||||||
test -f mu/mu.cc || {
|
test -f mu/mu.cc || {
|
||||||
echo "*** Run this script from the top-level mu source directory"
|
echo "*** Run this script from the top-level mu source directory"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# opportunistically; usually not needed, but occasionally it'll
|
BUILDDIR=build
|
||||||
# avoid build errors that would otherwise confuse users.
|
|
||||||
test -f Makefile && {
|
|
||||||
echo "*** clear out old things"
|
|
||||||
make distclean 2> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
|
command -v meson 2> /dev/null
|
||||||
command -V autoreconf > /dev/null
|
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "*** No autoreconf found, please install it ***"
|
echo "*** No meson found, please install it ***"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f config.cache
|
# we could remove build/ but let's avoid rm -rf risks...
|
||||||
rm -rf autom4te.cache
|
if test -d ${BUILDDIR}; then
|
||||||
|
meson --reconfigure ${BUILDDIR}
|
||||||
autoreconf --force --install --verbose || exit $?
|
|
||||||
|
|
||||||
if test -z "$*"; then
|
|
||||||
echo "# Configuring without parameters"
|
|
||||||
else
|
else
|
||||||
echo "# Configure with parameters $*"
|
meson ${BUILDDIR} $@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./configure --config-cache $@
|
# Add a Makefile with some useful target
|
||||||
|
cp Makefile.meson Makefile
|
||||||
|
|
||||||
|
echo "*** Now run 'ninja -C ${BUILDDIR}' to build mu"
|
||||||
|
|
|
@ -363,6 +363,10 @@ AS_IF([test "x$ac_cv_header_wordexp_h" != "xyes"],[
|
||||||
echo " --maildir=/home/user/Maildir"
|
echo " --maildir=/home/user/Maildir"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
echo "NOTE: autotools support has been deprecated and will be removed"
|
||||||
|
echo " after the next stable release. use the meson build instead"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Now, type 'make' (or 'gmake') to build mu"
|
echo "Now, type 'make' (or 'gmake') to build mu"
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -23,7 +23,7 @@ mu4e_meta = configure_file(
|
||||||
'VERSION' : meson.project_version(),
|
'VERSION' : meson.project_version(),
|
||||||
# project_build_root() with meson >= 0.56
|
# project_build_root() with meson >= 0.56
|
||||||
'abs_top_builddir': join_paths(meson.build_root()),
|
'abs_top_builddir': join_paths(meson.build_root()),
|
||||||
'MU_DOC_DIR' : join_paths(datadir, 'doc', 'mu')
|
'MU_DOC_DIR' : join_paths(datadir, 'doc', 'mu'),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,6 +53,13 @@ mu4e_srcs=[
|
||||||
'obsolete/org-mu4e.el',
|
'obsolete/org-mu4e.el',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# with (development) emacs 28.50 / native compilation this doesn't
|
||||||
|
# _quite_ work; see: https://debbugs.gnu.org/db/47/47987.html
|
||||||
|
#
|
||||||
|
lispdir = join_paths(datadir, 'emacs', 'site-lisp', 'mu4e')
|
||||||
|
|
||||||
foreach src : mu4e_srcs
|
foreach src : mu4e_srcs
|
||||||
target_name= '@BASENAME@.elc'
|
target_name= '@BASENAME@.elc'
|
||||||
target_path = join_paths(meson.current_build_dir(), target_name)
|
target_path = join_paths(meson.current_build_dir(), target_name)
|
||||||
|
@ -61,6 +68,8 @@ foreach src : mu4e_srcs
|
||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
input: src,
|
input: src,
|
||||||
output: target_name,
|
output: target_name,
|
||||||
|
install_dir: lispdir,
|
||||||
|
install: true,
|
||||||
command: [emacs,
|
command: [emacs,
|
||||||
'--no-init-file',
|
'--no-init-file',
|
||||||
'--batch',
|
'--batch',
|
||||||
|
@ -70,6 +79,9 @@ foreach src : mu4e_srcs
|
||||||
'--funcall', 'batch-byte-compile', '@INPUT@'])
|
'--funcall', 'batch-byte-compile', '@INPUT@'])
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
# also install the sources.
|
||||||
|
install_data(mu4e_srcs, install_dir: lispdir)
|
||||||
|
|
||||||
|
|
||||||
if makeinfo.found()
|
if makeinfo.found()
|
||||||
custom_target('mu4e_info',
|
custom_target('mu4e_info',
|
||||||
|
|
|
@ -266,38 +266,20 @@ details depend on your distribution. If you're using another
|
||||||
distribution (or another OS), the below can at least be helpful in
|
distribution (or another OS), the below can at least be helpful in
|
||||||
identifying the packages to install.
|
identifying the packages to install.
|
||||||
|
|
||||||
We provide some instructions for Debian, Ubuntu and Fedora; if those do not
|
We provide some instructions for Debian, Ubuntu and Fedora; if those
|
||||||
apply to you, you can follow either @ref{Building from a release tarball} or
|
do not apply to you, you can follow either @ref{Building from a
|
||||||
@ref{Building from git}.
|
release tarball} or @ref{Building from git}.
|
||||||
|
|
||||||
@subsection Dependencies for Debian/Ubuntu
|
@subsection Dependencies for Debian/Ubuntu
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$ sudo apt-get install libgmime-3.0-dev libxapian-dev
|
$ sudo apt-get install libgmime-3.0-dev libxapian-dev emacs
|
||||||
|
|
||||||
# get emacs 25 or higher if you don't have it yet
|
|
||||||
$ sudo apt-get install emacs
|
|
||||||
|
|
||||||
# optional
|
|
||||||
$ sudo apt-get install guile-2.2-dev html2text xdg-utils
|
|
||||||
|
|
||||||
# optional: only needed for msg2pdf and mug (toy gtk+ frontend)
|
|
||||||
$ sudo apt-get install libwebkitgtk-3.0-dev
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@subsection Dependencies for Fedora
|
@subsection Dependencies for Fedora
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$ sudo yum install gmime30-devel xapian-core-devel
|
$ sudo yum install gmime30-devel xapian-core-devel emacs
|
||||||
|
|
||||||
# get emacs 25 or higher if you don't have it yet
|
|
||||||
$ sudo yum install emacs
|
|
||||||
|
|
||||||
# optional
|
|
||||||
$ sudo yum install html2text xdg-utils guile22-devel
|
|
||||||
|
|
||||||
# optional: only needed for msg2pdf and mug (toy gtk+ frontend)
|
|
||||||
$ sudo yum install webkitgtk3-devel
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@subsection Building on Msys2
|
@subsection Building on Msys2
|
||||||
|
@ -348,10 +330,18 @@ Xapian, GMime and their dependencies must be installed.
|
||||||
@subsection Building from git
|
@subsection Building from git
|
||||||
@anchor{Building from git}
|
@anchor{Building from git}
|
||||||
|
|
||||||
Alternatively, if you build from the git repository or use a tarball
|
By default, @t{mu} use the Meson@footnote{@url{https://mesonbuild.com/}} build-system.
|
||||||
like the ones that @t{github} produces, the instructions are slightly
|
|
||||||
different, and require you to have autotools (@t{autoconf},
|
@example
|
||||||
@t{automake}, @t{libtool}, @t{texinfo}) installed:
|
$ git clone git://github.com/djcb/mu.git
|
||||||
|
$ cd mu
|
||||||
|
$ meson build && ninja -C build
|
||||||
|
$ sudo ninja -C install
|
||||||
|
@end example
|
||||||
|
|
||||||
|
For now, you can also use the (deprecated) @t{autotools} build setup,
|
||||||
|
assuming you have autotools (@t{autoconf}, @t{automake}, @t{libtool},
|
||||||
|
@t{texinfo}) installed:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
# get from git (alternatively, use a github tarball)
|
# get from git (alternatively, use a github tarball)
|
||||||
|
@ -372,25 +362,14 @@ from the command line and in Emacs.
|
||||||
|
|
||||||
You may need to restart Emacs, so it can find @t{mu4e} in its
|
You may need to restart Emacs, so it can find @t{mu4e} in its
|
||||||
@code{load-path}. If, even after restarting, Emacs cannot find
|
@code{load-path}. If, even after restarting, Emacs cannot find
|
||||||
@t{mu4e}, you may need to add it to your @code{load-path} explicitly; check
|
@t{mu4e}, you may need to add it to your @code{load-path} explicitly;
|
||||||
where @t{mu4e} is installed, and add something like the following to your
|
check where @t{mu4e} is installed, and add something like the
|
||||||
configuration before trying again:
|
following to your configuration before trying again:
|
||||||
@lisp
|
@lisp
|
||||||
;; the exact path may differ --- check it
|
;; the exact path may differ --- check it
|
||||||
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
|
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
@subsection Building using the meson build system
|
|
||||||
|
|
||||||
As an (experimental) alternative to the @t{autotools}-build, it is possible to use
|
|
||||||
the Meson@footnote{@url{https://mesonbuild.com/}} build-system instead.
|
|
||||||
|
|
||||||
@example
|
|
||||||
$ git clone git://github.com/djcb/mu.git
|
|
||||||
$ cd mu
|
|
||||||
$ meson build && ninja -C build
|
|
||||||
$ sudo ninja -C install
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@subsection mu4e and emacs customization
|
@subsection mu4e and emacs customization
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue