aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Kimura <yasu@FreeBSD.org>2023-01-28 05:35:34 +0000
committerYasuhiro Kimura <yasu@FreeBSD.org>2023-02-11 05:59:02 +0000
commitfc1c752e8b1cfb6162b9243f275efbe33ec04757 (patch)
tree9714fb11ab97f761896c90fc39ed5a89c4a152e6
parente83df13905e945f1b776a84ff8abfeda29f04743 (diff)
downloadports-fc1c752e8b1cfb6162b9243f275efbe33ec04757.tar.gz
ports-fc1c752e8b1cfb6162b9243f275efbe33ec04757.zip
lang/ruby31: Add upstream patch to fix bug of mkmf library
There is bug in mkmf library of Ruby 3.1 that it fails to detect pkg-config command if it isn't installed in environment that Ruby is built, and it causes build error of some ports when default version of Ruby is 3.1. So add upstream patch to fix it. Reference: https://bugs.ruby-lang.org/issues/19189 PR: 269197 Approved by: maintainer timeout MFH: 2023Q1
-rw-r--r--Mk/Uses/ruby.mk2
-rw-r--r--lang/ruby31/files/patch-mkmf-pkg-config25
2 files changed, 26 insertions, 1 deletions
diff --git a/Mk/Uses/ruby.mk b/Mk/Uses/ruby.mk
index da2e4ea30a4e..46b76fd7e423 100644
--- a/Mk/Uses/ruby.mk
+++ b/Mk/Uses/ruby.mk
@@ -162,7 +162,7 @@ RUBY_PORTREVISION= 0
# Ruby 3.1
#
RUBY_DISTVERSION= 3.1.3
-RUBY_PORTREVISION= 0
+RUBY_PORTREVISION= 1
. elif ${RUBY_VER} == 3.2
#
diff --git a/lang/ruby31/files/patch-mkmf-pkg-config b/lang/ruby31/files/patch-mkmf-pkg-config
new file mode 100644
index 000000000000..f966b82eadb1
--- /dev/null
+++ b/lang/ruby31/files/patch-mkmf-pkg-config
@@ -0,0 +1,25 @@
+From 613fca01486e47dee9364a2fd86b5f5e77fe23c8 Mon Sep 17 00:00:00 2001
+From: Nobuyoshi Nakada <nobu@ruby-lang.org>
+Date: Wed, 7 Dec 2022 22:14:44 +0900
+Subject: [PATCH] [Bug #19189] Fallback to the default "pkg-config"
+
+---
+ lib/mkmf.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git lib/mkmf.rb lib/mkmf.rb
+index e94733c635..0fbc1cc2e5 100644
+--- lib/mkmf.rb
++++ lib/mkmf.rb
+@@ -1866,7 +1866,7 @@ def pkg_config(pkg, *options)
+ if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
+ # if and only if package specific config command is given
+ elsif ($PKGCONFIG ||=
+- (pkgconfig = with_config("pkg-config", RbConfig::CONFIG["PKG_CONFIG"])) &&
++ (pkgconfig = with_config("pkg-config") {config_string("PKG_CONFIG") || "pkg-config"}) &&
+ find_executable0(pkgconfig) && pkgconfig) and
+ xsystem([*envs, $PKGCONFIG, "--exists", pkg])
+ # default to pkg-config command
+--
+2.39.1
+