]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
Update upstream and improve packaging
authorMathieu Baudier <redacted>
Tue, 11 Nov 2025 09:00:26 +0000 (10:00 +0100)
committerMathieu Baudier <redacted>
Tue, 11 Nov 2025 09:26:52 +0000 (10:26 +0100)
debian/changelog
debian/control
debian/libggml-backend-cpu.install
debian/libggml-backend-cuda.install
debian/libggml-backend-rpc.install
debian/libggml-backend-vulkan.install
debian/patches/0001-improve-cmake-build.patch
debian/rules

index f4f21a88a21899782223f466dd3e9260c5cfe2ec..33acd6816562223283bf27d4685ce274f436253e 100644 (file)
@@ -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 <mbaudier@argeo.org>  Tue, 11 Nov 2025 07:55:58 +0000
+
 ggml (0.9.4.58-1) unstable; urgency=medium
 
   * Upstream llama.cpp sync
index ecb9df70635398c1b632599e1c3f20dcc43f7ab1..805a077709b1e3a5c53be18dd3810a8a0005dbf0 100644 (file)
@@ -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            <!pkg.ggml.novulkan>,
index 277c440917bcbe35891e6c507ac13271ded2d897..dc3268de6e9b5ed105170eace1b7bc10c647cbdc 100644 (file)
@@ -1 +1 @@
-/usr/libexec/*/ggml/libggml-cpu*.so
+usr/lib/*/ggml/backends0/libggml-cpu*.so
index bfd525d724970676b8563e72694f62f3cf452602..6cba0776863d6ceb235f7852f36784a0dc799d56 100644 (file)
@@ -1 +1 @@
-/usr/libexec/*/ggml/libggml-cuda.so
+usr/lib/*/ggml/backends0/libggml-cuda.so
index ad63249fe5416b91d4eb726faab6f7cae66cd932..ff6c47da5756c80ee52f2f2e820d149841d4dd41 100644 (file)
@@ -1 +1 @@
-/usr/libexec/*/ggml/libggml-rpc.so
+usr/lib/*/ggml/backends0/libggml-rpc.so
index cbdccf662f80c1e51dd1b1441618a390ad2e6d99..a3e26750de1dc4b9a18a6357f606079efd82e495 100644 (file)
@@ -1 +1 @@
-/usr/libexec/*/ggml/libggml-vulkan.so
+usr/lib/*/ggml/backends0/libggml-vulkan.so
index 4671281655b888022c01aa2d002bcdb0c5357f93..75e1e3e63caacc7523d0246eabfd6a466af7cc9f 100644 (file)
@@ -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)
index 9e17932c79bbf24011f27b9d2984c50348827baa..dfde2f7ee9505f623d10d55e8190da55106dd631 100755 (executable)
@@ -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