-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcurl.rb
More file actions
87 lines (75 loc) · 3.39 KB
/
curl.rb
File metadata and controls
87 lines (75 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#####
# Component release information: https://github.com/curl/curl/releases
#####
component 'curl' do |pkg, settings, platform|
pkg.version '8.19.0'
pkg.sha256sum '2a2c11db4c122691aa23b4363befda1bfd801770bfebf41e1d21cee4f2ab0f71'
pkg.url "https://curl.se/download/curl-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/curl-#{pkg.get_version}.tar.gz"
pkg.build_requires "openssl-#{settings[:openssl_version]}"
pkg.build_requires 'puppet-ca-bundle'
ldflags = settings[:ldflags]
if platform.is_cross_compiled_linux?
pkg.build_requires "runtime-#{settings[:runtime_project]}"
pkg.environment 'PATH', "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}"
pkg.environment 'PKG_CONFIG_PATH', '/opt/puppetlabs/puppet/lib/pkgconfig'
pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH)'
elsif platform.is_windows?
pkg.build_requires "runtime-#{settings[:runtime_project]}"
pkg.environment 'PATH', "$(shell cygpath -u #{settings[:gcc_bindir]}):$(PATH)"
pkg.environment 'NM', '/usr/bin/nm' if platform.name =~ /windowsfips-2016/
pkg.environment 'CYGWIN', settings[:cygwin]
elsif platform.is_aix?
pkg.environment 'PKG_CONFIG_PATH', '/opt/puppetlabs/puppet/lib/pkgconfig'
pkg.environment 'PATH', "/opt/freeware/bin:$(PATH):#{settings[:bindir]}"
# exclude -Wl,-brtl
ldflags = "-L#{settings[:libdir]}"
else
pkg.environment 'PATH', "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}"
end
configure_options = []
configure_options << "--with-ssl=#{settings[:prefix]} --without-libpsl"
# OpenSSL version 3.0 & up no longer ships by default the insecure algorithms
# that curl's ntlm module depends on (md4 & des).
configure_options << '--disable-ntlm' if !settings[:use_legacy_openssl_algos] && settings[:openssl_version] =~ /^3\./
if (platform.is_solaris? && platform.os_version == '11') || platform.is_aix?
# Makefile generation with automatic dependency tracking fails on these platforms
configure_options << '--disable-dependency-tracking'
end
if platform.is_macos?
pkg.environment 'MACOSX_DEPLOYMENT_TARGET', settings[:deployment_target]
pkg.environment 'CFLAGS', settings[:cflags]
pkg.environment 'CC', settings[:cc]
pkg.environment 'CPPFLAGS', settings[:cppflags]
pkg.environment 'CXX', settings[:cxx]
end
pkg.configure do
["CPPFLAGS='#{settings[:cppflags]}' \
LDFLAGS='#{ldflags}' \
./configure --prefix=#{settings[:prefix]} \
#{configure_options.join(' ')} \
--enable-threaded-resolver \
--disable-ldap \
--disable-ldaps \
--with-ca-bundle=#{settings[:prefix]}/ssl/cert.pem \
--with-ca-path=#{settings[:prefix]}/ssl/certs \
--without-nghttp2 \
CFLAGS='#{settings[:cflags]}' \
#{settings[:host]}"]
end
pkg.build do
["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"]
end
install_steps = [
"#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install"
]
unless ['agent', 'pdk'].include?(settings[:runtime_project])
# Most projects won't need curl binaries, so delete them after installation.
# Note that the agent _should_ include curl binaries; Some projects and
# scripts depend on them and they can be helpful in debugging.
install_steps << "rm -f #{settings[:prefix]}/bin/{curl,curl-config}"
end
pkg.install do
install_steps
end
end