From: Mathieu Baudier Date: Tue, 11 Nov 2025 09:00:26 +0000 (+0100) Subject: Update upstream and improve packaging X-Git-Tag: debian/0.9.4.185-1~2 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=9f1adae585616b751019ef033187ded53f36f262;p=pkg%2Fggml%2Fsources%2Fggml Update upstream and improve packaging --- diff --git a/debian/changelog b/debian/changelog index f4f21a88..33acd681 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ggml (0.9.4.185-1) unstable; urgency=medium + + * Upstream llama.cpp and whisper.cpp syncs + * Move backends to Debian location + * Build natively for Raspberry Pi5 on Ubuntu ARM + + -- Mathieu Baudier Tue, 11 Nov 2025 07:55:58 +0000 + ggml (0.9.4.58-1) unstable; urgency=medium * Upstream llama.cpp sync diff --git a/debian/control b/debian/control index ecb9df70..805a0777 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Vcs-Browser: https://git.djapps.eu/?p=pkg/ggml/sources/ggml;a=summary Vcs-Git: https://git.djapps.eu/pkg/ggml/sources/ggml Homepage: https://github.com/ggml-org/ggml Build-Depends: cmake, + lsb-release, debhelper-compat (= 13), pkgconf, libvulkan-dev , diff --git a/debian/libggml-backend-cpu.install b/debian/libggml-backend-cpu.install index 277c4409..dc3268de 100644 --- a/debian/libggml-backend-cpu.install +++ b/debian/libggml-backend-cpu.install @@ -1 +1 @@ -/usr/libexec/*/ggml/libggml-cpu*.so +usr/lib/*/ggml/backends0/libggml-cpu*.so diff --git a/debian/libggml-backend-cuda.install b/debian/libggml-backend-cuda.install index bfd525d7..6cba0776 100644 --- a/debian/libggml-backend-cuda.install +++ b/debian/libggml-backend-cuda.install @@ -1 +1 @@ -/usr/libexec/*/ggml/libggml-cuda.so +usr/lib/*/ggml/backends0/libggml-cuda.so diff --git a/debian/libggml-backend-rpc.install b/debian/libggml-backend-rpc.install index ad63249f..ff6c47da 100644 --- a/debian/libggml-backend-rpc.install +++ b/debian/libggml-backend-rpc.install @@ -1 +1 @@ -/usr/libexec/*/ggml/libggml-rpc.so +usr/lib/*/ggml/backends0/libggml-rpc.so diff --git a/debian/libggml-backend-vulkan.install b/debian/libggml-backend-vulkan.install index cbdccf66..a3e26750 100644 --- a/debian/libggml-backend-vulkan.install +++ b/debian/libggml-backend-vulkan.install @@ -1 +1 @@ -/usr/libexec/*/ggml/libggml-vulkan.so +usr/lib/*/ggml/backends0/libggml-vulkan.so diff --git a/debian/patches/0001-improve-cmake-build.patch b/debian/patches/0001-improve-cmake-build.patch index 46712816..75e1e3e6 100644 --- a/debian/patches/0001-improve-cmake-build.patch +++ b/debian/patches/0001-improve-cmake-build.patch @@ -7,10 +7,10 @@ Subject: improve-cmake-build 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 892c233..cef289b 100644 +index f30e4ac..44a9fdd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -418,5 +418,9 @@ if (BUILD_SHARED_LIBS) +@@ -434,5 +434,9 @@ if (BUILD_SHARED_LIBS) set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON) target_compile_definitions(${target} PRIVATE GGML_BUILD) target_compile_definitions(${target} PUBLIC GGML_SHARED) diff --git a/debian/rules b/debian/rules index 9e17932c..dfde2f7e 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,16 @@ #export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Derivative +distribution := $(shell lsb_release --id --short) +distrel := $(shell lsb_release --codename --short) +derivative := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \ + elif dpkg-vendor --derives-from Debian; then echo Debian; \ + else echo Unknown; fi) +ifeq ($(distrel),n/a) + distrel := sid +endif + # For multiarch include /usr/share/dpkg/architecture.mk # For DEB_VERSION_UPSTREAM @@ -19,6 +29,7 @@ CMAKE_OPTS = -DGGML_NATIVE=OFF \ -DGGML_BUILD_TESTS=OFF \ -DGGML_BUILD_EXAMPLES=OFF \ -DGGML_BACKEND_DL=ON \ + -DGGML_BACKEND_DIR=/usr/lib/${DEB_HOST_MULTIARCH}/ggml/backends0 \ # Common backends CMAKE_OPTS += -DGGML_RPC=ON \ @@ -27,11 +38,15 @@ ifeq ($(filter pkg.ggml.novulkan,$(DEB_BUILD_PROFILES)),) CMAKE_OPTS += -DGGML_VULKAN=ON endif -# Optimize for Raspberry Pi 5 ifeq ($(DEB_TARGET_ARCH),arm64) +ifeq ($(distribution),ubuntu) +# Optimize for Raspberry Pi 5 on Ubuntu CMAKE_OPTS += -DGGML_CPU_ALL_VARIANTS=OFF \ - -DGGML_CPU_ARM_ARCH=armv8.2-a+crypto+fp16+rcpc+dotprod - + -DGGML_NATIVE +else +CMAKE_OPTS += -DGGML_CPU_ALL_VARIANTS=OFF \ + -DGGML_CPU_ARM_ARCH=armv8.0-a +endif else CMAKE_OPTS += -DGGML_CPU_ALL_VARIANTS=ON @@ -44,7 +59,7 @@ CMAKE_OPTS += -DGGML_CUDA=ON \ -DCUDAToolkit_ROOT=/usr endif -endif # aarch64 +endif # arm64 # Use build/ for output, so that it is in the .gitignore of upstream %: @@ -54,12 +69,5 @@ endif # aarch64 override_dh_auto_configure: dh_auto_configure -- $(CMAKE_OPTS) -execute_after_dh_auto_install-arch: - # Move backends *.so to libexec, as we don't want them lurking in /usr/bin - mkdir -p debian/tmp/usr/libexec/$(DEB_TARGET_MULTIARCH)/ggml - for file in debian/tmp/usr/bin/libggml-*.so; do \ - mv $$file debian/tmp/usr/libexec/$(DEB_TARGET_MULTIARCH)/ggml; \ - done - override_dh_installexamples: dh_installexamples --exclude=.gitignore