From 00cfbef874e3d06da338a0a7e1765ac7300b3346 Mon Sep 17 00:00:00 2001 From: Chongbiao Chen Date: Fri, 3 Jul 2026 17:21:46 +0800 Subject: [PATCH 1/3] feat: add upstream llama.cpp submodule at tag b9861 Add ggml-org/llama.cpp as submodule src/, locked to tag b9861. Update debian/changelog to version 0.0.9861-1 matching upstream tag. Signed-off-by: Chongbiao Chen --- .gitmodules | 3 +++ debian/changelog | 8 ++++---- src | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 src diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c55f9ba --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src"] + path = src + url = https://github.com/ggml-org/llama.cpp.git diff --git a/debian/changelog b/debian/changelog index e1f3903..8b3cfc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -llama.cpp (0.1.0-1) UNRELEASED; urgency=medium +llama.cpp (0.0.9861-1) UNRELEASED; urgency=medium - * Add initial Debian packaging support - - -- "Radxa Computer Co., Ltd" Thu, 01 Jan 1970 08:00:00 +0800 + * Initial Debian packaging for Snapdragon Linux + * Based on upstream tag b9861 + -- "Radxa Computer Co., Ltd" Fri, 03 Jul 2026 08:00:00 +0800 diff --git a/src b/src new file mode 160000 index 0000000..c8ae9a7 --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit c8ae9a750c6c89dc928503a16175b7b3c2d224e4 From ef42de5760efa15077c411a8d2912bec401eb2c1 Mon Sep 17 00:00:00 2001 From: Chongbiao Chen Date: Mon, 6 Jul 2026 11:10:45 +0800 Subject: [PATCH 2/3] feat: add Snapdragon Hexagon DSP cross-compile packaging - Add Makefile.local: Docker cross-compile using snapdragon-toolchain with docker cp pattern for Docker-in-Docker support - Package: llama.cpp-qcom - Add debian/llama.cpp-qcom.install - Add lintian overrides for bundled shared libraries - Sync CMakeUserPresets.json version with upstream CMakePresets.json - Install docker.io in pre_build_dep for CI devcontainer Signed-off-by: Chongbiao Chen --- .github/local/Makefile.local | 39 +++++++++++++++++++++++++ debian/control | 7 +++-- debian/llama.cpp-qcom.install | 1 + debian/llama.cpp-qcom.lintian-overrides | 13 +++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .github/local/Makefile.local create mode 100644 debian/llama.cpp-qcom.install create mode 100644 debian/llama.cpp-qcom.lintian-overrides diff --git a/.github/local/Makefile.local b/.github/local/Makefile.local new file mode 100644 index 0000000..10a62b7 --- /dev/null +++ b/.github/local/Makefile.local @@ -0,0 +1,39 @@ +SRC_DIR := src + +debuild: build + +.PHONY: pre_build_dep +pre_build_dep: + sudo apt-get update + sudo apt-get install -y --no-install-recommends docker.io + +.PHONY: main_build +main_build: build-qcom + +# ===== Qualcomm Snapdragon (Hexagon DSP) ===== +PKG_QCOM := llama.cpp-qcom +BUILD_QCOM := $(SRC_DIR)/build-qcom +INSTALL_QCOM := $(SRC_DIR)/install-qcom +DOCKER_QCOM := ghcr.io/snapdragon-toolchain/arm64-linux:v0.1 + +.PHONY: build-qcom +build-qcom: + cp $(SRC_DIR)/docs/backend/snapdragon/CMakeUserPresets.json $(SRC_DIR)/ + sed -i 's/"version": 5/"version": 4/' $(SRC_DIR)/CMakeUserPresets.json + # Create container and copy source (docker cp avoids Docker-in-Docker volume mount issue) + docker create --name qcom-build --platform linux/amd64 $(DOCKER_QCOM) \ + /bin/bash -c ' \ + set -euo pipefail; \ + cd /workspace; \ + cmake --preset arm64-linux-snapdragon-release -B build-qcom; \ + cmake --build build-qcom -j $$(nproc); \ + cmake --install build-qcom --prefix install-qcom \ + ' + docker cp $(SRC_DIR)/. qcom-build:/workspace/ + docker start -a qcom-build + rm -rf $(INSTALL_QCOM) + docker cp qcom-build:/workspace/install-qcom/. $(INSTALL_QCOM)/ + docker rm qcom-build + rm -rf $(PKG_QCOM) + mkdir -p $(PKG_QCOM)/usr + cp -a $(INSTALL_QCOM)/* $(PKG_QCOM)/usr/ diff --git a/debian/control b/debian/control index 1deab94..80a6584 100644 --- a/debian/control +++ b/debian/control @@ -10,11 +10,12 @@ Build-Depends: debhelper-compat (= 13), dh-exec, pandoc, -Package: llama.cpp +Package: llama.cpp-qcom Architecture: all Section: admin Priority: optional Depends: ${misc:Depends}, -Description: llama.cpp - This package provides the llama.cpp. + fastrpc, +Description: llama.cpp for Qualcomm Snapdragon + llama.cpp with Hexagon DSP backend for Qualcomm Snapdragon devices. diff --git a/debian/llama.cpp-qcom.install b/debian/llama.cpp-qcom.install new file mode 100644 index 0000000..4cd0e16 --- /dev/null +++ b/debian/llama.cpp-qcom.install @@ -0,0 +1 @@ +llama.cpp-qcom/usr / diff --git a/debian/llama.cpp-qcom.lintian-overrides b/debian/llama.cpp-qcom.lintian-overrides new file mode 100644 index 0000000..0c10234 --- /dev/null +++ b/debian/llama.cpp-qcom.lintian-overrides @@ -0,0 +1,13 @@ +undeclared-elf-prerequisites +pkg-config-unavailable-for-cross-compilation +shared-library-lacks-version +link-to-shared-library-in-wrong-package +no-manual-page +arch-independent-package-contains-binary-or-object +lacks-ldconfig-trigger +library-not-linked-against-libc +no-shlibs +shared-library-lacks-stack-section +unstripped-binary-or-object +package-name-doesnt-match-sonames +missing-dependency-on-libc From 45408e7e5d2c251053abac10d25b36154ea3e4f4 Mon Sep 17 00:00:00 2001 From: Chongbiao Chen Date: Mon, 6 Jul 2026 18:21:13 +0800 Subject: [PATCH 3/3] chore: restrict pkg.conf to qcs9075 distributions only Signed-off-by: Chongbiao Chen --- pkg.conf.template | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/pkg.conf.template b/pkg.conf.template index 3e4edfe..4fda94b 100644 --- a/pkg.conf.template +++ b/pkg.conf.template @@ -1,24 +1,8 @@ { "*": { "Releases": [ - "buster", - "buster-test", - "bullseye", - "bullseye-test", - "bookworm", - "bookworm-test", - "trixie", - "trixie-test", - "sid", - "sid-test", - "focal", - "focal-test", - "jammy", - "jammy-test", - "noble", - "noble-test", - "resolute", - "resolute-test" + "qcs9075-noble", + "qcs9075-noble-test" ] } }