File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -23,30 +23,39 @@ CLEAN.include FileList[
2323 "ext/depend"
2424 ]
2525
26- task build : SOURCES + FileList [
27- "ext/extconf.rb " ,
28- "ext/ruby_whisper.h" ,
29- "ext/ruby_whisper.cpp" ,
30- "whispercpp.gemspec" ,
31- ]
26+ task build : FileList [
27+ "ext/Makefile " ,
28+ "ext/ruby_whisper.h" ,
29+ "ext/ruby_whisper.cpp" ,
30+ "whispercpp.gemspec" ,
31+ ]
3232
3333directory "pkg"
3434CLOBBER . include "pkg"
3535
3636TEST_MODEL = "../../models/ggml-base.en.bin"
3737LIB_NAME = "whisper" . ext ( RbConfig ::CONFIG [ "DLEXT" ] )
38+ SO_FILE = File . join ( "ext" , LIB_NAME )
3839LIB_FILE = File . join ( "lib" , LIB_NAME )
3940
40- directory "lib"
41- task LIB_FILE => SOURCES + [ "lib" ] do |t |
41+ file "ext/Makefile" => [ "ext/extconf.rb" ] + SOURCES do |t |
42+ Dir . chdir "ext" do
43+ ruby "extconf.rb"
44+ end
45+ end
46+
47+ file SO_FILE => "ext/Makefile" do |t |
4248 Dir . chdir "ext" do
43- sh "ruby extconf.rb"
4449 sh "make"
4550 end
46- mv "ext/#{ LIB_NAME } " , t . name
4751end
4852CLEAN . include LIB_FILE
4953
54+ directory "lib"
55+ file LIB_FILE => [ SO_FILE , "lib" ] do |t |
56+ copy t . source , t . name
57+ end
58+
5059Rake ::TestTask . new do |t |
5160 t . test_files = FileList [ "tests/test_*.rb" ]
5261end
You can’t perform that action at this time.
0 commit comments