mail-client/claws-mail: backport Perl 5.36 patch

Maintainer timeout. This one is particularly important as failed
builds during Perl upgrade rebuilds are a major pain.

Closes: https://bugs.gentoo.org/849569
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2022-06-26 08:02:32 +01:00
parent 3d1e085725
commit c42e967872
4 changed files with 1342 additions and 0 deletions
@@ -0,0 +1,216 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit autotools desktop python-any-r1 xdg
DESCRIPTION="An email client (and news reader) based on GTK+"
HOMEPAGE="https://www.claws-mail.org/"
if [[ "${PV}" == *9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://git.claws-mail.org/readonly/claws.git"
else
SRC_URI="https://www.claws-mail.org/download.php?file=releases/${P}.tar.xz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
SLOT="0"
LICENSE="GPL-3"
IUSE="+appindicator archive bogofilter calendar clamav dbus debug dillo doc gdata +gnutls +imap ipv6 ldap +libcanberra +libnotify litehtml networkmanager nls nntp +notification pdf perl +pgp rss session sieve smime spamassassin spam-report spell startup-notification svg valgrind xface"
REQUIRED_USE="
appindicator? ( notification )
libcanberra? ( notification )
libnotify? ( notification )
networkmanager? ( dbus )
smime? ( pgp )
"
COMMONDEPEND="
dev-libs/nettle:=
net-mail/ytnef
sys-libs/zlib:=
x11-libs/cairo
x11-libs/gdk-pixbuf:2[jpeg]
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/pango
archive? (
app-arch/libarchive
>=net-misc/curl-7.9.7
)
bogofilter? ( mail-filter/bogofilter )
calendar? (
>=dev-libs/libical-2.0.0:=
>=net-misc/curl-7.9.7
)
dbus? (
>=dev-libs/dbus-glib-0.60
sys-apps/dbus
)
gdata? ( >=dev-libs/libgdata-0.17.2 )
dillo? ( www-client/dillo )
gnutls? ( >=net-libs/gnutls-3.0 )
imap? ( >=net-libs/libetpan-0.57 )
ldap? ( >=net-nds/openldap-2.0.7:= )
litehtml? (
>=dev-libs/glib-2.36:2
>=dev-libs/gumbo-0.10
net-misc/curl
media-libs/fontconfig
)
nls? ( >=sys-devel/gettext-0.18 )
nntp? ( >=net-libs/libetpan-0.57 )
notification? (
dev-libs/glib:2
appindicator? ( dev-libs/libindicate:3[gtk] )
libcanberra? ( media-libs/libcanberra[gtk2] )
libnotify? ( x11-libs/libnotify )
)
pdf? ( app-text/poppler[cairo] )
pgp? ( >=app-crypt/gpgme-1.0.0:= )
session? (
x11-libs/libICE
x11-libs/libSM
)
smime? ( >=app-crypt/gpgme-1.0.0:= )
spam-report? ( >=net-misc/curl-7.9.7 )
spell? ( >=app-text/enchant-2.0.0:2= )
startup-notification? ( x11-libs/startup-notification )
svg? ( >=gnome-base/librsvg-2.40.5 )
valgrind? ( dev-util/valgrind )
"
DEPEND="${COMMONDEPEND}
xface? ( >=media-libs/compface-1.4 )
"
BDEPEND="
${PYTHON_DEPS}
app-arch/xz-utils
virtual/pkgconfig
"
RDEPEND="${COMMONDEPEND}
app-misc/mime-types
x11-misc/shared-mime-info
clamav? ( app-antivirus/clamav )
networkmanager? ( net-misc/networkmanager )
pdf? ( app-text/ghostscript-gpl )
perl? ( dev-lang/perl:= )
rss? (
dev-libs/libxml2
net-misc/curl
)
"
PATCHES=(
"${FILESDIR}/${PN}-3.17.5-enchant-2_default.patch"
"${FILESDIR}/${PN}-3.19.0-perl-5.36.patch"
)
src_prepare() {
default
eautoreconf
}
src_configure() {
# Don't use libsoup-gnome (bug #565924)
export HAVE_LIBSOUP_GNOME=no
local myeconfargs=(
--disable-bsfilter-plugin
--disable-fancy-plugin
--disable-generic-umpc
--disable-jpilot #735118
--enable-acpi_notifier-plugin
--enable-address_keeper-plugin
--enable-alternate-addressbook
--enable-att_remover-plugin
--enable-attachwarner-plugin
--enable-fetchinfo-plugin
--enable-mailmbox-plugin
--enable-newmail-plugin
--enable-tnef_parse-plugin
--with-password-encryption=$(usex gnutls gnutls old)
$(use_enable archive archive-plugin)
$(use_enable bogofilter bogofilter-plugin)
$(use_enable calendar vcalendar-plugin)
$(use_enable clamav clamd-plugin)
$(use_enable dbus)
$(use_enable debug crash-dialog)
$(use_enable dillo dillo-plugin)
$(use_enable doc manual)
$(use_enable gdata gdata-plugin)
$(use_enable gnutls)
$(use_enable ipv6)
$(use_enable ldap)
$(use_enable litehtml litehtml_viewer-plugin)
$(use_enable networkmanager)
$(use_enable nls)
$(use_enable notification notification-plugin)
$(use_enable pdf pdf_viewer-plugin)
$(use_enable perl perl-plugin)
$(use_enable pgp pgpcore-plugin)
$(use_enable pgp pgpinline-plugin)
$(use_enable pgp pgpmime-plugin)
--disable-python-plugin
$(use_enable rss rssyl-plugin)
$(use_enable session libsm)
$(use_enable sieve managesieve-plugin)
$(use_enable smime smime-plugin)
$(use_enable spam-report spam_report-plugin)
$(use_enable spamassassin spamassassin-plugin)
$(use_enable spell enchant)
$(use_enable startup-notification)
$(use_enable svg)
$(use_enable valgrind valgrind)
$(use_enable xface compface)
)
# libetpan is needed if user wants nntp or imap functionality
if use imap || use nntp ; then
myeconfargs+=( --enable-libetpan )
else
myeconfargs+=( --disable-libetpan )
fi
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
src_install() {
local DOCS=( AUTHORS ChangeLog* INSTALL* NEWS README* TODO* )
default
# Makefile install claws-mail.png in /usr/share/icons/hicolor/48x48/apps
# => also install it in /usr/share/pixmaps for other desktop envs
# => also install higher resolution icons in /usr/share/icons/hicolor/...
insinto /usr/share/pixmaps
doins ${PN}.png
local size
for size in 64 128 ; do
newicon -s ${size} ${PN}-${size}x${size}.png ${PN}.png
done
docinto tools
dodoc tools/README*
domenu ${PN}.desktop
einfo "Installing extra tools"
cd "${S}"/tools || die
exeinto /usr/$(get_libdir)/${PN}/tools
doexe *.pl *.py *.conf *.sh
doexe tb2claws-mail update-po uudec uuooffice
# kill useless files
find "${ED}"/usr/$(get_libdir)/${PN}/plugins/ \
\( -name "*.a" -o -name "*.la" \) -delete || die
}
pkg_postinst() {
ewarn "When upgrading from version <3.18 please re-load any plugin you use"
xdg_pkg_postinst
}
@@ -0,0 +1,217 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit autotools desktop python-any-r1 xdg
DESCRIPTION="An email client (and news reader) based on GTK+"
HOMEPAGE="https://www.claws-mail.org/"
if [[ "${PV}" == *9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://git.claws-mail.org/readonly/claws.git"
else
SRC_URI="https://www.claws-mail.org/download.php?file=releases/${P}.tar.xz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
SLOT="0"
LICENSE="GPL-3"
IUSE="+appindicator archive bogofilter calendar clamav dbus debug dillo doc gdata +gnutls +imap ipv6 ldap +libcanberra +libnotify litehtml networkmanager nls nntp +notification pdf perl +pgp rss session sieve smime spamassassin spam-report spell startup-notification svg valgrind webkit xface"
REQUIRED_USE="
appindicator? ( notification )
libcanberra? ( notification )
libnotify? ( notification )
networkmanager? ( dbus )
smime? ( pgp )
"
COMMONDEPEND="
dev-libs/nettle:=
net-mail/ytnef
sys-libs/zlib:=
x11-libs/cairo
x11-libs/gdk-pixbuf:2[jpeg]
x11-libs/gtk+:3
x11-libs/libX11
x11-libs/pango
archive? (
app-arch/libarchive
>=net-misc/curl-7.9.7
)
bogofilter? ( mail-filter/bogofilter )
calendar? (
>=dev-libs/libical-2.0.0:=
>=net-misc/curl-7.9.7
)
dbus? (
>=dev-libs/dbus-glib-0.60
sys-apps/dbus
)
gdata? ( >=dev-libs/libgdata-0.17.2 )
dillo? ( www-client/dillo )
gnutls? ( >=net-libs/gnutls-3.0 )
imap? ( >=net-libs/libetpan-0.57 )
ldap? ( >=net-nds/openldap-2.0.7:= )
litehtml? (
>=dev-libs/glib-2.36:2
>=dev-libs/gumbo-0.10
net-misc/curl
media-libs/fontconfig
)
nls? ( >=sys-devel/gettext-0.18 )
nntp? ( >=net-libs/libetpan-0.57 )
notification? (
dev-libs/glib:2
appindicator? ( dev-libs/libindicate:3[gtk] )
libcanberra? ( media-libs/libcanberra[gtk3] )
libnotify? ( x11-libs/libnotify )
)
pdf? ( app-text/poppler[cairo] )
pgp? ( >=app-crypt/gpgme-1.0.0:= )
session? (
x11-libs/libICE
x11-libs/libSM
)
smime? ( >=app-crypt/gpgme-1.0.0:= )
spam-report? ( >=net-misc/curl-7.9.7 )
spell? ( >=app-text/enchant-2.0.0:2= )
startup-notification? ( x11-libs/startup-notification )
svg? ( >=gnome-base/librsvg-2.40.5 )
valgrind? ( dev-util/valgrind )
webkit? ( net-libs/webkit-gtk:4 )
"
DEPEND="${COMMONDEPEND}
xface? ( >=media-libs/compface-1.4 )
"
BDEPEND="
${PYTHON_DEPS}
app-arch/xz-utils
virtual/pkgconfig
"
RDEPEND="${COMMONDEPEND}
app-misc/mime-types
x11-misc/shared-mime-info
clamav? ( app-antivirus/clamav )
networkmanager? ( net-misc/networkmanager )
pdf? ( app-text/ghostscript-gpl )
perl? ( dev-lang/perl:= )
rss? (
dev-libs/libxml2
net-misc/curl
)
"
PATCHES=(
"${FILESDIR}/${PN}-3.17.5-enchant-2_default.patch"
"${FILESDIR}/${PN}-4.1.0-perl-5.36.patch"
)
src_prepare() {
default
eautoreconf
}
src_configure() {
# Don't use libsoup-gnome (bug #565924)
export HAVE_LIBSOUP_GNOME=no
local myeconfargs=(
--disable-bsfilter-plugin
--disable-generic-umpc
--disable-jpilot #735118
--enable-acpi_notifier-plugin
--enable-address_keeper-plugin
--enable-alternate-addressbook
--enable-att_remover-plugin
--enable-attachwarner-plugin
--enable-fetchinfo-plugin
--enable-mailmbox-plugin
--enable-newmail-plugin
--enable-tnef_parse-plugin
--with-password-encryption=$(usex gnutls gnutls old)
$(use_enable archive archive-plugin)
$(use_enable bogofilter bogofilter-plugin)
$(use_enable calendar vcalendar-plugin)
$(use_enable clamav clamd-plugin)
$(use_enable dbus)
$(use_enable debug crash-dialog)
$(use_enable dillo dillo-plugin)
$(use_enable doc manual)
$(use_enable gdata gdata-plugin)
$(use_enable gnutls)
$(use_enable ipv6)
$(use_enable ldap)
$(use_enable litehtml litehtml_viewer-plugin)
$(use_enable networkmanager)
$(use_enable nls)
$(use_enable notification notification-plugin)
$(use_enable pdf pdf_viewer-plugin)
$(use_enable perl perl-plugin)
$(use_enable pgp pgpcore-plugin)
$(use_enable pgp pgpinline-plugin)
$(use_enable pgp pgpmime-plugin)
--disable-python-plugin
$(use_enable rss rssyl-plugin)
$(use_enable session libsm)
$(use_enable sieve managesieve-plugin)
$(use_enable smime smime-plugin)
$(use_enable spam-report spam_report-plugin)
$(use_enable spamassassin spamassassin-plugin)
$(use_enable spell enchant)
$(use_enable startup-notification)
$(use_enable svg)
$(use_enable valgrind valgrind)
$(use_enable webkit fancy-plugin)
$(use_enable xface compface)
)
# libetpan is needed if user wants nntp or imap functionality
if use imap || use nntp ; then
myeconfargs+=( --enable-libetpan )
else
myeconfargs+=( --disable-libetpan )
fi
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
src_install() {
local DOCS=( AUTHORS ChangeLog* INSTALL* NEWS README* TODO* )
default
# Makefile install claws-mail.png in /usr/share/icons/hicolor/48x48/apps
# => also install it in /usr/share/pixmaps for other desktop envs
# => also install higher resolution icons in /usr/share/icons/hicolor/...
insinto /usr/share/pixmaps
doins ${PN}.png
local size
for size in 64 128 ; do
newicon -s ${size} ${PN}-${size}x${size}.png ${PN}.png
done
docinto tools
dodoc tools/README*
domenu ${PN}.desktop
einfo "Installing extra tools"
cd "${S}"/tools || die
exeinto /usr/$(get_libdir)/${PN}/tools
doexe *.pl *.py *.conf *.sh
doexe tb2claws-mail update-po uudec uuooffice
# kill useless files
find "${ED}"/usr/$(get_libdir)/${PN}/plugins/ \
\( -name "*.a" -o -name "*.la" \) -delete || die
}
pkg_postinst() {
ewarn "When upgrading from version 3.x please re-load any plugin you use"
xdg_pkg_postinst
}
@@ -0,0 +1,455 @@
https://git.claws-mail.org/?p=claws.git;a=commitdiff;h=5fee50c54a370fdfb5241bd4c4c16281a741762e
https://bugs.gentoo.org/849569
From 5fee50c54a370fdfb5241bd4c4c16281a741762e Mon Sep 17 00:00:00 2001
From: Ricardo Mones <ricardo@mones.org>
Date: Sat, 23 Apr 2022 19:26:16 +0200
Subject: [PATCH] Fix building perl plugin since perl v5.35.2
Using XSRETURN_* macros in expressions is now deprecated:
https://github.com/Perl/perl5/commit/7169efc77525df70484a824bff4ceebd1fafc760
--- a/src/plugins/perl/perl_plugin.c
+++ b/src/plugins/perl/perl_plugin.c
@@ -577,76 +577,182 @@ static XS(XS_ClawsMail_filter_init)
/* msginfo */
case 1:
- msginfo->size ? XSRETURN_UV(msginfo->size) : XSRETURN_UNDEF;
+ if (msginfo->size) {
+ XSRETURN_UV(msginfo->size);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 2:
- msginfo->date ? XSRETURN_PV(msginfo->date) : XSRETURN_UNDEF;
+ if (msginfo->date) {
+ XSRETURN_PV(msginfo->date);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 3:
- msginfo->from ? XSRETURN_PV(msginfo->from) : XSRETURN_UNDEF;
+ if (msginfo->from) {
+ XSRETURN_PV(msginfo->from);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 4:
- msginfo->to ? XSRETURN_PV(msginfo->to) : XSRETURN_UNDEF;
+ if (msginfo->to) {
+ XSRETURN_PV(msginfo->to);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 5:
- msginfo->cc ? XSRETURN_PV(msginfo->cc) : XSRETURN_UNDEF;
+ if (msginfo->cc) {
+ XSRETURN_PV(msginfo->cc);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 6:
- msginfo->newsgroups ? XSRETURN_PV(msginfo->newsgroups) : XSRETURN_UNDEF;
+ if (msginfo->newsgroups) {
+ XSRETURN_PV(msginfo->newsgroups);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 7:
- msginfo->subject ? XSRETURN_PV(msginfo->subject) : XSRETURN_UNDEF;
+ if (msginfo->subject) {
+ XSRETURN_PV(msginfo->subject);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 8:
- msginfo->msgid ? XSRETURN_PV(msginfo->msgid) : XSRETURN_UNDEF;
+ if (msginfo->msgid) {
+ XSRETURN_PV(msginfo->msgid);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 9:
- msginfo->inreplyto ? XSRETURN_PV(msginfo->inreplyto) : XSRETURN_UNDEF;
+ if (msginfo->inreplyto) {
+ XSRETURN_PV(msginfo->inreplyto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 10:
- msginfo->xref ? XSRETURN_PV(msginfo->xref) : XSRETURN_UNDEF;
+ if (msginfo->xref) {
+ XSRETURN_PV(msginfo->xref);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 11:
xface = procmsg_msginfo_get_avatar(msginfo, AVATAR_XFACE);
- xface ? XSRETURN_PV(xface) : XSRETURN_UNDEF;
+ if (xface) {
+ XSRETURN_PV(xface);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 12:
- (msginfo->extradata && msginfo->extradata->dispositionnotificationto) ?
- XSRETURN_PV(msginfo->extradata->dispositionnotificationto) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->dispositionnotificationto) {
+ XSRETURN_PV(msginfo->extradata->dispositionnotificationto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 13:
- (msginfo->extradata && msginfo->extradata->returnreceiptto) ?
- XSRETURN_PV(msginfo->extradata->returnreceiptto) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->returnreceiptto) {
+ XSRETURN_PV(msginfo->extradata->returnreceiptto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 14:
EXTEND(SP, g_slist_length(msginfo->references));
ii = 0;
for(walk = msginfo->references; walk != NULL; walk = g_slist_next(walk))
XST_mPV(ii++,walk->data ? (gchar*) walk->data: "");
- ii ? XSRETURN(ii) : XSRETURN_UNDEF;
+ if (ii) {
+ XSRETURN(ii);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 15:
- msginfo->score ? XSRETURN_IV(msginfo->score) : XSRETURN_UNDEF;
+ if (msginfo->score) {
+ XSRETURN_IV(msginfo->score);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 17:
- msginfo->plaintext_file ?
- XSRETURN_PV(msginfo->plaintext_file) : XSRETURN_UNDEF;
+ if (msginfo->plaintext_file) {
+ XSRETURN_PV(msginfo->plaintext_file);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 19:
- msginfo->hidden ? XSRETURN_IV(msginfo->hidden) : XSRETURN_UNDEF;
+ if (msginfo->hidden) {
+ XSRETURN_IV(msginfo->hidden);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 20:
if((charp = procmsg_get_message_file_path(msginfo)) != NULL) {
strncpy2(buf,charp,sizeof(buf));
g_free(charp);
XSRETURN_PV(buf);
}
- else
+ else {
XSRETURN_UNDEF;
+ }
case 21:
- (msginfo->extradata && msginfo->extradata->partial_recv) ?
- XSRETURN_PV(msginfo->extradata->partial_recv) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->partial_recv) {
+ XSRETURN_PV(msginfo->extradata->partial_recv);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 22:
- msginfo->total_size ? XSRETURN_IV(msginfo->total_size) : XSRETURN_UNDEF;
+ if (msginfo->total_size) {
+ XSRETURN_IV(msginfo->total_size);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 23:
- (msginfo->extradata && msginfo->extradata->account_server) ?
- XSRETURN_PV(msginfo->extradata->account_server) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->account_server) {
+ XSRETURN_PV(msginfo->extradata->account_server);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 24:
- (msginfo->extradata && msginfo->extradata->account_login) ?
- XSRETURN_PV(msginfo->extradata->account_login) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->account_login) {
+ XSRETURN_PV(msginfo->extradata->account_login);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 25:
- msginfo->planned_download ?
- XSRETURN_IV(msginfo->planned_download) : XSRETURN_UNDEF;
+ if (msginfo->planned_download) {
+ XSRETURN_IV(msginfo->planned_download);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
/* general */
case 100:
- if(manual_filtering)
+ if(manual_filtering) {
XSRETURN_YES;
- else
+ }
+ else {
XSRETURN_NO;
+ }
default:
g_warning("Perl plugin: wrong argument to ClawsMail::C::init");
XSRETURN_UNDEF;
@@ -664,8 +770,9 @@ static XS(XS_ClawsMail_open_mail_file)
XSRETURN_UNDEF;
}
file = procmsg_get_message_file_path(msginfo);
- if(!file)
+ if(!file) {
XSRETURN_UNDEF;
+ }
if((message_file = claws_fopen(file, "rb")) == NULL) {
FILE_OP_ERROR(file, "claws_fopen");
g_warning("Perl plugin: file open error in ClawsMail::C::open_mail_file");
@@ -718,8 +825,9 @@ static XS(XS_ClawsMail_get_next_header)
g_free(buf);
XSRETURN(2);
}
- else
+ else {
XSRETURN_EMPTY;
+ }
}
/* ClawsMail::C::get_next_body_line */
@@ -736,10 +844,12 @@ static XS(XS_ClawsMail_get_next_body_line)
g_warning("Perl plugin: message file not open. Use ClawsMail::C::open_message_file first");
XSRETURN_UNDEF;
}
- if(claws_fgets(buf, sizeof(buf), message_file) != NULL)
+ if(claws_fgets(buf, sizeof(buf), message_file) != NULL) {
XSRETURN_PV(buf);
- else
+ }
+ else {
XSRETURN_UNDEF;
+ }
}
@@ -772,57 +882,65 @@ static XS(XS_ClawsMail_check_flag)
filter_log_write(LOG_MATCH,"marked");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 2:
if(MSG_IS_UNREAD(msginfo->flags)) {
filter_log_write(LOG_MATCH,"unread");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 3:
if(MSG_IS_DELETED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"deleted");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 4:
if(MSG_IS_NEW(msginfo->flags)) {
filter_log_write(LOG_MATCH,"new");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 5:
if(MSG_IS_REPLIED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"replied");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 6:
if(MSG_IS_FORWARDED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"forwarded");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 7:
if(MSG_IS_LOCKED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"locked");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 8:
if(MSG_IS_IGNORE_THREAD(msginfo->flags)) {
filter_log_write(LOG_MATCH,"ignore_thread");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
default:
g_warning("Perl plugin: unknown argument to ClawsMail::C::check_flag");
XSRETURN_UNDEF;
@@ -845,8 +963,9 @@ static XS(XS_ClawsMail_colorlabel)
filter_log_write(LOG_MATCH,"colorlabel");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::age_greater(int) */
@@ -866,8 +985,9 @@ static XS(XS_ClawsMail_age_greater)
filter_log_write(LOG_MATCH,"age_greater");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::age_lower(int) */
@@ -887,8 +1007,9 @@ static XS(XS_ClawsMail_age_lower)
filter_log_write(LOG_MATCH,"age_lower");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::tagged() */
@@ -900,7 +1021,12 @@ static XS(XS_ClawsMail_tagged)
XSRETURN_UNDEF;
}
- return msginfo->tags ? XSRETURN_YES : XSRETURN_NO;
+ if (msginfo->tags) {
+ XSRETURN_YES;
+ }
+ else {
+ XSRETURN_NO;
+ }
}
/* ClawsMail::C::get_tags() */
@@ -1032,10 +1158,12 @@ static XS(XS_ClawsMail_make_sure_folder_exists)
identifier = SvPV_nolen(ST(0));
item = folder_get_item_from_identifier(identifier);
- if(item)
+ if(item) {
XSRETURN_YES;
- else
+ }
+ else {
XSRETURN_NO;
+ }
}
@@ -1066,8 +1194,9 @@ static XS(XS_ClawsMail_addr_in_addressbook)
filter_log_write(LOG_MATCH,"addr_in_addressbook");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
@@ -1348,8 +1477,9 @@ static XS(XS_ClawsMail_forward)
XSRETURN_YES;
}
- else
+ else {
XSRETURN_UNDEF;
+ }
}
/* ClawsMail::C::redirect(int,char*) */
@@ -1373,8 +1503,9 @@ static XS(XS_ClawsMail_redirect)
account = account_find_from_id(account_id);
compose = compose_redirect(account, msginfo, TRUE);
- if (compose->account->protocol == A_NNTP)
+ if (compose->account->protocol == A_NNTP) {
XSRETURN_UNDEF;
+ }
else
compose_entry_append(compose, dest, COMPOSE_TO, PREF_NONE);
@@ -1389,8 +1520,9 @@ static XS(XS_ClawsMail_redirect)
XSRETURN_YES;
}
- else
+ else {
XSRETURN_UNDEF;
+ }
}
@@ -1472,8 +1604,9 @@ static XS(XS_ClawsMail_get_attribute_value)
attribute_value = get_attribute_value(addr,attr,bookname);
}
- if(attribute_value)
+ if(attribute_value) {
XSRETURN_PV(attribute_value);
+ }
XSRETURN_PV("");
}
@@ -0,0 +1,454 @@
https://git.claws-mail.org/?p=claws.git;a=commitdiff;h=1465ce9c0eb6151a3eaeebb10fd4ffa6db3d69db
https://bugs.gentoo.org/849569
From: Ricardo Mones <ricardo@mones.org>
Date: Sat, 23 Apr 2022 19:26:16 +0200
Subject: [PATCH] Fix building perl plugin since perl v5.35.2
Using XSRETURN_* macros in expressions is now deprecated:
https://github.com/Perl/perl5/commit/7169efc77525df70484a824bff4ceebd1fafc760
--- a/src/plugins/perl/perl_plugin.c
+++ b/src/plugins/perl/perl_plugin.c
@@ -577,76 +577,182 @@ static XS(XS_ClawsMail_filter_init)
/* msginfo */
case 1:
- msginfo->size ? XSRETURN_UV(msginfo->size) : XSRETURN_UNDEF;
+ if (msginfo->size) {
+ XSRETURN_UV(msginfo->size);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 2:
- msginfo->date ? XSRETURN_PV(msginfo->date) : XSRETURN_UNDEF;
+ if (msginfo->date) {
+ XSRETURN_PV(msginfo->date);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 3:
- msginfo->from ? XSRETURN_PV(msginfo->from) : XSRETURN_UNDEF;
+ if (msginfo->from) {
+ XSRETURN_PV(msginfo->from);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 4:
- msginfo->to ? XSRETURN_PV(msginfo->to) : XSRETURN_UNDEF;
+ if (msginfo->to) {
+ XSRETURN_PV(msginfo->to);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 5:
- msginfo->cc ? XSRETURN_PV(msginfo->cc) : XSRETURN_UNDEF;
+ if (msginfo->cc) {
+ XSRETURN_PV(msginfo->cc);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 6:
- msginfo->newsgroups ? XSRETURN_PV(msginfo->newsgroups) : XSRETURN_UNDEF;
+ if (msginfo->newsgroups) {
+ XSRETURN_PV(msginfo->newsgroups);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 7:
- msginfo->subject ? XSRETURN_PV(msginfo->subject) : XSRETURN_UNDEF;
+ if (msginfo->subject) {
+ XSRETURN_PV(msginfo->subject);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 8:
- msginfo->msgid ? XSRETURN_PV(msginfo->msgid) : XSRETURN_UNDEF;
+ if (msginfo->msgid) {
+ XSRETURN_PV(msginfo->msgid);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 9:
- msginfo->inreplyto ? XSRETURN_PV(msginfo->inreplyto) : XSRETURN_UNDEF;
+ if (msginfo->inreplyto) {
+ XSRETURN_PV(msginfo->inreplyto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 10:
- msginfo->xref ? XSRETURN_PV(msginfo->xref) : XSRETURN_UNDEF;
+ if (msginfo->xref) {
+ XSRETURN_PV(msginfo->xref);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 11:
xface = procmsg_msginfo_get_avatar(msginfo, AVATAR_XFACE);
- xface ? XSRETURN_PV(xface) : XSRETURN_UNDEF;
+ if (xface) {
+ XSRETURN_PV(xface);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 12:
- (msginfo->extradata && msginfo->extradata->dispositionnotificationto) ?
- XSRETURN_PV(msginfo->extradata->dispositionnotificationto) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->dispositionnotificationto) {
+ XSRETURN_PV(msginfo->extradata->dispositionnotificationto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 13:
- (msginfo->extradata && msginfo->extradata->returnreceiptto) ?
- XSRETURN_PV(msginfo->extradata->returnreceiptto) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->returnreceiptto) {
+ XSRETURN_PV(msginfo->extradata->returnreceiptto);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 14:
EXTEND(SP, g_slist_length(msginfo->references));
ii = 0;
for(walk = msginfo->references; walk != NULL; walk = g_slist_next(walk))
XST_mPV(ii++,walk->data ? (gchar*) walk->data: "");
- ii ? XSRETURN(ii) : XSRETURN_UNDEF;
+ if (ii) {
+ XSRETURN(ii);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 15:
- msginfo->score ? XSRETURN_IV(msginfo->score) : XSRETURN_UNDEF;
+ if (msginfo->score) {
+ XSRETURN_IV(msginfo->score);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 17:
- msginfo->plaintext_file ?
- XSRETURN_PV(msginfo->plaintext_file) : XSRETURN_UNDEF;
+ if (msginfo->plaintext_file) {
+ XSRETURN_PV(msginfo->plaintext_file);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 19:
- msginfo->hidden ? XSRETURN_IV(msginfo->hidden) : XSRETURN_UNDEF;
+ if (msginfo->hidden) {
+ XSRETURN_IV(msginfo->hidden);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 20:
if((charp = procmsg_get_message_file_path(msginfo)) != NULL) {
strncpy2(buf,charp,sizeof(buf));
g_free(charp);
XSRETURN_PV(buf);
}
- else
+ else {
XSRETURN_UNDEF;
+ }
case 21:
- (msginfo->extradata && msginfo->extradata->partial_recv) ?
- XSRETURN_PV(msginfo->extradata->partial_recv) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->partial_recv) {
+ XSRETURN_PV(msginfo->extradata->partial_recv);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 22:
- msginfo->total_size ? XSRETURN_IV(msginfo->total_size) : XSRETURN_UNDEF;
+ if (msginfo->total_size) {
+ XSRETURN_IV(msginfo->total_size);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 23:
- (msginfo->extradata && msginfo->extradata->account_server) ?
- XSRETURN_PV(msginfo->extradata->account_server) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->account_server) {
+ XSRETURN_PV(msginfo->extradata->account_server);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 24:
- (msginfo->extradata && msginfo->extradata->account_login) ?
- XSRETURN_PV(msginfo->extradata->account_login) : XSRETURN_UNDEF;
+ if (msginfo->extradata && msginfo->extradata->account_login) {
+ XSRETURN_PV(msginfo->extradata->account_login);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
case 25:
- msginfo->planned_download ?
- XSRETURN_IV(msginfo->planned_download) : XSRETURN_UNDEF;
+ if (msginfo->planned_download) {
+ XSRETURN_IV(msginfo->planned_download);
+ }
+ else {
+ XSRETURN_UNDEF;
+ }
/* general */
case 100:
- if(manual_filtering)
+ if(manual_filtering) {
XSRETURN_YES;
- else
+ }
+ else {
XSRETURN_NO;
+ }
default:
g_warning("Perl plugin: wrong argument to ClawsMail::C::init");
XSRETURN_UNDEF;
@@ -664,8 +770,9 @@ static XS(XS_ClawsMail_open_mail_file)
XSRETURN_UNDEF;
}
file = procmsg_get_message_file_path(msginfo);
- if(!file)
+ if(!file) {
XSRETURN_UNDEF;
+ }
if((message_file = claws_fopen(file, "rb")) == NULL) {
FILE_OP_ERROR(file, "claws_fopen");
g_warning("Perl plugin: file open error in ClawsMail::C::open_mail_file");
@@ -718,8 +825,9 @@ static XS(XS_ClawsMail_get_next_header)
g_free(buf);
XSRETURN(2);
}
- else
+ else {
XSRETURN_EMPTY;
+ }
}
/* ClawsMail::C::get_next_body_line */
@@ -736,10 +844,12 @@ static XS(XS_ClawsMail_get_next_body_line)
g_warning("Perl plugin: message file not open. Use ClawsMail::C::open_message_file first");
XSRETURN_UNDEF;
}
- if(claws_fgets(buf, sizeof(buf), message_file) != NULL)
+ if(claws_fgets(buf, sizeof(buf), message_file) != NULL) {
XSRETURN_PV(buf);
- else
+ }
+ else {
XSRETURN_UNDEF;
+ }
}
@@ -772,57 +882,65 @@ static XS(XS_ClawsMail_check_flag)
filter_log_write(LOG_MATCH,"marked");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 2:
if(MSG_IS_UNREAD(msginfo->flags)) {
filter_log_write(LOG_MATCH,"unread");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 3:
if(MSG_IS_DELETED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"deleted");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 4:
if(MSG_IS_NEW(msginfo->flags)) {
filter_log_write(LOG_MATCH,"new");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 5:
if(MSG_IS_REPLIED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"replied");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 6:
if(MSG_IS_FORWARDED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"forwarded");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 7:
if(MSG_IS_LOCKED(msginfo->flags)) {
filter_log_write(LOG_MATCH,"locked");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
case 8:
if(MSG_IS_IGNORE_THREAD(msginfo->flags)) {
filter_log_write(LOG_MATCH,"ignore_thread");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
default:
g_warning("Perl plugin: unknown argument to ClawsMail::C::check_flag");
XSRETURN_UNDEF;
@@ -845,8 +963,9 @@ static XS(XS_ClawsMail_colorlabel)
filter_log_write(LOG_MATCH,"colorlabel");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::age_greater(int) */
@@ -866,8 +985,9 @@ static XS(XS_ClawsMail_age_greater)
filter_log_write(LOG_MATCH,"age_greater");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::age_lower(int) */
@@ -887,8 +1007,9 @@ static XS(XS_ClawsMail_age_lower)
filter_log_write(LOG_MATCH,"age_lower");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
/* ClawsMail::C::tagged() */
@@ -900,7 +1021,12 @@ static XS(XS_ClawsMail_tagged)
XSRETURN_UNDEF;
}
- return msginfo->tags ? XSRETURN_YES : XSRETURN_NO;
+ if (msginfo->tags) {
+ XSRETURN_YES;
+ }
+ else {
+ XSRETURN_NO;
+ }
}
/* ClawsMail::C::get_tags() */
@@ -1032,10 +1158,12 @@ static XS(XS_ClawsMail_make_sure_folder_exists)
identifier = SvPV_nolen(ST(0));
item = folder_get_item_from_identifier(identifier);
- if(item)
+ if(item) {
XSRETURN_YES;
- else
+ }
+ else {
XSRETURN_NO;
+ }
}
@@ -1066,8 +1194,9 @@ static XS(XS_ClawsMail_addr_in_addressbook)
filter_log_write(LOG_MATCH,"addr_in_addressbook");
XSRETURN_YES;
}
- else
+ else {
XSRETURN_NO;
+ }
}
@@ -1348,8 +1477,9 @@ static XS(XS_ClawsMail_forward)
XSRETURN_YES;
}
- else
+ else {
XSRETURN_UNDEF;
+ }
}
/* ClawsMail::C::redirect(int,char*) */
@@ -1373,8 +1503,9 @@ static XS(XS_ClawsMail_redirect)
account = account_find_from_id(account_id);
compose = compose_redirect(account, msginfo, TRUE);
- if (compose->account->protocol == A_NNTP)
+ if (compose->account->protocol == A_NNTP) {
XSRETURN_UNDEF;
+ }
else
compose_entry_append(compose, dest, COMPOSE_TO, PREF_NONE);
@@ -1389,8 +1520,9 @@ static XS(XS_ClawsMail_redirect)
XSRETURN_YES;
}
- else
+ else {
XSRETURN_UNDEF;
+ }
}
@@ -1472,8 +1604,9 @@ static XS(XS_ClawsMail_get_attribute_value)
attribute_value = get_attribute_value(addr,attr,bookname);
}
- if(attribute_value)
+ if(attribute_value) {
XSRETURN_PV(attribute_value);
+ }
XSRETURN_PV("");
}