@@ -18,7 +18,7 @@ namespace :ports do
1818 CLEAN . include "ports/*.installed"
1919
2020 task :openssl , [ :host , :gem_platform ] do |_task , args |
21- args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RUBY_PLATFORM )
21+ args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RbConfig :: CONFIG [ "arch" ] )
2222
2323 libraries_to_compile [ :openssl ] . files = [ OPENSSL_SOURCE_URI ]
2424 libraries_to_compile [ :openssl ] . host = args . host
@@ -29,18 +29,17 @@ namespace :ports do
2929 end
3030
3131 task :libiconv , [ :host , :gem_platform ] do |_task , args |
32- args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RUBY_PLATFORM )
32+ args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RbConfig :: CONFIG [ "arch" ] )
3333
3434 libraries_to_compile [ :libiconv ] . files = [ ICONV_SOURCE_URI ]
3535 libraries_to_compile [ :libiconv ] . host = args . host
3636 libraries_to_compile [ :libiconv ] . gem_platform = args . gem_platform
37-
3837 libraries_to_compile [ :libiconv ] . cook
3938 libraries_to_compile [ :libiconv ] . activate
4039 end
4140
4241 task :freetds , [ :host , :gem_platform ] do |_task , args |
43- args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RUBY_PLATFORM )
42+ args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RbConfig :: CONFIG [ "arch" ] )
4443
4544 libraries_to_compile [ :freetds ] . files = [ FREETDS_SOURCE_URI ]
4645 libraries_to_compile [ :freetds ] . host = args . host
@@ -65,7 +64,7 @@ namespace :ports do
6564 end
6665
6766 task :compile , [ :host , :gem_platform ] do |_task , args |
68- args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RUBY_PLATFORM )
67+ args . with_defaults ( host : RbConfig ::CONFIG [ 'host' ] , gem_platform : RbConfig :: CONFIG [ "arch" ] )
6968
7069 puts "Compiling ports for #{ args . host } (Ruby platform #{ args . gem_platform } ) ..."
7170
@@ -82,20 +81,22 @@ namespace :ports do
8281 GEM_PLATFORM_HOSTS . each do |gem_platform , meta |
8382 # make sure to install our bundle
8483 build = [ 'bundle' ]
85- build << "rake ports:compile[#{ meta [ :host ] } ,#{ gem_platform } ] MAKE='make -j`nproc`'"
84+ build << "RUBY_CC_VERSION= #{ meta [ :ruby_versions ] } rake ports:compile[#{ meta [ :host ] } ,#{ gem_platform } ] MAKE='make -j`nproc`'"
8685 RakeCompilerDock . sh build . join ( ' && ' ) , platform : gem_platform
8786 end
8887 end
8988
9089 desc "Notes the actual versions for the compiled ports into a file"
91- task "version_file" do
90+ task "version_file" , [ :gem_platform ] do |_task , args |
91+ args . with_defaults ( gem_platform : RbConfig ::CONFIG [ "arch" ] )
92+
9293 ports_version = { }
9394
9495 libraries_to_compile . each do |library , library_recipe |
9596 ports_version [ library ] = library_recipe . version
9697 end
9798
98- ports_version [ :platforms ] = GEM_PLATFORM_HOSTS . keys
99+ ports_version [ :platform ] = args . gem_platform
99100
100101 File . open ( ".ports_versions" , "w" ) do |f |
101102 f . write ports_version
0 commit comments