1- require "rake"
21require_relative "./product"
32
43module RubyWasm
54 class LibYAMLProduct < AutoconfProduct
6- attr_reader :target , :install_task
5+ attr_reader :target
76
87 LIBYAML_VERSION = "0.2.5"
98
@@ -29,23 +28,20 @@ def name
2928 product_build_dir
3029 end
3130
32- def define_task
33- @install_task =
34- task name => [ @toolchain . define_task ] do
35- next if Dir . exist? ( install_root )
31+ def build
32+ return if Dir . exist? ( install_root )
3633
37- mkdir_p File . dirname ( product_build_dir )
38- rm_rf product_build_dir
39- sh "curl -L https://github.com/yaml/libyaml/releases/download/#{ LIBYAML_VERSION } /yaml-#{ LIBYAML_VERSION } .tar.gz | tar xz" ,
34+ FileUtils . mkdir_p File . dirname ( product_build_dir )
35+ FileUtils . rm_rf product_build_dir
36+ system "curl -L https://github.com/yaml/libyaml/releases/download/#{ LIBYAML_VERSION } /yaml-#{ LIBYAML_VERSION } .tar.gz | tar xz" ,
4037 chdir : File . dirname ( product_build_dir )
4138
42- # obtain the latest config.guess and config.sub for Emscripten and WASI triple support
43- sh "curl -o #{ product_build_dir } /config/config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'"
44- sh "curl -o #{ product_build_dir } /config/config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'"
39+ # obtain the latest config.guess and config.sub for Emscripten and WASI triple support
40+ system "curl -o #{ product_build_dir } /config/config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'"
41+ system "curl -o #{ product_build_dir } /config/config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'"
4542
46- sh "./configure #{ configure_args . join ( " " ) } " , chdir : product_build_dir
47- sh "make install DESTDIR=#{ destdir } " , chdir : product_build_dir
48- end
43+ system "./configure #{ configure_args . join ( " " ) } " , chdir : product_build_dir
44+ system "make install DESTDIR=#{ destdir } " , chdir : product_build_dir
4945 end
5046 end
5147end
0 commit comments