forked from puppetlabs/puppet-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libedit.rb
35 lines (28 loc) · 1.33 KB
/
libedit.rb
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
component 'libedit' do |pkg, settings, platform|
pkg.version '20150325-3.1'
pkg.md5sum '43cdb5df3061d78b5e9d59109871b4f6'
pkg.url "http://thrysoee.dk/editline/libedit-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/libedit-#{pkg.get_version}.tar.gz"
pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)"
if platform.is_solaris?
pkg.environment "CC", "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc"
elsif platform.is_aix?
pkg.environment "CC", "/opt/pl-build-tools/bin/gcc"
pkg.environment "LDFLAGS", settings[:ldflags]
end
if platform.is_macos?
pkg.environment "CFLAGS", settings[:cflags]
end
pkg.configure do
"bash configure --enable-shared --prefix=#{settings[:prefix]} #{settings[:host]}"
end
pkg.build do
"#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"
end
pkg.install do
"#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install"
end
pkg.link File.join(settings[:libdir], 'libedit.so'), File.join(settings[:libdir], 'libreadline.so')
pkg.link File.join(settings[:includedir], 'editline', 'readline.h'), File.join(settings[:includedir], 'readline', 'readline.h')
pkg.link File.join(settings[:includedir], 'editline', 'readline.h'), File.join(settings[:includedir], 'readline', 'history.h')
end