Skip to content

Commit

Permalink
Merge pull request msys2#19092 from lazka/whisper.cpp-1.5.0
Browse files Browse the repository at this point in the history
whisper.cpp: Update to 1.5.0
  • Loading branch information
lazka authored Nov 16, 2023
2 parents d586334 + 6701696 commit 180f3b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
11 changes: 11 additions & 0 deletions mingw-w64-whisper.cpp/0002-fix-openblas-lookup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- whisper.cpp-1.5.0/CMakeLists.txt.orig 2023-11-16 19:00:45.515603300 +0100
+++ whisper.cpp-1.5.0/CMakeLists.txt 2023-11-16 19:00:56.847646600 +0100
@@ -173,7 +173,7 @@
endif()

if (WHISPER_BLAS)
- if (WIN32)
+ if (MSVC)
if(DEFINED ENV{OPENBLAS_PATH})
set(BLAS_LIBRARIES $ENV{OPENBLAS_PATH}/lib/libopenblas.dll.a)
message(STATUS "Libraries ${BLAS_LIBRARIES}")
16 changes: 11 additions & 5 deletions mingw-w64-whisper.cpp/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_realname=whisper.cpp
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.4.3
pkgver=1.5.0
pkgrel=1
pkgdesc="Port of OpenAI's Whisper model in C/C++ (mingw-w64)"
arch=('any')
Expand All @@ -22,14 +22,19 @@ makedepends=(
"${MINGW_PACKAGE_PREFIX}-pkgconf"
)
source=("https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v${pkgver}.tar.gz"
"0001-fix-importlib-location.patch")
sha256sums=('5f11c0542639bfb0b3c9d1b033d10ccd69ca26e739aec9366766617bc58a6e7c'
'30765001468dbc40893a2a63e675b2b40f290e27c3314e82dd7f72404d2d1ccf')
"0001-fix-importlib-location.patch"
"0002-fix-openblas-lookup.patch")
sha256sums=('088e6fcb5a38179308c4120c6ac4296918d2ea974321f6f2a062aec067c36880'
'30765001468dbc40893a2a63e675b2b40f290e27c3314e82dd7f72404d2d1ccf'
'0314546c2ab5810ba84d4b2e14a84f992a282fc57698bd7a678756f8f6d13171')
noextract=("v${pkgver}.tar.gz")

prepare() {
tar xzf "v${pkgver}.tar.gz" || tar xzf "v${pkgver}.tar.gz"
cd "${srcdir}"/${_realname}-${pkgver}

patch -p1 -i "${srcdir}/0001-fix-importlib-location.patch"
patch -p1 -i "${srcdir}/0002-fix-openblas-lookup.patch"
}

build() {
Expand All @@ -42,7 +47,6 @@ build() {
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

OPENBLAS_PATH="${MINGW_PREFIX}" \
CFLAGS+=" $(pkgconf.exe --cflags openblas)" \
LDFLAGS+=" -Wl,--export-all-symbols" \
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
Expand All @@ -52,6 +56,8 @@ build() {
-DWHISPER_SDL2=ON \
-DWHISPER_OPENBLAS=ON \
-DWHISPER_BUILD_EXAMPLES=ON \
-DBLAS_LIBRARIES="`pkgconf --libs-only-l openblas`" \
-DBLAS_INCLUDE_DIRS="`pkgconf --cflags-only-I openblas`" \
-DBUILD_SHARED_LIBS=ON \
-DWHISPER_ALL_WARNINGS=OFF \
"${extra_config[@]}" \
Expand Down

0 comments on commit 180f3b7

Please sign in to comment.