From 2516e16254896c1f286a495f34b9e31ea182b015 Mon Sep 17 00:00:00 2001 From: tvpartytonight Date: Mon, 11 Dec 2023 10:34:27 -0800 Subject: [PATCH] (PA-5929) Don't overwrite windows specific install blocks The placement of the logic to enable/disable the system-ffi should not overwrite the windows specific install blocks. --- configs/components/rubygem-ffi.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/components/rubygem-ffi.rb b/configs/components/rubygem-ffi.rb index 40254afdf..408c54cce 100644 --- a/configs/components/rubygem-ffi.rb +++ b/configs/components/rubygem-ffi.rb @@ -19,6 +19,16 @@ rb_major_minor_version = settings[:ruby_version].to_f + if rb_major_minor_version > 2.7 + pkg.install do + "#{settings[:gem_install]} ffi-#{pkg.get_version}.gem -- --enable-system-ffi" + end + else + pkg.install do + "#{settings[:gem_install]} ffi-#{pkg.get_version}.gem -- --disable-system-ffi" + end + end + # Windows versions of the FFI gem have custom filenames, so we overwite the # defaults that _base-rubygem provides here, just for Windows for Ruby < 3.2 if platform.is_windows? && rb_major_minor_version < 3.2 @@ -86,16 +96,6 @@ pkg.install_file "/opt/csw/lib/libffi.so.6", "#{settings[:libdir]}/libffi.so.6" end - if rb_major_minor_version > 2.7 - pkg.install do - "#{settings[:gem_install]} ffi-#{pkg.get_version}.gem -- --enable-system-ffi" - end - else - pkg.install do - "#{settings[:gem_install]} ffi-#{pkg.get_version}.gem -- --disable-system-ffi" - end - end - pkg.environment 'PKG_CONFIG_PATH', '/opt/puppetlabs/puppet/lib/pkgconfig:$(PKG_CONFIG_PATH)' pkg.environment 'PATH', '/opt/freeware/bin:/opt/pl-build-tools/bin:$(PATH)' if platform.is_aix?