Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/mu/, net-mail/mu/files/
Date: Fri, 16 Jul 2021 01:35:01
Message-Id: 1626399203.71dd9cae20ac3342be0aed1831a80ea7858dc976.sam@gentoo
1 commit: 71dd9cae20ac3342be0aed1831a80ea7858dc976
2 Author: Matt Smith <matt <AT> offtopica <DOT> uk>
3 AuthorDate: Wed Jul 14 20:01:33 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 16 01:33:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71dd9cae
7
8 net-mail/mu: Guile 3 compat
9
10 Closes: https://bugs.gentoo.org/755875
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Matt Smith <matt <AT> offtopica.uk>
13 Closes: https://github.com/gentoo/gentoo/pull/21643
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 net-mail/mu/files/mu-1.4.15-guile3-1.patch | 141 +++++++++++++++++++++++++++++
17 net-mail/mu/files/mu-1.4.15-guile3-2.patch | 17 ++++
18 net-mail/mu/mu-1.4.15-r2.ebuild | 72 +++++++++++++++
19 3 files changed, 230 insertions(+)
20
21 diff --git a/net-mail/mu/files/mu-1.4.15-guile3-1.patch b/net-mail/mu/files/mu-1.4.15-guile3-1.patch
22 new file mode 100644
23 index 00000000000..671a4685a27
24 --- /dev/null
25 +++ b/net-mail/mu/files/mu-1.4.15-guile3-1.patch
26 @@ -0,0 +1,141 @@
27 +From 623cf787ad009c42b2adf3767be5f01fec56ff5a Mon Sep 17 00:00:00 2001
28 +From: Danny O'Brien <danny@×××××××××××.space>
29 +Date: Mon, 7 Sep 2020 19:52:17 -0700
30 +Subject: [PATCH] guile: support version 3.0.
31 +
32 +Includes an update to the guile m4 package, and tweaks the build so that
33 +both 2.2 and 3.0 should work fine.
34 +---
35 + configure.ac | 14 +++++++-------
36 + guile/Makefile.am | 2 +-
37 + guile/mu/Makefile.am | 4 +---
38 + m4/Makefile.am | 2 +-
39 + m4/{guile-2.2.m4 => guile.m4} | 15 +++++++++------
40 + 5 files changed, 19 insertions(+), 18 deletions(-)
41 + rename m4/{guile-2.2.m4 => guile.m4} (97%)
42 +
43 +diff --git a/configure.ac b/configure.ac
44 +index eb5629696..cc43f43db 100644
45 +--- a/configure.ac
46 ++++ b/configure.ac
47 +@@ -212,22 +212,22 @@ AM_CONDITIONAL(BUILD_GUI,[test "x$have_webkit" = "xyes" -a "x$have_gtk" = "xyes"
48 + ###############################################################################
49 +
50 + ###############################################################################
51 +-# build with guile2.2 when available and not disabled.
52 ++# build with guile 3.0/2.2 when available and not disabled.
53 + AC_ARG_ENABLE([guile], AS_HELP_STRING([--disable-guile],[Disable guile]))
54 + AS_IF([test "x$enable_guile" != "xno"],[
55 +- PKG_CHECK_MODULES(GUILE22, guile-2.2, [have_guile22=yes],[have_guile22=no])
56 +- # this is a bit hacky; GUILE_PKG
57 +- AS_IF([test "x$have_guile22" = "xyes"],[
58 +- GUILE_PKG([2.2])
59 ++ PKG_CHECK_MODULES(GUILE, [guile-3.0], [have_guile=yes],[
60 ++ PKG_CHECK_MODULES(GUILE, [guile-2.2], [have_guile=yes], [have_guile=no])])
61 ++ AS_IF([test "x$have_guile" = "xyes"],[
62 ++ GUILE_PKG([3.0 2.2])
63 + GUILE_PROGS
64 + GUILE_FLAGS
65 + AC_DEFINE_UNQUOTED([GUILE_BINARY],"$GUILE",[guile binary])
66 + AC_DEFINE(BUILD_GUILE,[1], [Do we support Guile?])
67 + AC_SUBST(GUILE_SNARF, [guile-snarf])
68 +- guile_version=$($PKG_CONFIG guile-2.2 --modversion)
69 ++ guile_version=$($PKG_CONFIG guile-$GUILE_EFFECTIVE_VERSION --modversion)
70 + ])
71 + ])
72 +-AM_CONDITIONAL(BUILD_GUILE,[test "x$have_guile22" = "xyes"])
73 ++AM_CONDITIONAL(BUILD_GUILE,[test "x$have_guile" = "xyes"])
74 + ###############################################################################
75 +
76 + ###############################################################################
77 +diff --git a/guile/Makefile.am b/guile/Makefile.am
78 +index ed613068b..5c06ccc95 100644
79 +--- a/guile/Makefile.am
80 ++++ b/guile/Makefile.am
81 +@@ -69,7 +69,7 @@ SUFFIXES = .x .doc
82 +
83 + # FIXME: GUILE_SITEDIR would be better, but that
84 + # breaks 'make distcheck'
85 +-scmdir=${prefix}/share/guile/site/2.2/
86 ++scmdir=${prefix}/share/guile/site/${GUILE_EFFECTIVE_VERSION}
87 + scm_DATA=mu.scm
88 +
89 + EXTRA_DIST=$(scm_DATA)
90 +diff --git a/guile/mu/Makefile.am b/guile/mu/Makefile.am
91 +index f531822cd..9339ad973 100644
92 +--- a/guile/mu/Makefile.am
93 ++++ b/guile/mu/Makefile.am
94 +@@ -16,9 +16,7 @@
95 +
96 + include $(top_srcdir)/gtest.mk
97 +
98 +-# FIXME: GUILE_SITEDIR would be better, but that
99 +-# breaks 'make distcheck'
100 +-scmdir=${prefix}/share/guile/site/2.2/mu/
101 ++scmdir=${prefix}/share/guile/site/${GUILE_EFFECTIVE_VERSION}/mu/
102 +
103 + scm_DATA= \
104 + stats.scm \
105 +diff --git a/m4/Makefile.am b/m4/Makefile.am
106 +index eeb8a05a4..27a49eebe 100644
107 +--- a/m4/Makefile.am
108 ++++ b/m4/Makefile.am
109 +@@ -41,7 +41,7 @@ EXTRA_DIST= \
110 + ax_lib_readline.m4 \
111 + ax_require_defined.m4 \
112 + ax_valgrind_check.m4 \
113 +- guile-2.2.m4 \
114 ++ guile.m4 \
115 + lib-ld.m4 \
116 + lib-link.m4 \
117 + lib-prefix.m4
118 +diff --git a/m4/guile-2.2.m4 b/m4/guile.m4
119 +similarity index 97%
120 +rename from m4/guile-2.2.m4
121 +rename to m4/guile.m4
122 +index 89823e9c3..696897364 100644
123 +--- a/m4/guile-2.2.m4
124 ++++ b/m4/guile.m4
125 +@@ -47,8 +47,8 @@
126 + # for an available version of Guile.
127 + #
128 + # By default, this macro will search for the latest stable version of
129 +-# Guile (e.g. 2.2), falling back to the previous stable version
130 +-# (e.g. 2.0) if it is available. If no guile-@var{VERSION}.pc file is
131 ++# Guile (e.g. 3.0), falling back to the previous stable version
132 ++# (e.g. 2.2) if it is available. If no guile-@var{VERSION}.pc file is
133 + # found, an error is signalled. The found version is stored in
134 + # @var{GUILE_EFFECTIVE_VERSION}.
135 + #
136 +@@ -60,8 +60,11 @@
137 + # @code{AC_SUBST}.
138 + #
139 + AC_DEFUN([GUILE_PKG],
140 +- [PKG_PROG_PKG_CONFIG
141 +- _guile_versions_to_search="m4_default([$1], [2.2 2.0 1.8])"
142 ++ [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
143 ++ if test "x$PKG_CONFIG" = x; then
144 ++ AC_MSG_ERROR([pkg-config is missing, please install it])
145 ++ fi
146 ++ _guile_versions_to_search="m4_default([$1], [3.0 2.2 2.0])"
147 + if test -n "$GUILE_EFFECTIVE_VERSION"; then
148 + _guile_tmp=""
149 + for v in $_guile_versions_to_search; do
150 +@@ -221,7 +224,7 @@ AC_DEFUN([GUILE_SITE_DIR],
151 + # as well.
152 + #
153 + # By default, this macro will search for the latest stable version of
154 +-# Guile (e.g. 2.2). x.y or x.y.z versions can be specified. If an older
155 ++# Guile (e.g. 3.0). x.y or x.y.z versions can be specified. If an older
156 + # version is found, the macro will signal an error.
157 + #
158 + # The effective version of the found @code{guile} is set to
159 +@@ -237,7 +240,7 @@ AC_DEFUN([GUILE_SITE_DIR],
160 + AC_DEFUN([GUILE_PROGS],
161 + [_guile_required_version="m4_default([$1], [$GUILE_EFFECTIVE_VERSION])"
162 + if test -z "$_guile_required_version"; then
163 +- _guile_required_version=2.2
164 ++ _guile_required_version=3.0
165 + fi
166 +
167 + _guile_candidates=guile
168
169 diff --git a/net-mail/mu/files/mu-1.4.15-guile3-2.patch b/net-mail/mu/files/mu-1.4.15-guile3-2.patch
170 new file mode 100644
171 index 00000000000..6aa47d25230
172 --- /dev/null
173 +++ b/net-mail/mu/files/mu-1.4.15-guile3-2.patch
174 @@ -0,0 +1,17 @@
175 +---
176 + lib/mu-script.c | 2 +-
177 + 1 file changed, 1 insertion(+), 1 deletion(-)
178 +
179 +diff --git a/lib/mu-script.c b/lib/mu-script.c
180 +index 1175a60e3..92a63992e 100644
181 +--- a/lib/mu-script.c
182 ++++ b/lib/mu-script.c
183 +@@ -318,7 +318,7 @@ mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
184 + g_return_val_if_fail (muhome, FALSE);
185 +
186 + argv = g_new0 (char*, 6);
187 +- argv[0] = g_strdup("guile2.2");
188 ++ argv[0] = g_strdup(GUILE_BINARY);
189 + argv[1] = g_strdup("-l");
190 +
191 + if (access (mu_script_info_path (msi), R_OK) != 0) {
192
193 diff --git a/net-mail/mu/mu-1.4.15-r2.ebuild b/net-mail/mu/mu-1.4.15-r2.ebuild
194 new file mode 100644
195 index 00000000000..fa8dc2e3014
196 --- /dev/null
197 +++ b/net-mail/mu/mu-1.4.15-r2.ebuild
198 @@ -0,0 +1,72 @@
199 +# Copyright 1999-2021 Gentoo Authors
200 +# Distributed under the terms of the GNU General Public License v2
201 +
202 +EAPI=8
203 +
204 +inherit autotools elisp-common
205 +
206 +DESCRIPTION="Set of tools to deal with Maildirs, in particular, searching and indexing"
207 +HOMEPAGE="https://www.djcbsoftware.nl/code/mu/ https://github.com/djcb/mu"
208 +SRC_URI="https://github.com/djcb/mu/archives/refs/tags/${PV}.tar.gz -> mu-${PV}.tar.gz"
209 +
210 +LICENSE="GPL-3+"
211 +SLOT="0"
212 +KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~x64-macos"
213 +IUSE="emacs guile mug"
214 +
215 +DEPEND="
216 + dev-libs/glib:2=
217 + dev-libs/gmime:3.0=
218 + >=dev-libs/xapian-1.4:=
219 + emacs? ( >=app-editors/emacs-24.4:* )
220 + guile? ( >=dev-scheme/guile-2.2:* )
221 + mug? (
222 + net-libs/webkit-gtk:4=
223 + x11-libs/gtk+:3=
224 + )"
225 +RDEPEND="${DEPEND}"
226 +BDEPEND="virtual/pkgconfig"
227 +
228 +PATCHES=(
229 + "${FILESDIR}"/${PN}-1.4.15-guile3-1.patch
230 + "${FILESDIR}"/${PN}-1.4.15-guile3-2.patch
231 +)
232 +
233 +SITEFILE="70mu-gentoo-autoload.el"
234 +
235 +src_prepare() {
236 + default
237 + eautoreconf
238 +}
239 +
240 +src_configure() {
241 + local myeconfargs=(
242 + $(use_enable emacs mu4e)
243 + $(use_enable mug gtk)
244 + $(use_enable mug webkit)
245 + $(use_enable guile)
246 + )
247 +
248 + econf "${myeconfargs[@]}"
249 +}
250 +
251 +pkg_preinst() {
252 + if [[ -n ${REPLACING_VERSIONS} ]]; then
253 + elog "After upgrading from an old major version, you should"
254 + elog "rebuild your mail index."
255 + fi
256 +}
257 +
258 +pkg_postinst() {
259 + if use emacs; then
260 + einfo "To use mu4e you need to configure it in your .emacs file"
261 + einfo "See the manual for more information:"
262 + einfo "https://www.djcbsoftware.nl/code/mu/mu4e/"
263 +
264 + elisp-site-regen
265 + fi
266 +}
267 +
268 +pkg_postrm() {
269 + use emacs && elisp-site-regen
270 +}