diff --git a/mingw-w64-whisper.cpp/0002-fix-openblas-lookup.patch b/mingw-w64-whisper.cpp/0002-fix-openblas-lookup.patch new file mode 100644 index 0000000000000..3588b275406de --- /dev/null +++ b/mingw-w64-whisper.cpp/0002-fix-openblas-lookup.patch @@ -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}") diff --git a/mingw-w64-whisper.cpp/PKGBUILD b/mingw-w64-whisper.cpp/PKGBUILD index c878444cbf1d5..0e14ed6ba27ba 100644 --- a/mingw-w64-whisper.cpp/PKGBUILD +++ b/mingw-w64-whisper.cpp/PKGBUILD @@ -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') @@ -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() { @@ -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=" \ @@ -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[@]}" \