-
Notifications
You must be signed in to change notification settings - Fork 88
/
libxslt.rb
58 lines (50 loc) · 2.3 KB
/
libxslt.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
component "libxslt" do |pkg, settings, platform|
pkg.version '1.1.42'
pkg.sha256sum '85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb'
libxslt_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
pkg.url "https://download.gnome.org/sources/libxslt/#{libxslt_version_y}/libxslt-#{pkg.get_version}.tar.xz"
pkg.mirror "#{settings[:buildsources_url]}/libxslt-#{pkg.get_version}.tar.xz"
pkg.build_requires "libxml2"
if platform.is_aix?
if platform.name == 'aix-7.1-ppc'
pkg.environment "PATH", "/opt/pl-build-tools/bin:/opt/freeware/bin:$(PATH)"
else
pkg.environment "PATH", "/opt/freeware/bin:$(PATH)"
end
elsif platform.is_cross_compiled_linux?
pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}"
pkg.environment "CFLAGS", settings[:cflags]
pkg.environment "LDFLAGS", settings[:ldflags]
# libxslt is picky about manually specifying the build host
build = "--build x86_64-linux-gnu"
# don't depend on libgcrypto
disable_crypto = "--without-crypto"
elsif platform.is_solaris?
pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:#{settings[:bindir]}"
pkg.environment "CFLAGS", settings[:cflags]
pkg.environment "LDFLAGS", settings[:ldflags]
elsif platform.is_macos?
if platform.is_cross_compiled?
pkg.environment 'CC', 'clang -target arm64-apple-macos11' if platform.name =~ /osx-11/
pkg.environment 'CC', 'clang -target arm64-apple-macos12' if platform.name =~ /osx-12/
end
pkg.environment "LDFLAGS", settings[:ldflags]
pkg.environment "CFLAGS", settings[:cflags]
else
pkg.environment "LDFLAGS", settings[:ldflags]
pkg.environment "CFLAGS", settings[:cflags]
end
pkg.configure do
["./configure --without-python --prefix=#{settings[:prefix]} --docdir=/tmp --with-libxml-prefix=#{settings[:prefix]} #{settings[:host]} #{disable_crypto} #{build}"]
end
pkg.build do
["#{platform[:make]} VERBOSE=1 -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"]
end
pkg.install do
[
"#{platform[:make]} VERBOSE=1 -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install",
"rm -rf #{settings[:datadir]}/gtk-doc",
"rm -rf #{settings[:datadir]}/doc/#{pkg.get_name}*"
]
end
end