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/.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/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 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" ] } } diff --git a/src b/src new file mode 160000 index 0000000..c8ae9a7 --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit c8ae9a750c6c89dc928503a16175b7b3c2d224e4