]> Nutra Git (v1) - nutratech/gui.git/commitdiff
appimage target
authorShane Jaroch <chown_tee@proton.me>
Sat, 24 Jan 2026 06:14:41 +0000 (01:14 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 24 Jan 2026 06:14:41 +0000 (01:14 -0500)
CMakeLists.txt
Makefile
scripts/build_appimage.sh [new file with mode: 0755]

index 07ea4d66b016c60d133def704c927ac2652e2113..4398ff3b0865657fa3d1816e88ceecb4f7d98a24 100644 (file)
@@ -84,3 +84,16 @@ install(FILES resources/nutrition_icon-no_bg.png DESTINATION ${CMAKE_INSTALL_DAT
 if(NUTRA_DB_FILE AND EXISTS "${NUTRA_DB_FILE}")
     install(FILES "${NUTRA_DB_FILE}" DESTINATION share/nutra RENAME usda.sqlite3)
 endif()
+
+# AppImage generation (requires linuxdeploy and linuxdeploy-plugin-qt in PATH)
+find_program(LINUXDEPLOY linuxdeploy)
+
+if(LINUXDEPLOY)
+    add_custom_target(appimage
+        COMMAND ${CMAKE_COMMAND} --install . --prefix AppDir/usr
+        COMMAND ${LINUXDEPLOY} --appdir=AppDir --plugin=qt --output=appimage
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+        COMMENT "Generating AppImage..."
+        VERBATIM
+    )
+endif()
index c7690f02305f9be78fa45c8082116654ef8a3b75..07dfbe7a168a3c5deda404dec6f08818f6a26358 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,12 @@ release:
        $(CMAKE) -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release -DNUTRA_VERSION="$(VERSION)"
        $(CMAKE) --build $(BUILD_DIR) --config Release
 
+.PHONY: appimage
+appimage:
+       $(CMAKE) -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+       $(CMAKE) --build build -j"$(nproc)"
+       $(CMAKE) --build build --target appimage
+
 .PHONY: clean
 clean:
        $(CMAKE) -E remove_directory $(BUILD_DIR)
diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh
new file mode 100755 (executable)
index 0000000..e6fa0cd
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Build AppImage from project root
+# Assumes linuxdeploy and linuxdeploy-plugin-qt are in PATH
+set -e
+
+cd "$(dirname "$0")/.." || exit 1
+
+cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+cmake --build build -j"$(nproc)"
+cmake --build build --target appimage