Skip to content

Commit

Permalink
(PA-5594) Enable macOS 13 (ARM) puppet-runtime builds for agent-runti…
Browse files Browse the repository at this point in the history
…me-7.x
  • Loading branch information
skyamgarp committed Jul 11, 2023
1 parent 0108dfc commit fb126f6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
17 changes: 11 additions & 6 deletions configs/components/openssl-1.1.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@
ldflags = "-R/opt/pl-build-tools/#{settings[:platform_triple]}/lib -Wl,-rpath=#{settings[:libdir]} -L/opt/pl-build-tools/#{settings[:platform_triple]}/lib"
target = platform.architecture =~ /86/ ? 'solaris-x86-gcc' : 'solaris-sparcv9-gcc'
elsif platform.is_macos?
pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin'
if platform.os_version.to_i >= 13 && platform.architecture == 'arm64'
pkg.environment 'PATH', '/opt/homebrew/bin:$(PATH):/usr/local/bin'
else
pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin'
end

cflags = settings[:cflags]
target = if platform.is_cross_compiled?
'darwin64-arm64-cc'
else
'darwin64-x86_64-cc'
end

target = if platform.architecture == 'arm64'
'darwin64-arm64-cc'
else
'darwin64-x86_64-cc'
end
elsif platform.is_linux?
pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin'

Expand Down
6 changes: 6 additions & 0 deletions configs/components/ruby-2.7.8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
# implementation instead of 'arm64', so specify 'amd64' explicitly
# https://github.com/ruby/ruby/blob/c9c2245c0a25176072e02db9254f0e0c84c805cd/configure.ac#L2329-L2330
special_flags += " --with-baseruby=#{host_ruby} --with-coroutine=arm64 "
elsif platform.is_macos? && platform.architecture == 'arm64' && platform.os_version.to_i >= 13
pkg.environment 'PATH', '/opt/homebrew/bin:$(PATH):/usr/local/bin'
special_flags += " --with-openssl-dir=#{settings[:prefix]} "
elsif platform.is_solaris? && platform.architecture == "sparc"
special_flags += " --with-baseruby=#{host_ruby} --enable-close-fds-by-recvmsg-with-peek "
elsif platform.name =~ /el-6/
Expand Down Expand Up @@ -194,6 +197,7 @@
'x86_64-w64-mingw32' => 'x64-mingw32',
'i686-w64-mingw32' => 'i386-mingw32'
}

if target_doubles.key?(settings[:platform_triple])
rbconfig_topdir = File.join(ruby_dir, 'lib', 'ruby', '2.7.0', target_doubles[settings[:platform_triple]])
else
Expand Down Expand Up @@ -225,6 +229,8 @@
# the ancient gcc version on sles-12-ppc64le does not understand -fstack-protector-strong, so remove the `strong` part
rbconfig_changes["LDFLAGS"] = "-L. -Wl,-rpath=/opt/puppetlabs/puppet/lib -fstack-protector -rdynamic -Wl,-export-dynamic -L/opt/puppetlabs/puppet/lib"
end
elsif platform.is_macos? && platform.architecture == 'arm64' && platform.os_version.to_i >= 13
rbconfig_changes["CC"] = 'clang'
elsif platform.is_windows?
rbconfig_changes["CC"] = "x86_64-w64-mingw32-gcc"
end
Expand Down
2 changes: 1 addition & 1 deletion configs/components/yaml-cpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
pkg.environment 'CXX', 'clang++ -target arm64-apple-macos12' if platform.name =~ /osx-12/
elsif platform.architecture == 'arm64' && platform.os_version.to_i >= 13
pkg.environment 'CXX', 'clang++'
cmake = "/opt/homebrew/bin/cmake" if platform.architecture == "arm64"
cmake = "/opt/homebrew/bin/cmake"
end

elsif platform.is_windows?
Expand Down
15 changes: 7 additions & 8 deletions configs/platforms/osx-13-arm64.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
platform 'osx-13-arm64' do |plat|
plat.inherit_from_default

packages = %w[automake cmake pkg-config yaml-cpp]
plat.provision_with "su test -c '/opt/homebrew/bin/brew install #{packages.join(' ')}'"

plat.output_dir File.join('apple', '13', 'PC1', 'arm64')
end

plat.inherit_from_default

packages = %w[automake cmake pkg-config yaml-cpp]
plat.provision_with "su test -c '/opt/homebrew/bin/brew install #{packages.join(' ')}'"

plat.output_dir File.join('apple', '13', 'PC1', 'arm64')
end

0 comments on commit fb126f6

Please sign in to comment.