On Mon, Jul 31, 2017 at 10:34:53AM +0200, Patrice Clement wrote:
Hi Nicolas

See my comments inline.

Monday 31 Jul 2017 09:23:51, Nicolas Bock wrote :
On Mon, Jul 31, 2017 at 09:11:19AM +0200, Nicolas Bock wrote:
>Hi,
>
>I would like to add neomutt to the tree. This new package is meant as
>an alternative and not a replacement of the existing mutt package.

I should have inlined the patch. Sorry.



From 63f5d569aec514d67645b1c2e891e51810bb7ab5 Mon Sep 17 00:00:00 2001
From: Nicolas Bock <nicolasb...@gentoo.org>
Date: Mon, 31 Jul 2017 09:06:07 +0200
Subject: [PATCH] mail-client/neomutt: New package mail-client/neomutt-20170714

Package-Manager: Portage-2.3.6, Repoman-2.3.1
---
 mail-client/neomutt/Manifest                |   1 +
 mail-client/neomutt/metadata.xml            |  24 +++++
 mail-client/neomutt/neomutt-20170714.ebuild | 161 ++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+)
 create mode 100644 mail-client/neomutt/Manifest
 create mode 100644 mail-client/neomutt/metadata.xml
 create mode 100644 mail-client/neomutt/neomutt-20170714.ebuild

diff --git a/mail-client/neomutt/Manifest b/mail-client/neomutt/Manifest
new file mode 100644
index 00000000000..2b38484e24d
--- /dev/null
+++ b/mail-client/neomutt/Manifest
@@ -0,0 +1 @@
+DIST neomutt-20170714.tar.gz 2509160 SHA256 
40d48920f95ca49ab96eb109b658f5cf6e1c222320c58bdd03769c1355d7a383 SHA512 
eb31d2f23b7211904cd66ba293c008f953778b37f13fd09d4db571d013f1c8e6449fccd827872f3ad0a2c8e62555f92b3f9591a1f0f4ac37ab362a4681abaaa0
 WHIRLPOOL 
455495501a2ab1989d5f3bfa75aa2370896956cdfd7d2e852e225c96aa23a1abdaf2dbb9d886d1d96486d19b2b38c225e8263f268ebafcef8cbd0024885189f3
diff --git a/mail-client/neomutt/metadata.xml b/mail-client/neomutt/metadata.xml
new file mode 100644
index 00000000000..081f253b3a1
--- /dev/null
+++ b/mail-client/neomutt/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>nicolasb...@gentoo.org</email>
+               <name>Nicolas Bock</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>net-m...@gentoo.org</email>
+               <name>Net-Mail</name>
+       </maintainer>
+       <use>
+               <flag name="gpg">Enable support for 
<pkg>app-crypt/gpgme</pkg></flag>
+               <flag name="notmuch">Enable support for 
<pkg>net-mail/notmuch</pkg></flag>
+               <flag name="smime">Enable support for S/MIME</flag>
+               <flag name="tokyocabinet">Enable <pkg>dev-db/tokyocabinet</pkg>
+                       database backend for header caching</flag>
+       </use>
+       <longdescription lang="en">
+       </longdescription>
+       <upstream>
+               <remote-id type="github">neomutt/neomutt</remote-id>
+       </upstream>
+</pkgmetadata>
diff --git a/mail-client/neomutt/neomutt-20170714.ebuild 
b/mail-client/neomutt/neomutt-20170714.ebuild
new file mode 100644
index 00000000000..9bcf72e7479
--- /dev/null
+++ b/mail-client/neomutt/neomutt-20170714.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="A small but very powerful text-based mail client"
+HOMEPAGE="https://www.neomutt.org/";
+SRC_URI="https://github.com/${PN}/${PN}/archive/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="berkdb crypt debug doc gdbm gnutls gpg idn kerberos libressl mbox nls
+       notmuch qdbm sasl selinux slang smime ssl tokyocabinet vanilla"
+
+CDEPEND="
+       !mail-client/mutt
+       app-misc/mime-types
+       nls? ( virtual/libintl )
+       tokyocabinet?  ( dev-db/tokyocabinet )
+       !tokyocabinet? (
+               qdbm?  ( dev-db/qdbm )
+               !qdbm? (
+                       gdbm?  ( sys-libs/gdbm )
+                       !gdbm? ( berkdb? ( >=sys-libs/db-4:= ) )
+               )
+       )
+       gnutls?  ( >=net-libs/gnutls-1.0.17 )
+       !gnutls? (
+               ssl? (
+                       !libressl? ( >=dev-libs/openssl-0.9.6:0 )
+                       libressl? ( dev-libs/libressl )
+               )
+       )
+       sasl?    ( >=dev-libs/cyrus-sasl-2 )
+       kerberos? ( virtual/krb5 )
+       idn?     ( net-dns/libidn )
+       gpg?     ( >=app-crypt/gpgme-0.9.0 )
+       smime?   (
+               !libressl? ( >=dev-libs/openssl-0.9.6:0 )
+               libressl? ( dev-libs/libressl )
+       )
+       notmuch? ( net-mail/notmuch )
+       slang? ( sys-libs/slang )
+       !slang? ( >=sys-libs/ncurses-5.2:0 )
+"
+DEPEND="${CDEPEND}
+       net-mail/mailbase
+       doc? (
+               dev-libs/libxml2
+               dev-libs/libxslt
+               app-text/docbook-xsl-stylesheets
+               || ( www-client/lynx www-client/w3m www-client/elinks )
+       )"
+RDEPEND="${CDEPEND}
+       selinux? ( sec-policy/selinux-mutt )
+"
+
+S="${WORKDIR}/${PN}-${P}"
+
+src_prepare() {
+       eapply_user
+       eautoreconf
+}
+
+src_configure() {
+       local myconf=(
+               "$(use_enable crypt pgp)"
+               "$(use_enable debug)"
+               "$(use_enable doc)"
+               "$(use_enable gpg gpgme)"
+               "$(use_enable nls)"
+               "$(use_enable smime)"
+               "$(use_enable notmuch)"
+               "$(use_with idn)"
+               "$(use_with kerberos gss)"
+               "--with-$(use slang && echo slang || echo 
curses)=${EPREFIX}/usr"
+               "--sysconfdir=${EPREFIX}/etc/${PN}"
+               "--with-docdir=${EPREFIX}/usr/share/doc/${PN}-${PVR}"
+       )
+
+       if [[ ${CHOST} == *-solaris* ]] ; then
+               # arrows in index view do not show when using wchar_t
+               myconf+=( "--without-wc-funcs" )
+       fi
+
+       # mutt prioritizes gdbm over bdb, so we will too.
+       # hcache feature requires at least one database is in USE.
+       local hcaches=(
+               "tokyocabinet"
+               "qdbm"
+               "gdbm"
+               "berkdb:bdb"
+       )
+       local ucache hcache lcache
+       for hcache in "${hcaches[@]}" ; do
+               if use ${hcache%%:*} ; then
+                       ucache=${hcache}
+                       break
+               fi
+       done
+       for hcache in "${hcaches[@]}" ; do
+               [[ ${hcache} == ${ucache} ]] \
+                       && myconf+=( "--with-${hcache#*:}" ) \
+                       || myconf+=( "--without-${hcache#*:}" )
+       done
Can you simplify this code a little?

