git: e72515028ca9 - main - devel/rubygem-rugged: use bundled ligbit2

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Thu, 07 Nov 2024 16:25:36 UTC
The branch main has been updated by mfechner:

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

commit e72515028ca9a44595cc728401c341e4858699de
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2024-11-07 16:23:01 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2024-11-07 16:25:16 +0000

    devel/rubygem-rugged: use bundled ligbit2
    
    the current libgit2 (1.8.x) is not compatible with rugged and is
    causing problem with ssh support.
    
    PR:             282593
    Reported by:    einar@isnic.is
---
 devel/rubygem-rugged/Makefile                      | 19 +++++++----
 .../files/patch-ext_rugged_extconf.rb              | 37 ----------------------
 2 files changed, 13 insertions(+), 43 deletions(-)

diff --git a/devel/rubygem-rugged/Makefile b/devel/rubygem-rugged/Makefile
index 82cd322f211b..f4759eef2697 100644
--- a/devel/rubygem-rugged/Makefile
+++ b/devel/rubygem-rugged/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	rugged
 PORTVERSION=	1.7.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel rubygems
 MASTER_SITES=	RG
 
@@ -13,11 +13,18 @@ WWW=		https://github.com/libgit2/rugged
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BUILD_DEPENDS=	libgit2>=${PORTVERSION:R}:devel/libgit2
-LIB_DEPENDS=	libgit2.so:devel/libgit2 \
-		libgmp.so:math/gmp
+# switch to bundled libgit2 version as rugged does not support 1.8 version from ports (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282593)
+#BUILD_DEPENDS=	libgit2>=${PORTVERSION:R}:devel/libgit2
+#LIB_DEPENDS=	libgit2.so:devel/libgit2 \
+#		libgmp.so:math/gmp
+#CONFIGURE_ARGS=	--use-system-libraries
+#USES=		gem pkgconfig
+LIB_DEPENDS=	libssh2.so:security/libssh2
 
-CONFIGURE_ARGS=	--use-system-libraries
-USES=		gem pkgconfig
+CONFIGURE_ARGS=	--with-ssh
+USES=		cmake:indirect gem pkgconfig ssl
+
+post-install:
+	${RM} -r ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR}/vendor/libgit2/build
 
 .include <bsd.port.mk>
diff --git a/devel/rubygem-rugged/files/patch-ext_rugged_extconf.rb b/devel/rubygem-rugged/files/patch-ext_rugged_extconf.rb
deleted file mode 100644
index 41fd2d2aed76..000000000000
--- a/devel/rubygem-rugged/files/patch-ext_rugged_extconf.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# Remove broken libgit2 detection
-
---- ext/rugged/extconf.rb.orig	2024-10-19 10:29:11 UTC
-+++ ext/rugged/extconf.rb
-@@ -65,32 +65,6 @@ if arg_config("--use-system-libraries", !!ENV['RUGGED_
- 
- if arg_config("--use-system-libraries", !!ENV['RUGGED_USE_SYSTEM_LIBRARIES'])
-   puts "Building Rugged using system libraries.\n"
--
--  dir_config('git2').any? or pkg_config('libgit2')
--
--  major = minor = nil
--
--  File.readlines(File.join(LIBGIT2_DIR, "include", "git2", "version.h")).each do |line|
--    if !major && (matches = line.match(/^#define LIBGIT2_VER_MAJOR\s+([0-9]+)$/))
--      major = matches[1]
--      next
--    end
--
--    if !minor && (matches = line.match(/^#define LIBGIT2_VER_MINOR\s+([0-9]+)$/))
--      minor = matches[1]
--      next
--    end
--
--    break if major && minor
--  end
--
--  try_compile(<<-SRC) or abort "libgit2 version is not compatible, expected ~> #{major}.#{minor}.0"
--#include <git2/version.h>
--
--#if LIBGIT2_VER_MAJOR != #{major} || LIBGIT2_VER_MINOR != #{minor}
--#error libgit2 version is not compatible
--#endif
--  SRC
- else
-   if !find_executable('cmake')
-     abort "ERROR: CMake is required to build Rugged."