diff --git a/.gitignore b/.gitignore index 2651e48..36f9e8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/whisper.cpp-1.6.0.tar.gz +/whisper.cpp-1.6.2.tar.gz diff --git a/0001-libwhisper.so-should-be-position-independent.patch b/0001-libwhisper.so-should-be-position-independent.patch deleted file mode 100644 index a26f2dc..0000000 --- a/0001-libwhisper.so-should-be-position-independent.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 37bd815bdf19522e50fd00478cbc962d05715db8 Mon Sep 17 00:00:00 2001 -From: Tom Rix -Date: Sat, 20 Jan 2024 08:38:15 -0500 -Subject: [PATCH] libwhisper.so should be position independent - -This is similar to how libllama.so is built. - -Signed-off-by: Tom Rix ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01e64c4..a97f9c9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -504,6 +504,7 @@ else() - endif() - - if (BUILD_SHARED_LIBS) -+ set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON) - target_link_libraries(${TARGET} PUBLIC - ${CMAKE_DL_LIBS} - ) --- -2.43.0 - diff --git a/sources b/sources index f06b5fa..7402e57 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (whisper.cpp-1.5.4.tar.gz) = 0375c32bc5a590e6152e1a37059554371ceab99b3c93a733c084cec356c477ab2bc2d78fc0b661104153be0becb41f0edeff68ab762cb51c528309055c141455 +SHA512 (whisper.cpp-1.6.2.tar.gz) = 17e0485fb93fdea1a89f584a64db35f05371e0b8710a539f0dffca30bd3a2fff44c72ea754556566ca3cc55415b1e8f2bb868665437f5c93b9ce666b4fe53fb3 diff --git a/whisper-cpp.spec b/whisper-cpp.spec index 927c834..05f0baa 100644 --- a/whisper-cpp.spec +++ b/whisper-cpp.spec @@ -1,3 +1,7 @@ +# Some optional subpackages +%bcond_with examples +%bcond_with test + Summary: Port of OpenAI's Whisper model in C/C++ Name: whisper-cpp @@ -8,21 +12,33 @@ License: MIT # examples/whisper.android/gradlew* # These are not distributed -Version: 1.5.4 +Version: 1.6.2 Release: %autorelease URL: https://github.com/ggerganov/whisper.cpp Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/whisper.cpp-%{version}.tar.gz # https://github.com/ggerganov/whisper.cpp/pull/1791 -Patch0: 0001-Generalize-install-locations.patch -# https://github.com/ggerganov/whisper.cpp/pull/1792 -Patch1: 0001-libwhisper.so-should-be-position-independent.patch +# Patch0: 0001-Gieneralize-install-locations.patch -ExclusiveArch: x86_64 aarch64 ppc64le -%global toolchain clang +ExclusiveArch: x86_64 aarch64 +%global toolchain gcc -BuildRequires: cmake +BuildRequires: cmake >= 3.27 BuildRequires: clang +BuildRequires: coreutils +BuildRequires: sed +BuildRequires: git +BuildRequires: pkgconfig(ffmpeg) +BuildRequires: pkgconfig(ffmpeg-devel) + +#Requires: ffmpeg +#Requires: ffmpeg-devel + +# TODO: add openblas package +# TODO: add OPENVINO package +# TODO: add CLBLAST package + +# TODO opencl, rocm, CoreML %description High-performance inference of OpenAI's Whisper automatic speech @@ -64,21 +80,53 @@ recognition (ASR) model: * OpenVINO Support * C-style API +%if %{with test} +%package test +Summary: Tests for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description test +%{summary} +%endif + +%if %{with examples} +%package examples +Summary: Examples for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description examples +%{summary} +%endif + %prep %autosetup -p1 -n whisper.cpp-%{version} # verson the *.so sed -i -e 's/POSITION_INDEPENDENT_CODE ON/POSITION_INDEPENDENT_CODE ON SOVERSION %{version}/' CMakeLists.txt -%build +# git cruft +find . -name '.gitignore' -exec rm -rf {} \; +%build %cmake \ - -DWHISPER_BUILD_TESTS=ON \ + -DCMAKE_SYSTEM_NAME=ON + -DWHISPER_BUILD_TESTS=OFF \ + -DWHISPER_BUILD_EXAMPLES=OFF \ -DWHISPER_NO_AVX=ON \ -DWHISPER_NO_AVX2=ON \ -DWHISPER_NO_FMA=ON \ -DWHISPER_NO_F16C=ON - +%if %{with examples} + -DWHISPER_BUILD_EXAMPLES=ON +%else + -DWHISPER_BUILD_EXAMPLES=OFF +%endif +%if %{with test} + -DWHISPER_BUILD_TESTS=OFF +%else + -DWHISPER_BUILD_TESTS=OFF +%endif + %cmake_build %install