Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,17 @@ class BuildPlan
"#{ext_build_dir}/extinit.o"
end

def baseruby_name
"baseruby-#{@params[:src]}"
end

def baseruby_path
"#{@base_dir}/build/deps/#{RbConfig::CONFIG["host"]}/opt/#{baseruby_name}/bin/ruby"
end

def dep_tasks
return [] if @params[:profile] == "minimal"
["deps:libyaml-#{@params[:target]}"]
return [baseruby_name] if @params[:profile] == "minimal"
[baseruby_name, "deps:libyaml-#{@params[:target]}"]
end

def check_deps
Expand Down Expand Up @@ -149,6 +157,7 @@ class BuildPlan
args << "--with-static-linked-ext"
args << %Q(--with-ext="#{default_exts}")
args << %Q(--with-libyaml-dir="#{deps_install_dir}/libyaml/usr/local")
args << %Q(--with-baseruby="#{baseruby_path}")

case target
when "wasm32-unknown-wasi"
Expand Down Expand Up @@ -226,6 +235,18 @@ namespace :build do
file source.configure_file => [source.src_dir] do
sh "./autogen.sh", chdir: source.src_dir
end

baseruby_install_dir = File.join(Dir.pwd, "/build/deps/#{RbConfig::CONFIG["host"]}/opt/baseruby-#{name}")
baseruby_build_dir = File.join(Dir.pwd, "/build/deps/#{RbConfig::CONFIG["host"]}/baseruby-#{name}")

directory baseruby_build_dir

desc "build baseruby #{name}"
task "baseruby-#{name}" => [source.src_dir, source.configure_file, baseruby_build_dir] do
next if Dir.exist?(baseruby_install_dir)
sh "#{source.configure_file} --prefix=#{baseruby_install_dir} --disable-install-doc", chdir: baseruby_build_dir
sh "make install", chdir: baseruby_build_dir
end
end

BUILDS.each do |params|
Expand Down
2 changes: 1 addition & 1 deletion builders/wasm32-unknown-emscripten/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM emscripten/emsdk:2.0.13

RUN set -eux; \
apt-get update; \
apt-get install ruby bison make autoconf git curl -y; \
apt-get install ruby bison make autoconf git curl build-essential libyaml-dev -y; \
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -; \
apt-get install nodejs -y; \
apt-get clean; \
Expand Down
2 changes: 1 addition & 1 deletion builders/wasm32-unknown-wasi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV WASI_SDK_PATH="/opt/wasi-sdk"

RUN set -eux; \
apt-get update; \
apt-get install ruby bison make autoconf git curl -y; \
apt-get install ruby bison make autoconf git curl build-essential libyaml-dev -y; \
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -; \
apt-get install nodejs -y; \
apt-get clean; \
Expand Down