@@ -105,9 +105,17 @@ class BuildPlan
105
105
"#{ ext_build_dir } /extinit.o"
106
106
end
107
107
108
+ def baseruby_name
109
+ "baseruby-#{ @params [ :src ] } "
110
+ end
111
+
112
+ def baseruby_path
113
+ "#{ @base_dir } /build/deps/#{ RbConfig ::CONFIG [ "host" ] } /opt/#{ baseruby_name } /bin/ruby"
114
+ end
115
+
108
116
def dep_tasks
109
- return [ ] if @params [ :profile ] == "minimal"
110
- [ "deps:libyaml-#{ @params [ :target ] } " ]
117
+ return [ baseruby_name ] if @params [ :profile ] == "minimal"
118
+ [ baseruby_name , "deps:libyaml-#{ @params [ :target ] } " ]
111
119
end
112
120
113
121
def check_deps
@@ -149,6 +157,7 @@ class BuildPlan
149
157
args << "--with-static-linked-ext"
150
158
args << %Q(--with-ext="#{ default_exts } ")
151
159
args << %Q(--with-libyaml-dir="#{ deps_install_dir } /libyaml/usr/local")
160
+ args << %Q(--with-baseruby="#{ baseruby_path } ")
152
161
153
162
case target
154
163
when "wasm32-unknown-wasi"
@@ -226,6 +235,18 @@ namespace :build do
226
235
file source . configure_file => [ source . src_dir ] do
227
236
sh "./autogen.sh" , chdir : source . src_dir
228
237
end
238
+
239
+ baseruby_install_dir = File . join ( Dir . pwd , "/build/deps/#{ RbConfig ::CONFIG [ "host" ] } /opt/baseruby-#{ name } " )
240
+ baseruby_build_dir = File . join ( Dir . pwd , "/build/deps/#{ RbConfig ::CONFIG [ "host" ] } /baseruby-#{ name } " )
241
+
242
+ directory baseruby_build_dir
243
+
244
+ desc "build baseruby #{ name } "
245
+ task "baseruby-#{ name } " => [ source . src_dir , source . configure_file , baseruby_build_dir ] do
246
+ next if Dir . exist? ( baseruby_install_dir )
247
+ sh "#{ source . configure_file } --prefix=#{ baseruby_install_dir } --disable-install-doc" , chdir : baseruby_build_dir
248
+ sh "make install" , chdir : baseruby_build_dir
249
+ end
229
250
end
230
251
231
252
BUILDS . each do |params |
0 commit comments