Skip to content
Snippets Groups Projects
Unverified Commit ee643f14 authored by LN Liberda's avatar LN Liberda
Browse files

testing/whisper-cpp: new aport

parent 87b19298
No related branches found
No related tags found
No related merge requests found
Pipeline #160803 failed
# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=whisper-cpp
pkgver=1.3.0
pkgrel=0
pkgdesc="High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model"
url="https://github.com/ggerganov/whisper.cpp"
arch="all"
license="MIT"
makedepends="cmake"
subpackages="$pkgname-dev"
source="
https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v$pkgver/whisper.cpp-$pkgver.tar.gz
whisper.pc
really-not-x86.patch
"
builddir="$srcdir/whisper.cpp-$pkgver"
build() {
sed -e "s/@PKGVER@/$pkgver/" -i "$srcdir"/whisper.pc
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=None \
$CMAKE_CROSSOPTS .
cmake --build build
}
check() {
cd build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
DESTDIR="$pkgdir" cmake --install build
install -Dm644 "$srcdir"/whisper.pc "$pkgdir"/usr/lib/pkgconfig/whisper.pc
}
sha512sums="
59a8272ec42ff448c7c205ced3f381a3dc9a9bf772381b65c40562b973181e9d5d5f6d19560ff22ac5bca61f64a73a5ea1b02d448badbaeb58ff83e62e8e4e77 whisper.cpp-1.3.0.tar.gz
1df4942a3a84f6bb64e4fdcabe78508f77d1f6c35f58c27aa80314ce59ced4d7ff0394a3bdf1af8535d42c9720b0fb6dfa0a3ea8021c645c6d9c95d8ee75135e whisper.pc
a602f41b6b23cc65e29ea230cbc03a7f25300a2d0361f2e9ce18d24f1c35aa3b07c426992f3e5e00dc8fa0bfe087de6dbe88f8a2654a4dc490b8aa136fb9ee85 really-not-x86.patch
"
--- ./CMakeLists.txt.orig
+++ ./CMakeLists.txt
@@ -175,7 +175,7 @@
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
message(STATUS "ARM detected")
-else()
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "((i[3-6]|x)86|(AMD|IA)64)")
message(STATUS "x86 detected")
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2")
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
modules=1
Name: whisper
Version: @PKGVER@
Description: High-performance automatic speech recognition (ASR) model
Requires:
Libs: -L${libdir} -lwhisper
Cflags: -I${includedir}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment