From: Mathieu Baudier Date: Wed, 22 Jan 2025 06:42:24 +0000 (+0100) Subject: Introduce patches X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=5e78b9c7c44b689dbe69d95d4ca0716b7b04a37b;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp Introduce patches --- diff --git a/debian/cmake/debian-whisper.cpp.cmake b/debian/cmake/debian-whisper.cpp.cmake index e72f2778..2b87b222 100644 --- a/debian/cmake/debian-whisper.cpp.cmake +++ b/debian/cmake/debian-whisper.cpp.cmake @@ -23,7 +23,8 @@ target_link_libraries(ggml INTERFACE ${GGML_BASE_LOCATION}) # quite a few examples require direct reference to ggml-cpu #find_library(GGML_CPU_LOCATION ggml-cpu-sandybridge) #message (STATUS "Found GGML CPU library: ${GGML_CPU_LOCATION}") -#link_libraries("/usr/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml/libggml-cpu-sandybridge.so") +link_libraries("${CMAKE_INSTALL_PREFIX}/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml/libggml-cpu-sandybridge.so") +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml") endif() add_compile_definitions(NDEBUG) diff --git a/debian/control b/debian/control index 4bb7428c..cd9b17a0 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Mathieu Baudier Build-Depends: debhelper-compat (= 13), pkg-config, cmake-data, cmake, cpio, file, git, libsdl2-dev, libswresample-dev, libavcodec-dev, libavformat-dev, libavdevice-dev, libavutil-dev, libavfilter-dev, - ggml-dev, libllama-dev + ggml-dev, libggml-cpu, libllama-dev Standards-Version: 4.5.1 Homepage: https://github.com/ggerganov/whisper.cpp Rules-Requires-Root: binary-targets @@ -16,7 +16,7 @@ Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, - libggml + libggml, libggml-cpu Description: Inference of Whisper in pure C/C++ (shared library) Whisper.cpp inference of Whisper in pure C/C++ (shared library). @@ -29,14 +29,24 @@ Depends: ${misc:Depends}, Description: Inference of Whisper in pure C/C++ (development files) Whisper.cpp inference of Whisper in pure C/C++ (development files). -#Package: whisper-cpp-cli -#Architecture: any -#Priority: optional -#Depends: ${shlibs:Depends}, -# libwhisper, -# libswresample4, libavcodec59, libavformat59, -#Description: Inference of Whisper in pure C/C++ (CLI) -# Whisper.cpp inference of Whisper in pure C/C++ (CLI). +Package: whisper-cpp-cli +Architecture: any +Priority: optional +Depends: ${shlibs:Depends}, + libwhisper, + libswresample4, libavcodec59, libavformat59 +Description: Inference of Whisper in pure C/C++ (CLI) + Whisper.cpp inference of Whisper in pure C/C++ (CLI). + +Package: whisper-cpp-stream +Architecture: any +Priority: optional +Depends: ${shlibs:Depends}, + libwhisper, + libswresample4, libavcodec59, libavformat59, + libsdl2-2.0-0 +Description: Inference of Whisper in pure C/C++ (stream) + Whisper.cpp inference of Whisper in pure C/C++ (stream). #Package: whisper-cpp-talk-llama #Architecture: any diff --git a/debian/patches/0001-filter-examples.patch b/debian/patches/0001-filter-examples.patch new file mode 100644 index 00000000..0a30acf3 --- /dev/null +++ b/debian/patches/0001-filter-examples.patch @@ -0,0 +1,36 @@ +From: Mathieu Baudier +Date: Wed, 22 Jan 2025 07:41:21 +0100 +Subject: filter-examples + +Disable building examples which are problematic or unnecessary. +--- + examples/CMakeLists.txt | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index d509626..6435959 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -104,16 +104,16 @@ elseif(CMAKE_JS_VERSION) + add_subdirectory(addon.node) + else() + add_subdirectory(cli) +- add_subdirectory(bench) +- add_subdirectory(server) +- add_subdirectory(quantize) ++ #add_subdirectory(bench) ++ #add_subdirectory(server) ++ #add_subdirectory(quantize) + if (WHISPER_SDL2) + add_subdirectory(stream) + add_subdirectory(command) +- add_subdirectory(talk-llama) +- add_subdirectory(lsp) ++ #add_subdirectory(talk-llama) ++ #add_subdirectory(lsp) + if (GGML_SYCL) +- add_subdirectory(sycl) ++ #add_subdirectory(sycl) + endif() + endif (WHISPER_SDL2) + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..2bf362d6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-filter-examples.patch diff --git a/debian/rules b/debian/rules index e16810bb..9198ce7b 100755 --- a/debian/rules +++ b/debian/rules @@ -20,7 +20,7 @@ override_dh_auto_configure: -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DWHISPER_BUILD_TESTS=OFF \ - -DWHISPER_BUILD_EXAMPLES=OFF \ + -DWHISPER_BUILD_EXAMPLES=ON \ -DWHISPER_FFMPEG=ON \ -DWHISPER_SDL2=ON \ @@ -29,11 +29,11 @@ override_dh_auto_install: # Move executables to libexec, so that they can load the GGML backends # and link them to bin - #mkdir -p $(install_libexec_multiarch)/ggml - #for file in $(install_bin)/whisper-*; do \ - # mv $$file $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \ - # ln -s --relative -t $(install_bin) $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \ - #done + mkdir -p $(install_libexec_multiarch)/ggml + for file in $(install_bin)/whisper-*; do \ + mv $$file $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \ + ln -s --relative -t $(install_bin) $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \ + done override_dh_auto_test: # tests which depends on remote location are failing diff --git a/debian/whisper-cpp-cli.install b/debian/whisper-cpp-cli.install index 1ea0ba21..cd8ea135 100644 --- a/debian/whisper-cpp-cli.install +++ b/debian/whisper-cpp-cli.install @@ -1,4 +1,2 @@ /usr/bin/whisper-cli /usr/libexec/*/ggml/whisper-cli -#/usr/bin/whisper-stream -#/usr/bin/whisper-command diff --git a/debian/whisper-cpp-dev.install b/debian/whisper-cpp-dev.install index 57f40580..02af7f8a 100644 --- a/debian/whisper-cpp-dev.install +++ b/debian/whisper-cpp-dev.install @@ -1,2 +1,2 @@ /usr/include/whisper.cpp/common -#/usr/lib/*/whisper.cpp/* +/usr/lib/*/whisper.cpp/* diff --git a/debian/whisper-cpp-stream.install b/debian/whisper-cpp-stream.install new file mode 100644 index 00000000..88d545c4 --- /dev/null +++ b/debian/whisper-cpp-stream.install @@ -0,0 +1,2 @@ +/usr/bin/whisper-stream +/usr/libexec/*/ggml/whisper-stream