From: Mathieu Baudier Date: Sun, 23 Feb 2025 14:13:50 +0000 (+0100) Subject: Improve packaging based on Debian mentoring feedback X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=66593387f269e966ab27c8cc482b8d845f9e6e7c;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp Improve packaging based on Debian mentoring feedback --- diff --git a/debian/changelog b/debian/changelog index a5165fe9..8fc9b9d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -whisper-cpp (1.7.4+95-1) unstable; urgency=medium +whisper-cpp (1.7.4+95-2) unstable; urgency=medium - * Update upstream + * Improve packaging based on mentoring feedback - -- Mathieu Baudier Wed, 05 Feb 2025 15:05:40 +0000 + -- Mathieu Baudier Sun, 23 Feb 2025 11:39:50 +0000 diff --git a/debian/cmake/debian-whisper.cpp.cmake b/debian/cmake/debian-whisper.cpp.cmake index e66fc203..e9b7025d 100644 --- a/debian/cmake/debian-whisper.cpp.cmake +++ b/debian/cmake/debian-whisper.cpp.cmake @@ -21,7 +21,9 @@ set_target_properties(ggml PROPERTIES IMPORTED_LOCATION ${GGML_LOCATION}) target_link_libraries(ggml INTERFACE ${GGML_BASE_LOCATION}) # libwhisper actually link against a CPU backend -find_library(GGML_CPU_LOCATION ggml-cpu) +#find_library(GGML_CPU_LOCATION ggml-cpu) +# FIXME better way to find CPU backend +set(GGML_CPU_LOCATION /usr/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml/libggml-cpu-sandybridge.so) message (STATUS "Found GGML CPU library: ${GGML_CPU_LOCATION}") link_libraries(${GGML_CPU_LOCATION}) diff --git a/debian/control b/debian/control index 8dd0a71b..3e6ca94e 100644 --- a/debian/control +++ b/debian/control @@ -2,64 +2,75 @@ Source: whisper-cpp Section: science Priority: optional Maintainer: Mathieu Baudier -Build-Depends: debhelper-compat (= 13), pkg-config, cmake-data, cmake, cpio, file, git, - libsdl2-dev, - ggml-dev, libggml-cpu, libllama-dev -Standards-Version: 4.5.1 +Build-Depends: debhelper-compat (= 13), pkgconf, + cmake-data, cmake, + libsdl2-dev, + ggml-dev, libggml-cpu, + libllama0-dev, +Standards-Version: 4.7.0 +Vcs-Git: https://git.djapps.eu/pkg/ggml/sources/whisper.cpp +Vcs-Browser: https://git.djapps.eu/?p=pkg/ggml/sources/whisper.cpp;a=summary Homepage: https://github.com/ggerganov/whisper.cpp Rules-Requires-Root: binary-targets Package: libwhisper1 -Priority: optional +Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, - libggml, libggml-cpu + libggml0, libggml-cpu Description: Inference of Whisper in pure C/C++ (shared library) - Whisper.cpp inference of Whisper in pure C/C++ (shared library). + The shared library provides the core of whisper.cpp + speech-to-text capabilities using a Whisper model. Package: whisper-cpp-cli Architecture: any -Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, libwhisper1 Description: Inference of Whisper in pure C/C++ (CLI) - Whisper.cpp inference of Whisper in pure C/C++ (CLI). + A versatile tool giving command line access to most + whisper-cpp capabilities. Package: whisper-cpp-stream Architecture: any -Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, libwhisper1, libsdl2-2.0-0 Description: Inference of Whisper in pure C/C++ (stream) - Whisper.cpp inference of Whisper in pure C/C++ (stream). + Real-time speech-to-text of SDL sound input. + The SDL sound input (typically a microphone) is + transcribed as text to the standard output. Package: whisper-cpp-talk-llama Architecture: any -Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, - libwhisper1, libllama, + libwhisper1, libllama0, espeak-ng, libswresample4, libavcodec59, libavformat59, libsdl2-2.0-0 Description: Inference of Whisper in pure C/C++ (talk-llama) - Whisper.cpp inference of Whisper in pure C/C++ (talk-llama). + A tool allowing one to "talk" with a large language model, + using llama.cpp. + The SDL input (typically from a microphone) is translated + into text by whisper.cpp and sent to llama.cpp for processing. Package: libwhisper1-dev -Priority: optional +Section: libdevel Architecture: any Multi-Arch: same Depends: ${misc:Depends}, ggml-dev, libwhisper1 (= ${binary:Version}) Description: Inference of Whisper in pure C/C++ (development files) - Whisper.cpp inference of Whisper in pure C/C++ (development files). + Development files for using whisper.cpp as a shared library + in applications. Package: whisper-cpp-dev +Section: libdevel Architecture: any -Priority: optional Depends: ${misc:Depends}, libwhisper1-dev (= ${binary:Version}) Description: Inference of Whisper in pure C/C++ (common static library) - Whisper.cpp inference of Whisper in pure C/C++ (common static library). + Development files and static libraries of the used to build the tools. + These components speeds up the development but are likely to have less + stable APIs. diff --git a/debian/copyright b/debian/copyright index 7754d047..cef6e23d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,7 +5,7 @@ Source: https://github.com/ggerganov/whisper.cpp Files: * Copyright: Copyright (c) 2023-2025 The whisper.cpp authors -License: MIT +License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/debian/libwhisper1.lintian-overrides b/debian/libwhisper1.lintian-overrides new file mode 100644 index 00000000..e52c6ed5 --- /dev/null +++ b/debian/libwhisper1.lintian-overrides @@ -0,0 +1,3 @@ +# According to https://wiki.debian.org/UsingSymbolsFiles +# "For C++ libraries it is often better not to ship symbols files." +libwhisper1: no-symbols-control-file usr/lib/x86_64-linux-gnu/libwhisper.so.* diff --git a/debian/rules b/debian/rules index 0bed3d32..5790272d 100755 --- a/debian/rules +++ b/debian/rules @@ -11,6 +11,12 @@ install_lib=debian/tmp/usr/lib install_lib_multiarch=debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) install_libexec_multiarch=debian/tmp/usr/libexec/$(DEB_HOST_MULTIARCH) +# parallelism +DEB_BUILD_OPTIONS ?= parallel=8 + +# hardening +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + %: # Use build/ for output, so that it is in the .gitignore of upstream dh $@ --buildsystem=cmake --builddirectory=$(build_multiarch) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index 55bd626e..e37abc56 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,3 +1,15 @@ +# some of the "examples" are actually source code form this packaging perspective +whisper-cpp source: package-does-not-install-examples [bindings/go/examples/] +whisper-cpp source: package-does-not-install-examples [examples/] + +# unused source code whisper-cpp source: source-is-missing [bindings/javascript/libwhisper.worker.js] whisper-cpp source: source-is-missing [bindings/javascript/whisper.js] whisper-cpp source: source-is-missing [examples/wchess/wchess.wasm/jquery-3.7.1.min.js] +whisper-cpp source: source-contains-prebuilt-java-object [bindings/java/gradle/wrapper/gradle-wrapper.jar] +whisper-cpp source: source-contains-prebuilt-java-object [examples/whisper.android.java/gradle/wrapper/gradle-wrapper.jar] +whisper-cpp source: source-contains-prebuilt-java-object [examples/whisper.android/gradle/wrapper/gradle-wrapper.jar] +whisper-cpp source: source-contains-prebuilt-javascript-object [bindings/javascript/libwhisper.worker.js] +whisper-cpp source: source-contains-prebuilt-javascript-object [bindings/javascript/whisper.js] +whisper-cpp source: source-contains-prebuilt-javascript-object [examples/wchess/wchess.wasm/chessboardjs-1.0.0/js/chessboard-1.0.0.min.js] +whisper-cpp source: source-contains-prebuilt-javascript-object [examples/wchess/wchess.wasm/jquery-3.7.1.min.js] diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..8b2d317c --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts="mode=git" \ +https://git.djapps.eu/pkg/ggml/sources/whisper.cpp refs/tags/upstream/([\d\.]+) diff --git a/debian/whisper-cpp-dev.install b/debian/whisper-cpp-dev.install index 02af7f8a..e6d7c6c8 100644 --- a/debian/whisper-cpp-dev.install +++ b/debian/whisper-cpp-dev.install @@ -1,2 +1,3 @@ -/usr/include/whisper.cpp/common -/usr/lib/*/whisper.cpp/* +/usr/include/whisper.cpp/common/*.h +/usr/lib/*/whisper.cpp/common/libcommon.a +/usr/lib/*/whisper.cpp/common/libcommon-sdl.a