File tree Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 37
37
pkg . url ( "https://rubygems.org/downloads/#{ name } -#{ version } .gem" )
38
38
pkg . mirror ( "#{ settings [ :buildsources_url ] } /#{ name } -#{ version } .gem" )
39
39
40
- pkg . install do
41
- "#{ settings [ :gem_install ] } #{ name } -#{ version } .gem"
40
+ # If a gem needs more command line options to install set the :gem_install_options
41
+ # in its component file rubygem-<compoment>, before the instance_eval of this file.
42
+ if settings [ :gem_install_options ] . nil?
43
+ pkg . install do
44
+ "#{ settings [ :gem_install ] } #{ name } -#{ version } .gem"
45
+ end
46
+ else
47
+ pkg . install do
48
+ "#{ settings [ :gem_install ] } #{ name } -#{ version } .gem #{ settings [ :gem_install_options ] } "
49
+ end
42
50
end
51
+
Original file line number Diff line number Diff line change 1
1
component 'rubygem-nokogiri' do |pkg , _settings , _platform |
2
2
pkg . version '1.14.2'
3
3
pkg . sha256sum 'c765a74aac6cf430a710bb0b6038b8ee11f177393cd6ae8dadc7a44a6e2658b6'
4
+ # On macOS when we are not cross compiling we need to use runtime's libxml2 and libxslt
5
+ if platform . is_macos? && !platform . is_cross_compiled?
6
+ settings [ :gem_install_options ] = "-- --use-system-libraries \
7
+ --with-xml2-lib=#{ settings [ :libdir ] } \
8
+ --with-xml2-include=#{ settings [ :includedir ] } /libxml2 \
9
+ --with-xslt-lib=#{ settings [ :libdir ] } \
10
+ --with-xslt-include=#{ settings [ :includedir ] } "
11
+ end
4
12
instance_eval File . read ( 'configs/components/_base-rubygem.rb' )
5
-
6
13
pkg . build_requires 'rubygem-mini_portile2'
7
-
8
14
gem_home = settings [ :gem_home ]
9
15
pkg . environment "GEM_HOME" , gem_home
10
-
11
- # When cross compiling nokogiri native extensions on macOS 11/12 ARM, there is a 94M tmp
12
- # directory that's not needed
13
- if platform . is_macos? && platform . architecture == 'arm64'
14
- install do
15
- "rm -r #{ gem_home } /gems/nokogiri- #{ pkg . get_version } /ext/nokogiri/tmp"
16
+ if platform . is_macos?
17
+ pkg . environment "PKG_CONFIG_PATH" , " #{ settings [ :libdir ] } /pkgconfig"
18
+ if platform . is_cross_compiled?
19
+ pkg . install do
20
+ "rm -r #{ gem_home } /gems/nokogiri- #{ pkg . get_version } /ext/nokogiri/tmp"
21
+ end
16
22
end
17
23
end
18
24
end
You can’t perform that action at this time.
0 commit comments