mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-05-17 06:30:59 +02:00
ruby: use CMake in build process (#3043)
* Use CMake to build shared object * Make Rakefile follow change of build process * Add test for packaging * Run CI for Ruby bindings almost always because each CMakeLists.txt might affect Ruby bindings * Enable PIC * Bump Ruby version to 3.2 on CI * Check libgomp * Check dependency of whisper.cpp accurately
This commit is contained in:
parent
9cfcd6cc45
commit
2a2d21c75d
54
.github/workflows/bindings-ruby.yml
vendored
54
.github/workflows/bindings-ruby.yml
vendored
@ -1,55 +1,11 @@
|
|||||||
name: Bindings Tests (Ruby)
|
name: Bindings Tests (Ruby)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- bindings/ruby/**
|
- master
|
||||||
- src/**/*.c
|
|
||||||
- src/**/*.cpp
|
|
||||||
- src/**/*.h
|
|
||||||
- src/**/*.m
|
|
||||||
- src/**/*.metal
|
|
||||||
- include/**/*.c
|
|
||||||
- include/**/*.cpp
|
|
||||||
- include/**/*.h
|
|
||||||
- include/**/*.m
|
|
||||||
- include/**/*.metal
|
|
||||||
- ggml/**/*.c
|
|
||||||
- ggml/**/*.cpp
|
|
||||||
- ggml/**/*.h
|
|
||||||
- ggml/**/*.m
|
|
||||||
- ggml/**/*.metal
|
|
||||||
- scripts/get-flags.mk
|
|
||||||
- examples/common.h
|
|
||||||
- examples/common.cpp
|
|
||||||
- examples/common-whisper.h
|
|
||||||
- examples/common-whisper.cpp
|
|
||||||
- examples/stb_vorbis.c
|
|
||||||
- examples/miniaudio.h
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
types: [opened, synchronize, reopened]
|
||||||
- bindings/ruby/**
|
|
||||||
- src/**/*.c
|
|
||||||
- src/**/*.cpp
|
|
||||||
- src/**/*.h
|
|
||||||
- src/**/*.m
|
|
||||||
- src/**/*.metal
|
|
||||||
- include/**/*.c
|
|
||||||
- include/**/*.cpp
|
|
||||||
- include/**/*.h
|
|
||||||
- include/**/*.m
|
|
||||||
- include/**/*.metal
|
|
||||||
- ggml/**/*.c
|
|
||||||
- ggml/**/*.cpp
|
|
||||||
- ggml/**/*.h
|
|
||||||
- ggml/**/*.m
|
|
||||||
- ggml/**/*.metal
|
|
||||||
- scripts/get-flags.mk
|
|
||||||
- examples/common.h
|
|
||||||
- examples/common.cpp
|
|
||||||
- examples/common-whisper.h
|
|
||||||
- examples/common-whisper.cpp
|
|
||||||
- examples/stb_vorbis.c
|
|
||||||
- examples/miniaudio.h
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu-22:
|
ubuntu-22:
|
||||||
@ -60,6 +16,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: ruby/setup-ruby@v1
|
- uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: '3.1'
|
ruby-version: '3.2'
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: rake test
|
- run: rake test
|
||||||
|
3
bindings/ruby/.gitignore
vendored
3
bindings/ruby/.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
LICENSE
|
LICENSE
|
||||||
pkg/
|
pkg/
|
||||||
lib/whisper.*
|
lib/whisper.*
|
||||||
|
ext/sources/*
|
||||||
|
!ext/sources/CMakeGraphVizOptions.cmake
|
||||||
|
ext/mkmf.log
|
||||||
|
@ -3,11 +3,15 @@ require "bundler/gem_tasks"
|
|||||||
require "rake/testtask"
|
require "rake/testtask"
|
||||||
require_relative "extsources"
|
require_relative "extsources"
|
||||||
|
|
||||||
|
SOURCES_DIR = "ext/sources"
|
||||||
|
|
||||||
SOURCES = FileList[]
|
SOURCES = FileList[]
|
||||||
|
|
||||||
EXTSOURCES.each do |src|
|
EXTSOURCES.each do |src|
|
||||||
basename = src.pathmap("%f")
|
basename = src.pathmap("%f")
|
||||||
dest = basename == "LICENSE" ? basename : src.pathmap("%{../..,ext}p")
|
dest = basename == "LICENSE" ? basename
|
||||||
|
: src.pathmap("%{\\.\\./\\.\\.,#{SOURCES_DIR}}p")
|
||||||
|
.pathmap("%{\\.\\./javascript,#{SOURCES_DIR}/bindings/javascript}p")
|
||||||
dir = dest.pathmap("%d")
|
dir = dest.pathmap("%d")
|
||||||
file src
|
file src
|
||||||
directory dir
|
directory dir
|
||||||
@ -18,7 +22,6 @@ EXTSOURCES.each do |src|
|
|||||||
end
|
end
|
||||||
|
|
||||||
CLEAN.include SOURCES
|
CLEAN.include SOURCES
|
||||||
CLEAN.include FileList["ext/**/*.o", "ext/**/*.metal", "ext/**/*.tmp", "ext/whisper.{so,bundle,dll}"]
|
|
||||||
|
|
||||||
SRC = FileList["ext/*.{c,cpp,h}"]
|
SRC = FileList["ext/*.{c,cpp,h}"]
|
||||||
|
|
||||||
@ -36,6 +39,20 @@ file "ext/Makefile" => SRC + ["ext/extconf.rb"] + SOURCES do |t|
|
|||||||
ruby "extconf.rb"
|
ruby "extconf.rb"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if File.exist? "ext/Makefile"
|
||||||
|
task :make_clean do
|
||||||
|
cd "ext" do
|
||||||
|
sh "make", "clean"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
task clean: :make_clean
|
||||||
|
task :make_distclean do
|
||||||
|
cd "ext" do
|
||||||
|
sh "make", "distclean"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
task clobber: :make_distclean
|
||||||
|
end
|
||||||
|
|
||||||
file SO_FILE => "ext/Makefile" do |t|
|
file SO_FILE => "ext/Makefile" do |t|
|
||||||
chdir "ext" do
|
chdir "ext" do
|
||||||
|
@ -1,212 +1,61 @@
|
|||||||
require 'mkmf'
|
require "mkmf"
|
||||||
|
require "tsort"
|
||||||
|
|
||||||
# need to use c++ compiler flags
|
# TODO: options such as CoreML
|
||||||
$CXXFLAGS << ' -std=c++17'
|
|
||||||
|
|
||||||
$LDFLAGS << ' -lstdc++'
|
cmake = find_executable("cmake") || abort
|
||||||
|
|
||||||
# Set to true when building binary gems
|
have_library("gomp") rescue nil
|
||||||
if enable_config('static-stdlib', false)
|
|
||||||
$LDFLAGS << ' -static-libgcc -static-libstdc++'
|
|
||||||
end
|
|
||||||
|
|
||||||
if enable_config('march-tune-native', false)
|
prefix = File.join("build", "whisper.cpp.dot")
|
||||||
$CFLAGS << ' -march=native -mtune=native'
|
system cmake, "-S", "sources", "-B", "build", "--graphviz", prefix, "-D", "BUILD_SHARED_LIBS=OFF", exception: true
|
||||||
$CXXFLAGS << ' -march=native -mtune=native'
|
|
||||||
end
|
|
||||||
|
|
||||||
if ENV['WHISPER_METAL']
|
static_lib_shape = nil
|
||||||
$GGML_METAL ||= true
|
nodes = {}
|
||||||
$DEPRECATE_WARNING ||= true
|
depends = {}
|
||||||
end
|
class << depends
|
||||||
|
include TSort
|
||||||
$UNAME_S = `uname -s`.chomp
|
alias tsort_each_node each_key
|
||||||
$UNAME_P = `uname -p`.chomp
|
def tsort_each_child(node, &block)
|
||||||
$UNAME_M = `uname -m`.chomp
|
fetch(node, []).each(&block)
|
||||||
|
|
||||||
if $UNAME_S == 'Darwin'
|
|
||||||
unless ENV['GGML_NO_METAL']
|
|
||||||
$GGML_METAL ||= true
|
|
||||||
end
|
|
||||||
$GGML_NO_OPENMP ||= true
|
|
||||||
end
|
|
||||||
|
|
||||||
if $GGML_METAL
|
|
||||||
$GGML_METAL_EMBED_LIBRARY = true
|
|
||||||
end
|
|
||||||
|
|
||||||
$MK_CPPFLAGS = '-Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -Iexamples -DGGML_USE_CPU'
|
|
||||||
$MK_CFLAGS = '-std=c11 -fPIC'
|
|
||||||
$MK_CXXFLAGS = '-std=c++17 -fPIC'
|
|
||||||
$MK_NVCCFLAGS = '-std=c++17'
|
|
||||||
$MK_LDFLAGS = ''
|
|
||||||
|
|
||||||
$OBJ_GGML = []
|
|
||||||
$OBJ_WHISPER = []
|
|
||||||
$OBJ_COMMON = []
|
|
||||||
$OBJ_SDL = []
|
|
||||||
|
|
||||||
$MK_CPPFLAGS << ' -D_XOPEN_SOURCE=600'
|
|
||||||
|
|
||||||
if $UNAME_S == 'Linux'
|
|
||||||
$MK_CPPFLAGS << ' -D_GNU_SOURCE'
|
|
||||||
end
|
|
||||||
|
|
||||||
if $UNAME_S == 'Darwin'
|
|
||||||
$MK_CPPFLAGS << ' -D_DARWIN_C_SOURCE'
|
|
||||||
end
|
|
||||||
|
|
||||||
if ENV['WHISPER_DEBUG']
|
|
||||||
$MK_CFLAGS << ' -O0 -g'
|
|
||||||
$MK_CXXFLAGS << ' -O0 -g'
|
|
||||||
$MK_LDFLAGS << ' -g'
|
|
||||||
$MK_NVCCFLAGS << ' -O0 -g'
|
|
||||||
else
|
|
||||||
$MK_CPPFLAGS << ' -DNDEBUG'
|
|
||||||
$MK_CFLAGS << ' -O3'
|
|
||||||
$MK_CXXFLAGS << ' -O3'
|
|
||||||
$MK_NVCCFLAGS << ' -O3'
|
|
||||||
end
|
|
||||||
|
|
||||||
$WARN_FLAGS =
|
|
||||||
' -Wall' <<
|
|
||||||
' -Wextra' <<
|
|
||||||
' -Wpedantic' <<
|
|
||||||
' -Wcast-qual' <<
|
|
||||||
' -Wno-unused-function'
|
|
||||||
|
|
||||||
$MK_CFLAGS <<
|
|
||||||
$WARN_FLAGS <<
|
|
||||||
' -Wshadow' <<
|
|
||||||
' -Wstrict-prototypes' <<
|
|
||||||
' -Wpointer-arith' <<
|
|
||||||
' -Wmissing-prototypes' <<
|
|
||||||
' -Werror=implicit-int' <<
|
|
||||||
' -Werror=implicit-function-declaration'
|
|
||||||
|
|
||||||
$MK_CXXFLAGS <<
|
|
||||||
$WARN_FLAGS <<
|
|
||||||
' -Wmissing-declarations' <<
|
|
||||||
' -Wmissing-noreturn'
|
|
||||||
|
|
||||||
unless `#{cc_command} #{$LDFLAGS} -Wl,-v 2>&1`.chomp.include? 'dyld-1015.7'
|
|
||||||
$MK_CPPFLAGS << ' -DHAVE_BUGGY_APPLE_LINKER'
|
|
||||||
end
|
|
||||||
|
|
||||||
if %w[Linux Darwin FreeBSD NetBSD OpenBSD Haiku].include? $UNAME_S
|
|
||||||
$MK_CFLAGS << ' -pthread'
|
|
||||||
$MK_CXXFLAGS << ' -pthread'
|
|
||||||
end
|
|
||||||
|
|
||||||
unless $_WIN32
|
|
||||||
$DSO_EXT = '.so'
|
|
||||||
else
|
|
||||||
$DSO_EXT = '.dll'
|
|
||||||
end
|
|
||||||
|
|
||||||
unless ENV['RISCV']
|
|
||||||
if %w[x86_64 i686 amd64].include? $UNAME_M
|
|
||||||
$HOST_CXXFLAGS ||= ''
|
|
||||||
|
|
||||||
$MK_CFLAGS << ' -march=native -mtune=native'
|
|
||||||
$HOST_CXXFLAGS << ' -march=native -mtune=native'
|
|
||||||
end
|
|
||||||
else
|
|
||||||
$MK_CFLAGS << ' -march=rv64gcv -mabi=lp64d'
|
|
||||||
$MK_CXXFLAGS << ' -march=rv64gcv -mabi=lp64d'
|
|
||||||
end
|
|
||||||
|
|
||||||
unless ENV['GGML_NO_ACCELERATE']
|
|
||||||
if $UNAME_S == 'Darwin'
|
|
||||||
$MK_CPPFLAGS << ' -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DGGML_BLAS_USE_ACCELERATE'
|
|
||||||
$MK_CPPFLAGS << ' -DACCELERATE_NEW_LAPACK'
|
|
||||||
$MK_CPPFLAGS << ' -DACCELERATE_LAPACK_ILP64'
|
|
||||||
$MK_LDFLAGS << ' -framework Accelerate'
|
|
||||||
$OBJ_GGML << 'ggml/src/ggml-blas/ggml-blas.o'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
File.open(File.join("build", "whisper.cpp.dot")).each_line do |line|
|
||||||
if ENV['GGML_OPENBLAS']
|
case line
|
||||||
$MK_CPPFLAGS << " -DGGML_USE_BLAS #{`pkg-config --cflags-only-I openblas`.chomp}"
|
when /\[\s*label\s*=\s*"Static Library"\s*,\s*shape\s*=\s*(?<shape>\w+)\s*\]/
|
||||||
$MK_CFLAGS << " #{`pkg-config --cflags-only-other openblas)`.chomp}"
|
static_lib_shape = $~[:shape]
|
||||||
$MK_LDFLAGS << " #{`pkg-config --libs openblas`}"
|
when /\A\s*"(?<node>\w+)"\s*\[\s*label\s*=\s*"(?<label>\S+)"\s*,\s*shape\s*=\s*(?<shape>\w+)\s*\]\s*;\s*\z/
|
||||||
$OBJ_GGML << 'ggml/src/ggml-blas/ggml-blas.o'
|
node = $~[:node]
|
||||||
end
|
label = $~[:label]
|
||||||
|
shape = $~[:shape]
|
||||||
if ENV['GGML_OPENBLAS64']
|
nodes[node] = [label, shape]
|
||||||
$MK_CPPFLAGS << " -DGGML_USE_BLAS #{`pkg-config --cflags-only-I openblas64`.chomp}"
|
when /\A\s*"(?<depender>\w+)"\s*->\s*"(?<dependee>\w+)"/
|
||||||
$MK_CFLAGS << " #{`pkg-config --cflags-only-other openblas64)`.chomp}"
|
depender = $~[:depender]
|
||||||
$MK_LDFLAGS << " #{`pkg-config --libs openblas64`}"
|
dependee = $~[:dependee]
|
||||||
$OBJ_GGML << 'ggml/src/ggml-blas/ggml-blas.o'
|
depends[depender] ||= []
|
||||||
end
|
depends[depender] << dependee
|
||||||
|
|
||||||
if $GGML_METAL
|
|
||||||
$MK_CPPFLAGS << ' -DGGML_USE_METAL'
|
|
||||||
$MK_LDFLAGS << ' -framework Foundation -framework Metal -framework MetalKit'
|
|
||||||
$OBJ_GGML << 'ggml/src/ggml-metal/ggml-metal.o'
|
|
||||||
|
|
||||||
if ENV['GGML_METAL_NDEBUG']
|
|
||||||
$MK_CPPFLAGS << ' -DGGML_METAL_NDEBUG'
|
|
||||||
end
|
|
||||||
|
|
||||||
if $GGML_METAL_EMBED_LIBRARY
|
|
||||||
$MK_CPPFLAGS << ' -DGGML_METAL_EMBED_LIBRARY'
|
|
||||||
$OBJ_GGML << 'ggml/src/ggml-metal/ggml-metal-embed.o'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
libs = depends.tsort.filter_map {|node|
|
||||||
|
label, shape = nodes[node]
|
||||||
|
shape == static_lib_shape ? label : nil
|
||||||
|
}.collect {|lib| "lib#{lib}.a"}
|
||||||
|
.reverse
|
||||||
|
.join(" ")
|
||||||
|
|
||||||
$OBJ_GGML <<
|
$CFLAGS << " -std=c11 -fPIC"
|
||||||
'ggml/src/ggml.o' <<
|
$CXXFLAGS << " -std=c++17 -O3 -DNDEBUG"
|
||||||
'ggml/src/ggml-alloc.o' <<
|
$INCFLAGS << " -Isources/include -Isources/ggml/include -Isources/examples"
|
||||||
'ggml/src/ggml-backend.o' <<
|
$LOCAL_LIBS << " #{libs}"
|
||||||
'ggml/src/ggml-backend-reg.o' <<
|
$cleanfiles << " build #{libs}"
|
||||||
'ggml/src/ggml-opt.o' <<
|
|
||||||
'ggml/src/ggml-quants.o' <<
|
|
||||||
'ggml/src/ggml-threading.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu-cpp.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu-aarch64.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu-hbm.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu-quants.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ggml-cpu-traits.o' <<
|
|
||||||
'ggml/src/ggml-cpu/unary-ops.o' <<
|
|
||||||
'ggml/src/ggml-cpu/binary-ops.o' <<
|
|
||||||
'ggml/src/ggml-cpu/vec.o' <<
|
|
||||||
'ggml/src/ggml-cpu/ops.o'
|
|
||||||
|
|
||||||
$OBJ_WHISPER <<
|
create_makefile "whisper" do |conf|
|
||||||
'src/whisper.o' <<
|
conf << <<~EOF
|
||||||
'examples/common.o' <<
|
$(TARGET_SO): #{libs}
|
||||||
'examples/common-whisper.o'
|
#{libs}: cmake-targets
|
||||||
|
cmake-targets:
|
||||||
$objs = $OBJ_GGML + $OBJ_WHISPER + $OBJ_COMMON + $OBJ_SDL
|
#{"\t"}#{cmake} -S sources -B build -D BUILD_SHARED_LIBS=OFF -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY=#{__dir__} -D CMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
$objs <<
|
#{"\t"}#{cmake} --build build --config Release --target common whisper
|
||||||
"ruby_whisper.o" <<
|
#{"\t"}
|
||||||
"ruby_whisper_context.o" <<
|
EOF
|
||||||
"ruby_whisper_transcribe.o" <<
|
|
||||||
"ruby_whisper_params.o" <<
|
|
||||||
"ruby_whisper_error.o" <<
|
|
||||||
"ruby_whisper_segment.o" <<
|
|
||||||
"ruby_whisper_model.o"
|
|
||||||
|
|
||||||
$CPPFLAGS = "#{$MK_CPPFLAGS} #{$CPPFLAGS}"
|
|
||||||
$CFLAGS = "#{$CPPFLAGS} #{$MK_CFLAGS} #{$GF_CFLAGS} #{$CFLAGS}"
|
|
||||||
$BASE_CXXFLAGS = "#{$MK_CXXFLAGS} #{$CXXFLAGS}"
|
|
||||||
$CXXFLAGS = "#{$BASE_CXXFLAGS} #{$HOST_CXXFLAGS} #{$GF_CXXFLAGS} #{$CPPFLAGS}"
|
|
||||||
$NVCCFLAGS = "#{$MK_NVCCFLAGS} #{$NVCCFLAGS}"
|
|
||||||
$LDFLAGS = "#{$MK_LDFLAGS} #{$LDFLAGS}"
|
|
||||||
|
|
||||||
create_makefile('whisper')
|
|
||||||
|
|
||||||
File.open 'Makefile', 'a' do |file|
|
|
||||||
file.puts 'include scripts/get-flags.mk'
|
|
||||||
file.puts 'include cpu.mk'
|
|
||||||
|
|
||||||
if $GGML_METAL
|
|
||||||
file.puts 'include metal.mk'
|
|
||||||
|
|
||||||
if $GGML_METAL_EMBED_LIBRARY
|
|
||||||
file.puts 'include metal-embed.mk'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
8
bindings/ruby/ext/sources/CMakeGraphVizOptions.cmake
Normal file
8
bindings/ruby/ext/sources/CMakeGraphVizOptions.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
set(GRAPHVIZ_EXECUTABLES FALSE)
|
||||||
|
set(GRAPHVIZ_STATIC_LIBS TRUE)
|
||||||
|
set(GRAPHVIZ_SHARED_LIBS FALSE)
|
||||||
|
set(GRAPHVIZ_MODULE_LIBS FALSE)
|
||||||
|
set(GRAPHVIZ_INTERFACE_LIBS FALSE)
|
||||||
|
set(GRAPHVIZ_OBJECT_LIBS FALSE)
|
||||||
|
set(GRAPHVIZ_UNKNOWN_LIBS FALSE)
|
||||||
|
set(GRAPHVIZ_GENERATE_DEPENDERS FALSE)
|
@ -1,6 +1,34 @@
|
|||||||
require "yaml"
|
ignored_dirs = %w[
|
||||||
|
.devops
|
||||||
|
examples/wchess/wchess.wasm
|
||||||
|
examples/whisper.android
|
||||||
|
examples/whisper.android.java
|
||||||
|
examples/whisper.objc
|
||||||
|
examples/whisper.swiftui
|
||||||
|
grammars
|
||||||
|
models
|
||||||
|
samples
|
||||||
|
scripts
|
||||||
|
]
|
||||||
|
ignored_files = %w[
|
||||||
|
AUTHORS
|
||||||
|
Makefile
|
||||||
|
README.md
|
||||||
|
README_sycl.md
|
||||||
|
.gitignore
|
||||||
|
.gitmodules
|
||||||
|
whisper.nvim
|
||||||
|
twitch.sh
|
||||||
|
yt-wsp.sh
|
||||||
|
]
|
||||||
|
|
||||||
sources = `git ls-files -z ../..`.split("\x0")
|
EXTSOURCES =
|
||||||
paths = YAML.load_file("../../.github/workflows/bindings-ruby.yml")[true]["push"]["paths"]
|
`git ls-files -z ../..`.split("\x0")
|
||||||
paths.delete "bindings/ruby/**"
|
.select {|file|
|
||||||
EXTSOURCES = (Dir.glob(paths, base: "../..").collect {|path| "../../#{path}"} << "../../LICENSE") & sources
|
basename = File.basename(file)
|
||||||
|
|
||||||
|
ignored_dirs.all? {|dir| !file.start_with?("../../#{dir}")} &&
|
||||||
|
!ignored_files.include?(basename) &&
|
||||||
|
(file.start_with?("../..") || file.start_with?("../javascript")) &&
|
||||||
|
(!file.start_with?("../../.github/") || basename == "bindings-ruby.yml")
|
||||||
|
}
|
||||||
|
@ -25,6 +25,8 @@ class TestPackage < TestBase
|
|||||||
Dir.mktmpdir do |dir|
|
Dir.mktmpdir do |dir|
|
||||||
system "gem", "install", "--install-dir", dir.shellescape, "--no-document", "pkg/#{filename.shellescape}", exception: true
|
system "gem", "install", "--install-dir", dir.shellescape, "--no-document", "pkg/#{filename.shellescape}", exception: true
|
||||||
assert_path_exist File.join(dir, "gems/whispercpp-#{version}/lib", basename)
|
assert_path_exist File.join(dir, "gems/whispercpp-#{version}/lib", basename)
|
||||||
|
assert_path_exist File.join(dir, "gems/whispercpp-#{version}/LICENSE")
|
||||||
|
assert_path_not_exist File.join(dir, "gems/whispercpp-#{version}/ext/build")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,8 @@ Gem::Specification.new do |s|
|
|||||||
if s.extra_rdoc_files.include?(basename)
|
if s.extra_rdoc_files.include?(basename)
|
||||||
basename
|
basename
|
||||||
else
|
else
|
||||||
file.sub("../..", "ext")
|
file.sub("../..", "ext/sources")
|
||||||
|
.sub("../javascript", "ext/sources/bindings/javascript")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user