git: a250fafe9d80 - main - mail/rubygem-mail: Add dependencies for Ruby 3.1+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 25 Mar 2022 13:49:06 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a250fafe9d8079da3a82d084696f25a3800723e8

commit a250fafe9d8079da3a82d084696f25a3800723e8
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-03-25 13:11:04 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-03-25 13:37:58 +0000

    mail/rubygem-mail: Add dependencies for Ruby 3.1+
    
    - Bump PORTREVISION for dependency change
    
    This commit also reverts da6b7803d1f8bccac09d69a6d2eaa96e93522743.
    
    Reference:      https://github.com/mikel/mail/pull/1439
---
 mail/rubygem-mail/Makefile                 | 19 ++++++++++++++-----
 mail/rubygem-mail/files/patch-mail.gemspec | 18 ------------------
 2 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/mail/rubygem-mail/Makefile b/mail/rubygem-mail/Makefile
index 0c4695ae0124..51bdd9d2e8fb 100644
--- a/mail/rubygem-mail/Makefile
+++ b/mail/rubygem-mail/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	mail
 PORTVERSION=	2.7.1
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	2
 CATEGORIES=	mail rubygems
 MASTER_SITES=	RG
@@ -13,13 +13,22 @@ COMMENT=	Ruby email handler
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/MIT-LICENSE
 
-RUN_DEPENDS=	rubygem-mini_mime>=0.1.1:mail/rubygem-mini_mime \
-		rubygem-net-smtp>0:mail/rubygem-net-smtp
+RUN_DEPENDS=	rubygem-mini_mime>=0.1.1:mail/rubygem-mini_mime
 
 USES=		cpe gem
-CPE_VENDOR=	${PORTNAME}_project
 USE_RUBY=	yes
 
 NO_ARCH=	yes
 
-.include <bsd.port.mk>
+CPE_VENDOR=	mail_project
+
+.include <bsd.port.pre.mk>
+
+# See https://github.com/mikel/mail/pull/1439
+.if ${RUBY_VER} >= 3.1
+RUN_DEPENDS+=	rubygem-net-imap>=0:mail/rubygem-net-imap \
+		rubygem-net-pop>=0:mail/rubygem-net-pop \
+		rubygem-net-smtp>=0:mail/rubygem-net-smtp
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/mail/rubygem-mail/files/patch-mail.gemspec b/mail/rubygem-mail/files/patch-mail.gemspec
deleted file mode 100644
index 5b1682def046..000000000000
--- a/mail/rubygem-mail/files/patch-mail.gemspec
+++ /dev/null
@@ -1,18 +0,0 @@
---- mail.gemspec.orig	2021-11-10 18:38:59 UTC
-+++ mail.gemspec
-@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
-   end
- 
-   if s.respond_to? :add_runtime_dependency then
-+    s.add_runtime_dependency(%q<net-smtp>.freeze, [">= 0"])
-     s.add_runtime_dependency(%q<mini_mime>.freeze, [">= 0.1.1"])
-     s.add_development_dependency(%q<bundler>.freeze, [">= 1.0.3"])
-     s.add_development_dependency(%q<rake>.freeze, ["> 0.8.7"])
-@@ -31,6 +32,7 @@ Gem::Specification.new do |s|
-     s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
-     s.add_development_dependency(%q<rufo>.freeze, [">= 0"])
-   else
-+    s.add_dependency(%q<net-smtp>.freeze, [">= 0"])
-     s.add_dependency(%q<mini_mime>.freeze, [">= 0.1.1"])
-     s.add_dependency(%q<bundler>.freeze, [">= 1.0.3"])
-     s.add_dependency(%q<rake>.freeze, ["> 0.8.7"])