update source to whisper.cpp-1.6.0.tar.gz

removed 0001-libwhisper.so-should-be-position-independent.patch due to  https://github.com/ggerganov/whisper.cpp/pull/1792 being merged upstream

added coreutils

added examples and test section

git cruft

upgraded to version whisper.cpp-1.6.0.tar.gz of whisper

added ffmpeg to dependacy and set tests to off on main build

commented ffmpeg

disabled example

added back ffmpeg

removed power pc

t
replaced toolchain with gcc

added back ffmpeg and -devel
This commit is contained in:
Mohammadreza Hendiani 2024-05-21 17:58:27 +03:30
commit fcf93df0f5
No known key found for this signature in database
GPG key ID: 95358B3D35244150
4 changed files with 60 additions and 39 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
/whisper.cpp-1.6.0.tar.gz
/whisper.cpp-1.6.2.tar.gz

View file

@ -1,27 +0,0 @@
From 37bd815bdf19522e50fd00478cbc962d05715db8 Mon Sep 17 00:00:00 2001
From: Tom Rix <trix@redhat.com>
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 <trix@redhat.com>
---
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

View file

@ -1 +1 @@
SHA512 (whisper.cpp-1.5.4.tar.gz) = 0375c32bc5a590e6152e1a37059554371ceab99b3c93a733c084cec356c477ab2bc2d78fc0b661104153be0becb41f0edeff68ab762cb51c528309055c141455
SHA512 (whisper.cpp-1.6.2.tar.gz) = 17e0485fb93fdea1a89f584a64db35f05371e0b8710a539f0dffca30bd3a2fff44c72ea754556566ca3cc55415b1e8f2bb868665437f5c93b9ce666b4fe53fb3

View file

@ -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