include /usr/share/dpkg/architecture.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)
# parallelism
DEB_BUILD_OPTIONS ?= parallel=8
# Use build/ for output, so that it is in the .gitignore of upstream
dh $@ --buildsystem=cmake --builddirectory=$(build_multiarch)
+# FIXME we disable LLAMA_ALL_WARNINGS so that ggml_get_flags() CMake function do not get called
+# as it is available deep in GGML build scripts and not published
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \
-DLLAMA_USE_CURL=ON \
-DLLAMA_SERVER_SSL=ON \
-# FIXME we disable LLAMA_ALL_WARNINGS so that ggml_get_flags() CMake function do not get called
-# as it is available deep in GGML and not properly published
+override_dh_auto_install:
+ dh_auto_install
+
+ # Move executables to libexec, so that they can load the GGML backends
+ # and link them to bin
+ mkdir -p $(install_libexec_multiarch)/ggml
+ for file in $(install_bin)/llama-*; do \
+ mv $$file $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \
+ ln -s --relative -t $(install_bin) $(install_libexec_multiarch)/ggml/$$(basename "$$file"); \
+ done
override_dh_auto_test:
# tests which depends on remote location are failing