Fixed.

+
+       # there's no need for gnutls, ssl or sasl without socket support
+       if use gnutls; then
+               myconf+=( "--with-gnutls" )
+       elif use ssl; then
+               myconf+=( "--with-ssl" )
+       fi
+       # not sure if this should be mutually exclusive with the other two
+       myconf+=( "$(use_with sasl)" )
+
+       if use mbox; then
+               myconf+=( "--with-mailpath=${EPREFIX}/var/spool/mail" )
+       else
+               myconf+=( "--with-homespool=Maildir" )
+       fi
+
+       econf "${myconf[@]}" || die "configure failed"
econf dies on its own, please nix || die.

Fixed.

+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die "install failed"
+       if use mbox; then
+               insinto /etc/neomutt
+               newins "${FILESDIR}"/Muttrc.mbox Muttrc
+       else
+               insinto /etc/neomutt
+               doins "${FILESDIR}"/Muttrc
+       fi
+
+       # A newer file is provided by app-misc/mime-types. So we link it.
+       rm "${ED}"/etc/${PN}/mime.types
Please append || die here.

Fixed.

+       dosym /etc/mime.types /etc/${PN}/mime.types
+
+       # A man-page is always handy, so fake one
+       if use !doc; then
+               emake -C doc DESTDIR="${D}" muttrc.man || die
emake dies on its own.

Fixed.

+               # make the fake slightly better, bug #413405
+               sed -e 
's#@docdir@/manual.txt#http://www.mutt.org/doc/devel/manual.html#' \
+                       -e 's#in @docdir@,#at http://www.mutt.org/,#' \
+                       -e "s#@sysconfdir@#${EPREFIX}/etc/${PN}#" \
+                       -e "s#@bindir@#${EPREFIX}/usr/bin#" \
+                       doc/mutt.man > mutt.1
Ditto, append || die here as well.

Fixed.

+               cp doc/muttrc.man muttrc.5
Ditto.

Fixed.

+               doman mutt.1 muttrc.5
+       else
+               # nuke manpages that should be provided by an MTA, bug #177605
+               rm "${ED}"/usr/share/man/man5/{mbox,mmdf}.5 \
+                       || ewarn "failed to remove files, please file a bug"
+       fi
+
+       dodoc COPYRIGHT ChangeLog.md OPS* README*
+}
--
2.13.0


--
Nicolas Bock <nicolasb...@gentoo.org>



--
Patrice Clement
Gentoo Linux developer
http://www.gentoo.org



--
Nicolas Bock <nicolasb...@gentoo.org>

Attachment: signature.asc
Description: PGP signature

Reply via email to