git: 14dd59de61a1 - main - devel/rubygem-pdk: Fix packaging

From: Romain Tartière <romain_at_FreeBSD.org>
Date: Wed, 29 Jun 2022 05:55:00 UTC
The branch main has been updated by romain:

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

commit 14dd59de61a1b65bd280535c2761bbe7c03dcf76
Author:     Romain Tartière <romain@FreeBSD.org>
AuthorDate: 2022-06-29 05:54:16 +0000
Commit:     Romain Tartière <romain@FreeBSD.org>
CommitDate: 2022-06-29 05:54:44 +0000

    devel/rubygem-pdk: Fix packaging
    
    While here, mark broken with "modern" Ruby because it use some legacy
    Ruby syntax but when corrected still fails with nonexistent dependencies:
    https://github.com/puppetlabs/puppet-module-gems/issues/166
    
    With hat:       puppet
---
 devel/rubygem-pdk/Makefile                         |  3 ++
 .../files/patch-lib_pdk_cli_exec_command.rb        | 20 +++++-----
 .../files/patch-lib_pdk_util_bundler.rb            | 46 +++++++++++-----------
 3 files changed, 36 insertions(+), 33 deletions(-)

diff --git a/devel/rubygem-pdk/Makefile b/devel/rubygem-pdk/Makefile
index d8f253f0b7b2..8cad6a4cb69f 100644
--- a/devel/rubygem-pdk/Makefile
+++ b/devel/rubygem-pdk/Makefile
@@ -28,6 +28,9 @@ RUN_DEPENDS=	rubygem-bundler>=1.15:sysutils/rubygem-bundler \
 		rubygem-tty-spinner>=0.5:devel/rubygem-tty-spinner \
 		rubygem-tty-which>=0.3:devel/rubygem-tty-which
 
+BROKEN_RUBY30=	yes
+BROKEN_RUBY31=	yes
+
 USES=		gem
 USE_RUBY=	yes
 
diff --git a/devel/rubygem-pdk/files/patch-lib_pdk_cli_exec_command.rb b/devel/rubygem-pdk/files/patch-lib_pdk_cli_exec_command.rb
index 3b382ad89ec7..752848908f62 100644
--- a/devel/rubygem-pdk/files/patch-lib_pdk_cli_exec_command.rb
+++ b/devel/rubygem-pdk/files/patch-lib_pdk_cli_exec_command.rb
@@ -1,11 +1,11 @@
---- lib/pdk/cli/exec/command.rb.orig	2022-02-13 01:06:51 UTC
+--- lib/pdk/cli/exec/command.rb.orig	2022-06-29 04:55:12 UTC
 +++ lib/pdk/cli/exec/command.rb
-@@ -187,7 +187,7 @@ module PDK
- 
-             resolved_env['GEM_HOME'] = PDK::Util::RubyVersion.gem_home
-             gem_path = PDK::Util::RubyVersion.gem_path
--            resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
-+            # resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
- 
-             # Make sure invocation of Ruby prefers our private installation.
-             package_binpath = PDK::Util.package_install? ? File.join(PDK::Util.pdk_package_basedir, 'bin') : nil
+@@ -187,7 +187,7 @@ module PDK
+ 
+             resolved_env['GEM_HOME'] = PDK::Util::RubyVersion.gem_home
+             gem_path = PDK::Util::RubyVersion.gem_path
+-            resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
++            # resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
+ 
+             # Make sure invocation of Ruby prefers our private installation.
+             package_binpath = PDK::Util.package_install? ? File.join(PDK::Util.pdk_package_basedir, 'bin') : nil
diff --git a/devel/rubygem-pdk/files/patch-lib_pdk_util_bundler.rb b/devel/rubygem-pdk/files/patch-lib_pdk_util_bundler.rb
index aee8e54bf96f..12f5515fd640 100644
--- a/devel/rubygem-pdk/files/patch-lib_pdk_util_bundler.rb
+++ b/devel/rubygem-pdk/files/patch-lib_pdk_util_bundler.rb
@@ -1,24 +1,24 @@
---- lib/pdk/util/bundler.rb.orig	2022-02-13 01:09:14 UTC
+--- lib/pdk/util/bundler.rb.orig	2022-06-29 05:24:26 UTC
 +++ lib/pdk/util/bundler.rb
-@@ -21,12 +21,7 @@ module PDK
-           return
-         end
- 
--        unless bundle.locked?
--          # Generate initial default Gemfile.lock, either from package cache or
--          # by invoking `bundle lock`
--          bundle.lock!
--        end
--
-+        if bundle.locked?
-         # Check if all dependencies will be available once we update the lockfile.
-         begin
-           original_lockfile = bundle.gemfile_lock
-@@ -40,6 +35,7 @@ module PDK
-         end
- 
-         bundle.update_lock!(with: gem_overrides, local: all_deps_available)
-+        end
- 
-         # If there are missing dependencies after updating the lockfile, let `bundle install`
-         # go out and get them. If the specified puppet gem version points to a remote location
+@@ -21,12 +21,7 @@ module PDK
+           return
+         end
+ 
+-        unless bundle.locked?
+-          # Generate initial default Gemfile.lock, either from package cache or
+-          # by invoking `bundle lock`
+-          bundle.lock!
+-        end
+-
++        if bundle.locked?
+         # Check if all dependencies will be available once we update the lockfile.
+         begin
+           original_lockfile = bundle.gemfile_lock
+@@ -40,6 +35,7 @@ module PDK
+         end
+ 
+         bundle.update_lock!(with: gem_overrides, local: all_deps_available)
++        end
+ 
+         # If there are missing dependencies after updating the lockfile, let `bundle install`
+         # go out and get them. If the specified puppet gem version points to a remote location