Skip to content

Commit

Permalink
fix whisper.cpp-main broken
Browse files Browse the repository at this point in the history
Upstream added a hard failure on its executable name.
  • Loading branch information
ddennedy committed Jan 22, 2025
1 parent 4b12570 commit 8c77e2e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions scripts/build-shotcut-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ function install_spatialaudio {

function install_whispercpp {
cmd ninja -C build install
cmd install -p -c build/bin/main.exe $FINAL_INSTALL_DIR/bin/whisper.cpp-main.exe
cmd install -p -c build/bin/main.exe $FINAL_INSTALL_DIR/bin/whisper-cli.exe
cmd mkdir -p $FINAL_INSTALL_DIR/share/shotcut/whisper_models
cmd install -p -c models/ggml-base-q5_1.bin $FINAL_INSTALL_DIR/share/shotcut/whisper_models
}
Expand Down Expand Up @@ -1213,7 +1213,7 @@ function deploy
cmd mv bin/ffplay.exe .
cmd mv bin/ffprobe.exe .
cmd mv bin/glaxnimate.exe .
cmd mv bin/whisper.cpp-main.exe .
cmd mv bin/whisper-cli.exe .
cmd rm -rf bin include etc man manifest src *.txt
cmd rm lib/*
cmd rm -rf lib/cmake lib/pkgconfig lib/gdk-pixbuf-2.0 lib/glib-2.0 lib/gtk-2.0
Expand Down
16 changes: 8 additions & 8 deletions scripts/build-shotcut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ EOF
function install_whispercpp {
cmd ninja -C build install
cmd mkdir -p $FINAL_INSTALL_DIR/bin
cmd install -p -c build/bin/main $FINAL_INSTALL_DIR/bin/whisper.cpp-main
cmd install -p -c build/bin/main $FINAL_INSTALL_DIR/bin/whisper-cli
cmd mkdir -p $FINAL_INSTALL_DIR/share/shotcut/whisper_models
cmd install -p -c models/ggml-base-q5_1.bin $FINAL_INSTALL_DIR/share/shotcut/whisper_models
}
Expand Down Expand Up @@ -1888,7 +1888,7 @@ function deploy_mac

log Copying supplementary executables
cmd mkdir -p MacOS 2>/dev/null
cmd cp -a "$FINAL_INSTALL_DIR"/bin/{melt,ffmpeg,ffplay,ffprobe,glaxnimate,gopro2gpx,whisper.cpp-main} MacOS
cmd cp -a "$FINAL_INSTALL_DIR"/bin/{melt,ffmpeg,ffplay,ffprobe,glaxnimate,gopro2gpx,whisper-cli} MacOS
cmd mkdir -p Frameworks 2>/dev/null
cmd cp -p ../../lib/libCuteLogger.dylib Frameworks
for exe in MacOS/Shotcut MacOS/melt MacOS/ffmpeg MacOS/ffplay MacOS/ffprobe MacOS/glaxnimate; do
Expand All @@ -1903,11 +1903,11 @@ function deploy_mac
# whisper.cpp
cmd cp -p "$FINAL_INSTALL_DIR"/lib/libwhisper.1.dylib Frameworks
cmd cp -p "$FINAL_INSTALL_DIR"/lib/libggml.dylib Frameworks
fixlibs MacOS/whisper.cpp-main
log fixing rpath of executable "whisper.cpp-main"
cmd install_name_tool -delete_rpath "$SOURCE_DIR"/whisper.cpp/build/src MacOS/whisper.cpp-main 2> /dev/null
cmd install_name_tool -delete_rpath "$SOURCE_DIR"/whisper.cpp/build/ggml/src MacOS/whisper.cpp-main 2> /dev/null
cmd install_name_tool -add_rpath "@executable_path/../Frameworks" MacOS/whisper.cpp-main
fixlibs MacOS/whisper-cli
log fixing rpath of executable "whisper-cli"
cmd install_name_tool -delete_rpath "$SOURCE_DIR"/whisper.cpp/build/src MacOS/whisper-cli 2> /dev/null
cmd install_name_tool -delete_rpath "$SOURCE_DIR"/whisper.cpp/build/ggml/src MacOS/whisper-cli 2> /dev/null
cmd install_name_tool -add_rpath "@executable_path/../Frameworks" MacOS/whisper-cli

# MLT plugins
log Copying MLT plugins
Expand Down Expand Up @@ -2095,7 +2095,7 @@ End-of-environment-setup-template
cp $TMPFILE "$FINAL_INSTALL_DIR/source-me" || die "Unable to create environment script - cp failed"

log Creating wrapper scripts in $TMPFILE
for exe in melt ffmpeg ffplay ffprobe glaxnimate whisper.cpp-main; do
for exe in melt ffmpeg ffplay ffprobe glaxnimate whisper-cli; do
cat > $TMPFILE <<End-of-exe-wrapper
#!/bin/sh
# Set up environment
Expand Down
2 changes: 1 addition & 1 deletion scripts/codesign_and_notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ find ~/Desktop/Shotcut.app/Contents/Resources -type f -exec codesign --options=r
xattr -cr ~/Desktop/Shotcut.app
codesign --options=runtime --force --verbose --sign "$SIGNER" \
--entitlements ./notarization.entitlements \
~/Desktop/Shotcut.app/Contents/MacOS/{melt,ffmpeg,ffplay,ffprobe,glaxnimate,gopro2gpx,whisper.cpp-main}
~/Desktop/Shotcut.app/Contents/MacOS/{melt,ffmpeg,ffplay,ffprobe,glaxnimate,gopro2gpx,whisper-cli}
codesign --options=runtime --force --verbose --sign "$SIGNER" \
--entitlements ./notarization.entitlements \
~/Desktop/Shotcut.app
Expand Down
4 changes: 2 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,9 +1495,9 @@ QString ShotcutSettings::whisperExe()
{
QDir dir(qApp->applicationDirPath());
#if defined(Q_OS_WIN)
auto exe = "whisper.cpp-main.exe";
auto exe = "whisper-cli.exe";
#else
auto exe = "whisper.cpp-main";
auto exe = "whisper-cli";
#endif
return settings.value("subtitles/whisperExe", dir.absoluteFilePath(exe)).toString();
}
Expand Down

0 comments on commit 8c77e2e

Please sign in to comment.