diff --git a/common/shlibs b/common/shlibs index df7ae661980e51..56a3fd0c7b868d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4695,3 +4695,5 @@ libcgif.so.0 cgif-0.5.3_1 libdsk.so.5 libdsk-1.5.22_1 libblend2d.so libblend2d-0.21.2_1 libqjs.so.0 libquickjs-ng-0.18.0_1 +libggml.so.1 ggml-1.1.1_1 +libggml-base.so.1 ggml-1.1.1_1 diff --git a/srcpkgs/ggml-devel b/srcpkgs/ggml-devel new file mode 120000 index 00000000000000..8b83bbdfce6b49 --- /dev/null +++ b/srcpkgs/ggml-devel @@ -0,0 +1 @@ +ggml \ No newline at end of file diff --git a/srcpkgs/ggml/template b/srcpkgs/ggml/template new file mode 100644 index 00000000000000..e65fead0bd6abd --- /dev/null +++ b/srcpkgs/ggml/template @@ -0,0 +1,39 @@ +# Template file for 'ggml' +pkgname=ggml +version=1.1.1 +revision=1 +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DGGML_BUILD_EXAMPLES=OFF + -DGGML_VULKAN=ON" +hostmakedepends="shaderc" +makedepends="libgomp-devel vulkan-loader-devel Vulkan-Headers SPIRV-Headers" +short_desc="Tensor library for machine learning" +maintainer="Mateusz Sylwestrzak " +license="MIT" +homepage="https://github.com/ggml-org/ggml" +changelog="https://github.com/ggml-org/ggml/releases" +distfiles="https://github.com/ggml-org/ggml/archive/refs/tags/v${version}.tar.gz" +checksum=ee3f83e4839e4be8201fd87019855d70713362b7b657d2fde283d95274a7b8b3 + +case "$XBPS_TARGET_MACHINE" in + armv6l*) + # Error: selected processor does not support yield in ARM mode + # Vulkan offers little practical benefit on ARMv6 hardware anyway + configure_args="${configure_args/-DGGML_VULKAN=ON/-DGGML_VULKAN=OFF}" + ;; +esac + +post_install() { + vlicense LICENSE +} + +ggml-devel_package() { + short_desc+=" - development files" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + vmove usr/lib/cmake + } +} diff --git a/srcpkgs/whisper.cpp-devel b/srcpkgs/whisper.cpp-devel new file mode 120000 index 00000000000000..39792963500dba --- /dev/null +++ b/srcpkgs/whisper.cpp-devel @@ -0,0 +1 @@ +whisper.cpp \ No newline at end of file diff --git a/srcpkgs/whisper.cpp-server b/srcpkgs/whisper.cpp-server new file mode 120000 index 00000000000000..39792963500dba --- /dev/null +++ b/srcpkgs/whisper.cpp-server @@ -0,0 +1 @@ +whisper.cpp \ No newline at end of file diff --git a/srcpkgs/whisper.cpp/template b/srcpkgs/whisper.cpp/template new file mode 100644 index 00000000000000..80da8a88d753a2 --- /dev/null +++ b/srcpkgs/whisper.cpp/template @@ -0,0 +1,50 @@ +# Template file for 'whisper.cpp' +pkgname=whisper.cpp +version=1.9.6 +revision=1 +build_style=cmake +configure_args="-DWHISPER_COMMON_FFMPEG=ON -DWHISPER_BUILD_SERVER=ON + -DWHISPER_USE_SYSTEM_GGML=ON -DWHISPER_BUILD_IS_DEV=OFF" +hostmakedepends="pkg-config" +makedepends="ffmpeg6-devel ggml-devel libgomp-devel" +short_desc="Port of OpenAI's Whisper model in C/C++" +maintainer="Mateusz Sylwestrzak " +license="MIT" +homepage="https://github.com/ggml-org/whisper.cpp" +changelog="https://github.com/ggml-org/whisper.cpp/releases" +distfiles="https://github.com/ggml-org/whisper.cpp/archive/refs/tags/v${version}.tar.gz" +checksum=7ab15dc88022d2425ad94dcffd8abbf1b6d7018089b4e48d6b40780738e0b445 + +do_check() { + # test-vad-full: needs ggml-base.en.bin model to pass + # test-whisper-cli-large: takes too much resources + # test-parakeet: requires network and additional tools + ctest --test-dir build \ + -E 'test-vad-full|test-whisper-cli-large|test-parakeet' +} + +post_install() { + vlicense LICENSE + + # downloads Whisper model files that have already been converted to ggml format + vbin models/download-ggml-model.sh download-ggml-model +} + +whisper.cpp-server_package() { + short_desc+=" - server" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/bin/whisper-server + } +} + +whisper.cpp-devel_package() { + short_desc+=" - development files" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + vmove usr/lib/cmake + } +}