git: 9ea8a1445562 - 2023Q1 - devel/rubygem-oj-introspect: added new port

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Thu, 12 Jan 2023 09:53:28 UTC
The branch 2023Q1 has been updated by mfechner:

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

commit 9ea8a14455628b073e8bec196b120f46c78200dc
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2022-12-20 18:03:13 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2023-01-12 05:58:26 +0000

    devel/rubygem-oj-introspect: added new port
    
    Required for gitlab-ce 15.6.
    
    (cherry picked from commit 78a749f6241b911d5dab458908c7327890cfe7f2)
---
 devel/rubygem-oj-introspect/Makefile               |  6 +++++-
 .../files/patch-ext_oj-introspect_extconf.rb       | 25 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/devel/rubygem-oj-introspect/Makefile b/devel/rubygem-oj-introspect/Makefile
index ce3fe2189a44..ba1da0bf6608 100644
--- a/devel/rubygem-oj-introspect/Makefile
+++ b/devel/rubygem-oj-introspect/Makefile
@@ -10,9 +10,13 @@ WWW=		https://github.com/meinac/oj-introspect
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-RUN_DEPENDS=	rubygem-oj>=3.13.23<3.14:devel/rubygem-oj
+MY_DEPENDS=	rubygem-oj>=3.13.23<3.14:devel/rubygem-oj
+BUILD_DEPENDS=	${MY_DEPENDS}
+RUN_DEPENDS=	${MY_DEPENDS}
 
 USES=		gem
 USE_RUBY=	yes
+#USE_RUBY_EXTCONF=	yes
+#RUBY_EXTCONF_SUBDIRS=	ext/oj-introspect
 
 .include <bsd.port.mk>
diff --git a/devel/rubygem-oj-introspect/files/patch-ext_oj-introspect_extconf.rb b/devel/rubygem-oj-introspect/files/patch-ext_oj-introspect_extconf.rb
new file mode 100644
index 000000000000..11cdf262eeb3
--- /dev/null
+++ b/devel/rubygem-oj-introspect/files/patch-ext_oj-introspect_extconf.rb
@@ -0,0 +1,25 @@
+--- ext/oj-introspect/extconf.rb.orig	2023-01-10 13:31:58 UTC
++++ ext/oj-introspect/extconf.rb
+@@ -7,22 +7,6 @@ oj_version_file_path = Pathname.new(oj_version_file)
+ 
+ OJ_HEADERS = oj_version_file_path.join('..', '..', '..', 'ext', 'oj').to_s
+ 
+-cc_version = `#{RbConfig.expand("$(CC) --version".dup)}`
+-if cc_version.match?(/clang/i)
+-  # Ignore symbols loaded from Oj in case Ruby is compiled without
+-  # "-Wl,-undefined,dynamic_lookup" (related to https://bugs.ruby-lang.org/issues/19005)
+-  symfile = File.join(__dir__, 'oj.sym')
+-  dynamic_symbols = File.readlines(symfile)
+-  dynamic_symbols.each do |sym|
+-    $DLDFLAGS << " -Wl,-U,#{sym.strip}"
+-  end
+-
+-  # Needed for Ruby 3.2 ABI check: https://github.com/ruby/ruby/pull/5474
+-  if RUBY_VERSION >= "3.2"
+-    $LDFLAGS << " -Wl,-exported_symbol,_ruby_abi_version"
+-  end
+-end
+-
+ dir_config('oj', [OJ_HEADERS], [])
+ 
+ create_makefile("oj/introspect/introspect_ext")