From: Mathieu Baudier Date: Mon, 23 Jun 2025 08:47:02 +0000 (+0200) Subject: Update upstream and improve build X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d544c56b7c968c978e3230f4e89862fc11cc7241;p=pkg%2Fggml%2Fsources%2Fggml Update upstream and improve build --- diff --git a/debian/changelog b/debian/changelog index 4623ac5e..bd7f23de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ -ggml (0.0.2015-1) unstable; urgency=medium +ggml (0.0.2199-1) unstable; urgency=medium * Update upstream Closes: #1096105 - -- Mathieu Baudier Sun, 25 May 2025 10:27:36 +0000 + -- Mathieu Baudier Mon, 23 Jun 2025 08:33:37 +0000 diff --git a/debian/cmake/debian-ggml.cmake b/debian/cmake/debian-ggml.cmake deleted file mode 100644 index b7ff6934..00000000 --- a/debian/cmake/debian-ggml.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(GGML_BUILD_NUMBER 2015) - diff --git a/debian/patches/0001-improve-cmake-build.patch b/debian/patches/0001-improve-cmake-build.patch index f3eb25b1..45ad8284 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 0002ac1..48687f0 100644 +index 17c9366..90871d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -353,5 +353,9 @@ if (BUILD_SHARED_LIBS) +@@ -379,5 +379,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 2690d72a..c9a36db4 100755 --- a/debian/rules +++ b/debian/rules @@ -5,10 +5,12 @@ LC_ALL := C.UTF-8 export LC_ALL -# multiarch +# For multiarch include /usr/share/dpkg/architecture.mk +# For DEB_VERSION_UPSTREAM +include /usr/share/dpkg/pkg-info.mk -build_multiarch=build/$(DEB_HOST_MULTIARCH) +install_bin=debian/tmp/usr/bin install_lib_multiarch=debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) install_libexec_multiarch=debian/tmp/usr/libexec/$(DEB_HOST_MULTIARCH) @@ -33,18 +35,17 @@ endif %: # Use build/ for output, so that it is in the .gitignore of upstream - dh $@ --buildsystem=cmake --builddirectory=$(build_multiarch) + dh $@ --buildsystem=cmake override_dh_auto_configure: dh_auto_configure -- \ + -DGGML_BUILD_NUMBER=$(subst 0.0.,,$(DEB_VERSION_UPSTREAM)) \ -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \ - -DCMAKE_SKIP_BUILD_RPATH=ON \ - -DCMAKE_PROJECT_ggml_INCLUDE=debian/cmake/debian-ggml.cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_SHARED_LIBS=ON \ -DGGML_CCACHE=OFF \ -DGGML_STANDALONE=ON \ - -DGGML_BUILD_TESTS=OFF \ + -DGGML_BUILD_TESTS=ON \ -DGGML_BUILD_EXAMPLES=OFF \ -DGGML_CPU_AARCH64=$(GGML_CPU_AARCH64) \ -DGGML_BACKEND_DL=ON \ @@ -60,13 +61,10 @@ override_dh_auto_configure: override_dh_auto_install: dh_auto_install - # 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 libexec so that executables can be installed with them + # Move backends *.so to libexec, as we don't want them lurking in /usr/bin mkdir -p $(install_libexec_multiarch)/ggml - for file in $(build_multiarch)/bin/libggml-*.so; do \ - #patchelf --set-soname $$(basename "$$file") $$file; \ - install -t $(install_libexec_multiarch)/ggml $$file; \ + for file in $(install_bin)/libggml-*.so; do \ + mv $$file $(install_libexec_multiarch)/ggml; \ done override_dh_installexamples: