From: Mathieu Baudier Date: Mon, 20 Jan 2025 14:18:52 +0000 (+0100) Subject: Initial Debian packaging X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=187542a5d0ec2250965dee7d1fc23f3d093db626;p=pkg%2Fggml%2Fsources%2Fggml Initial Debian packaging --- diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000..86866cf8 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,8 @@ +# dpkg-buildpackage -b -us -uc +*.log +*.substvars +.debhelper +debhelper-build-stamp +ggml*/ +libggml*/ +files diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..8956dc16 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +ggml (0.0.0+20250114.d92321c-1) unstable; urgency=medium + + * Based on GGML commit d92321c + + -- Mathieu Baudier Mon, 20 Jan 2025 14:17:58 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..be01cb6b --- /dev/null +++ b/debian/control @@ -0,0 +1,86 @@ +Source: ggml +Section: science +Priority: optional +Maintainer: Mathieu Baudier +Build-Depends: debhelper-compat (= 13), pkg-config, cmake-data, cmake, cpio, git, + libopenblas-openmp-dev, libopenblas64-openmp-dev, libvulkan-dev, glslc +Standards-Version: 4.5.1 +Homepage: https://github.com/ggerganov +Rules-Requires-Root: binary-targets + +Package: ggml +Priority: optional +Architecture: any +Depends: libggml, libggml-cpu +Description: Tensor library for machine learning (metapackage) + GGML Tensor library for machine learning. (metapackage) + +Package: libggml-base +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends} +Description: Tensor library for machine learning (base) + GGML Tensor library for machine learning. (base) + +Package: libggml +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + libggml-base +Description: Tensor library for machine learning (loader) + GGML Tensor library for machine learning. (loader) + +Package: libggml-cpu +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + libggml-base +Description: Tensor library for machine learning (CPU backend) + GGML Tensor library for machine learning. (CPU backend) + +Package: libggml-blas +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + libggml, +# GGML shows warning that it uses OpenMP if default OpenBLAS (pthread) is used. + libopenblas0-openmp, libopenblas64-0-openmp, +Description: Tensor library for machine learning (OpenBLAS backend) + GGML Tensor library for machine learning. (OpenBLAS backend) + +Package: libggml-rpc +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + libggml +Description: Tensor library for machine learning (RPC backend) + GGML Tensor library for machine learning. (RPC backend) + +Package: libggml-vulkan +Priority: optional +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + libggml, + libvulkan1 +Description: Tensor library for machine learning (Vulkan backend) + GGML Tensor library for machine learning. (Vulkan backend) + +Package: ggml-dev +Priority: optional +Architecture: any +Depends: ggml (= ${binary:Version}) +Description: Tensor library for machine learning (development files) + GGML Tensor library for machine learning. (development files) + \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..8debe613 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,44 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ggml +Upstream-Contact: https://github.com/ggerganov/ggml/issues +Source: https://github.com/ggerganov/ggml + +Files: * +Copyright: Copyright (c) 2023-2025 The ggml, llama.cpp and whisper.cpp authors +License: MIT + 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 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: debian/* +Copyright: 2024-2025 Mathieu Baudier +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/ggml-dev.install b/debian/ggml-dev.install new file mode 100644 index 00000000..e31e1e5e --- /dev/null +++ b/debian/ggml-dev.install @@ -0,0 +1,4 @@ +/usr/include/* +/usr/share/pkgconfig/*.pc + +include/ggml-cpp.h usr/include/ diff --git a/debian/libggml-base.install b/debian/libggml-base.install new file mode 100644 index 00000000..f8e6dee9 --- /dev/null +++ b/debian/libggml-base.install @@ -0,0 +1 @@ +/usr/lib/*/libggml-base.so diff --git a/debian/libggml-blas.install b/debian/libggml-blas.install new file mode 100644 index 00000000..130b7bab --- /dev/null +++ b/debian/libggml-blas.install @@ -0,0 +1 @@ +/usr/lib/*/libggml-blas.so diff --git a/debian/libggml-cpu.install b/debian/libggml-cpu.install new file mode 100644 index 00000000..aa9291aa --- /dev/null +++ b/debian/libggml-cpu.install @@ -0,0 +1 @@ +/usr/lib/*/libggml-cpu-*.so diff --git a/debian/libggml-rpc.install b/debian/libggml-rpc.install new file mode 100644 index 00000000..1a61a7a0 --- /dev/null +++ b/debian/libggml-rpc.install @@ -0,0 +1 @@ +/usr/lib/*/libggml-rpc.so diff --git a/debian/libggml-vulkan.install b/debian/libggml-vulkan.install new file mode 100644 index 00000000..aef8ce08 --- /dev/null +++ b/debian/libggml-vulkan.install @@ -0,0 +1 @@ +/usr/lib/*/libggml-vulkan.so diff --git a/debian/libggml.install b/debian/libggml.install new file mode 100644 index 00000000..5f30d798 --- /dev/null +++ b/debian/libggml.install @@ -0,0 +1 @@ +/usr/lib/*/libggml.so diff --git a/debian/not-installed b/debian/not-installed new file mode 100644 index 00000000..8393c245 --- /dev/null +++ b/debian/not-installed @@ -0,0 +1 @@ +usr/bin/vulkan-shaders-gen diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..b10d1269 --- /dev/null +++ b/debian/rules @@ -0,0 +1,45 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +#export DH_VERBOSE = 1 + +LC_ALL := C.UTF-8 +export LC_ALL + +include /usr/share/dpkg/architecture.mk + +DEB_BUILD_OPTIONS ?= parallel=8 + +build_multiarch=build/$(DEB_HOST_MULTIARCH) +install_lib_multiarch=debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) + +%: +# Use build/ for output, so that it is in the .gitignore of upstream + dh $@ --buildsystem=cmake --builddirectory=$(build_multiarch) + +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_SKIP_BUILD_RPATH=ON \ + -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \ + -DBUILD_SHARED_LIBS=ON \ + -DGGML_CCACHE=OFF \ + -DGGML_STANDALONE=ON \ + -DGGML_BUILD_TESTS=OFF \ + -DGGML_BUILD_EXAMPLES=OFF \ + \ + -DGGML_BACKEND_DL=ON \ + -DGGML_CPU_ALL_VARIANTS=ON \ + -DGGML_NATIVE=OFF \ + -DGGML_RPC=ON \ + -DGGML_BLAS=ON \ + -DGGML_BLAS_VENDOR=OpenBLAS \ + -DGGML_VULKAN=ON \ + -DGGML_CUDA=OFF \ + +override_dh_auto_install: + dh_auto_install + env + # Since no CMake install configuration is available for the libggml-* backend target: + # - we set CMAKE_SKIP_BUILD_RPATH=ON during build + # - we install the backends explicitly in the dist tree + install -t $(install_lib_multiarch) $(build_multiarch)/bin/libggml-*.so + \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)