1
- require "rake"
2
1
require_relative "./product"
3
2
4
3
module RubyWasm
5
4
class LibYAMLProduct < AutoconfProduct
6
- attr_reader :target , :install_task
5
+ attr_reader :target
7
6
8
7
LIBYAML_VERSION = "0.2.5"
9
8
@@ -29,23 +28,20 @@ def name
29
28
product_build_dir
30
29
end
31
30
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 )
36
33
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" ,
40
37
chdir : File . dirname ( product_build_dir )
41
38
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'"
45
42
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
49
45
end
50
46
end
51
47
end
0 commit comments