|
66 | 66 | elsif platform.is_macos?
|
67 | 67 | pkg.environment 'optflags', settings[:cflags]
|
68 | 68 | if platform.is_cross_compiled?
|
69 |
| - # Pin to an older version of [email protected] hosted by Puppet as Homebrew |
70 |
| - # moved its Ruby 2.7 formula from OpenSSL 1.1 to 3.0 |
71 |
| - if ruby_version_y == "2.7" |
72 |
| - pkg.build_requires "puppetlabs/puppet/[email protected]" |
73 |
| - else |
74 |
| - pkg.build_requires "ruby@#{ruby_version_y}" |
75 |
| - end |
| 69 | + pkg.build_requires "ruby@#{ruby_version_y}" |
76 | 70 | pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/
|
77 | 71 | pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/
|
78 | 72 | elsif platform.architecture == 'arm64' && platform.os_version.to_i >= 13
|
|
118 | 112 | pkg.install do
|
119 | 113 | [ "#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install" ]
|
120 | 114 | end
|
121 |
| - |
122 |
| -# For the pdk runtime, the ruby bin directory is different then the main bin |
123 |
| -# directory. In order to run ruby *outside* of the normal pdk.bat then we need |
124 |
| -# to copy all dlls that ruby depends on from the main bin directory to ruby's |
125 |
| -# bin directory. This is because the main bin directory is not in our system |
126 |
| -# PATH and Windows doesn't support RPATH. However, as mentioned in |
127 |
| -# https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order, |
128 |
| -# Windows searches for DLLs in "The folder the calling process was loaded from |
129 |
| -# (the executable's folder)." |
130 |
| -# |
131 |
| -# The agent runtime used to have the same issue prior to puppet 6, for example |
132 |
| -# RE-7593. However, Windows paths were changed to match *nix in puppet 6, see |
133 |
| -# commit 4b9d126dd5b. So only the pdk has this issue. |
134 |
| -if platform.is_windows? && settings[:bindir] != ruby_bindir |
135 |
| - bindir = settings[:bindir] |
136 |
| - |
137 |
| - # Ruby 3+ |
138 |
| - if Gem::Version.new(pkg.get_version) >= Gem::Version.new('3.0') |
139 |
| - pkg.install do |
140 |
| - [ |
141 |
| - "cp #{settings[:gcc_bindir]}/libssp-0.dll #{ruby_bindir}", |
142 |
| - "cp #{bindir}/libffi-8.dll #{ruby_bindir}", |
143 |
| - "cp #{bindir}/libyaml-0-2.dll #{ruby_bindir}" |
144 |
| - ] |
145 |
| - end |
146 |
| - end |
147 |
| - |
148 |
| - if platform.architecture == "x64" |
149 |
| - gcc_postfix = 'seh' |
150 |
| - ssl_postfix = '-x64' |
151 |
| - else |
152 |
| - gcc_postfix = 'sjlj' |
153 |
| - ssl_postfix = '' |
154 |
| - end |
155 |
| - |
156 |
| - # OpenSSL |
157 |
| - if Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('3.0') |
158 |
| - ssl_lib = "libssl-3#{ssl_postfix}.dll" |
159 |
| - crypto_lib = "libcrypto-3#{ssl_postfix}.dll" |
160 |
| - elsif Gem::Version.new(settings[:openssl_version]) >= Gem::Version.new('1.1.0') |
161 |
| - ssl_lib = "libssl-1_1#{ssl_postfix}.dll" |
162 |
| - crypto_lib = "libcrypto-1_1#{ssl_postfix}.dll" |
163 |
| - else |
164 |
| - ssl_lib = "ssleay32.dll" |
165 |
| - crypto_lib = "libeay32.dll" |
166 |
| - end |
167 |
| - |
168 |
| - pkg.install do |
169 |
| - [ |
170 |
| - "cp #{bindir}/libgcc_s_#{gcc_postfix}-1.dll #{ruby_bindir}", |
171 |
| - "cp #{bindir}/#{ssl_lib} #{ruby_bindir}", |
172 |
| - "cp #{bindir}/#{crypto_lib} #{ruby_bindir}" |
173 |
| - ] |
174 |
| - end |
175 |
| - |
176 |
| - pkg.directory ruby_dir |
177 |
| -end |
0 commit comments