Fix AppImage build issues: version parsing, CMake expansion, and conditional desktop ID

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
This commit is contained in:
anthropic-code-agent[bot]
2026-03-06 19:16:32 +00:00
co-authored by ashaduri
parent 8d95e6e90c
commit 04849d1492
4 changed files with 18 additions and 7 deletions
+5 -1
View File
@@ -26,12 +26,16 @@ jobs:
run: sudo apt-get install libgtkmm-3.0-dev gettext wget file
- name: Download linuxdeploy
# Note: Using 'continuous' release for latest version. For reproducible builds,
# pin to a specific release tag and verify SHA256 checksum.
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy
- name: Download appimagetool
# Note: Using 'continuous' release for latest version. For reproducible builds,
# pin to a specific release tag and verify SHA256 checksum.
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
@@ -107,7 +111,7 @@ jobs:
id: version
shell: bash
run: |
VERSION=$(grep "CMAKE_PROJECT_VERSION" version.txt | cut -d'=' -f2 | tr -d ' ')
VERSION=$(sed -n 's/.*CMAKE_PROJECT_VERSION[[:space:]]*"\([^"]*\)".*/\1/p' version.txt)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
+6 -3
View File
@@ -6,12 +6,15 @@
# Generate files
configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY)
if (APP_BUILD_APPIMAGE)
set(APPIMAGE_EXEC_LINE "Exec=\"@CMAKE_INSTALL_FULL_BINDIR@/gsmartcontrol\"")
set(APPIMAGE_DESKTOP_ID "dev.shaduri.gsmartcontrol")
set(APPIMAGE_EXEC_LINE "Exec=\"${CMAKE_INSTALL_FULL_BINDIR}/gsmartcontrol\"")
configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY)
configure_file("gsmartcontrol.in.desktop" "dev.shaduri.gsmartcontrol.desktop" ESCAPE_QUOTES @ONLY)
else()
set(APPIMAGE_EXEC_LINE "Exec=\"@CMAKE_INSTALL_FULL_BINDIR@/gsmartcontrol-root\"")
set(APPIMAGE_DESKTOP_ID "gsmartcontrol")
set(APPIMAGE_EXEC_LINE "Exec=\"${CMAKE_INSTALL_FULL_BINDIR}/gsmartcontrol-root\"")
configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY)
configure_file("gsmartcontrol.in.desktop" "gsmartcontrol.desktop" ESCAPE_QUOTES @ONLY)
endif()
configure_file("gsmartcontrol-root.in.sh" "gsmartcontrol-root.sh" ESCAPE_QUOTES @ONLY)
+1 -1
View File
@@ -14,7 +14,7 @@
on it.
</p>
</description>
<launchable type="desktop-id">dev.shaduri.gsmartcontrol.desktop</launchable>
<launchable type="desktop-id">@APPIMAGE_DESKTOP_ID@.desktop</launchable>
<url type="homepage">https://gsmartcontrol.shaduri.dev</url>
<screenshots>
<screenshot type="default">
+6 -2
View File
@@ -36,6 +36,8 @@ fi
if ! command -v linuxdeploy &> /dev/null; then
echo -e "${YELLOW}Warning: linuxdeploy not found. Will attempt to download it.${NC}"
# Note: Using 'continuous' release for latest version. For reproducible builds,
# pin to a specific release tag and verify SHA256 checksum.
LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage"
wget -N "$LINUXDEPLOY_URL" -O linuxdeploy
chmod +x linuxdeploy
@@ -46,6 +48,8 @@ fi
if ! command -v appimagetool &> /dev/null; then
echo -e "${YELLOW}Warning: appimagetool not found. Will attempt to download it.${NC}"
# Note: Using 'continuous' release for latest version. For reproducible builds,
# pin to a specific release tag and verify SHA256 checksum.
APPIMAGETOOL_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${ARCH}.AppImage"
wget -N "$APPIMAGETOOL_URL" -O appimagetool
chmod +x appimagetool
@@ -121,8 +125,8 @@ if [ -d "$APPDIR/usr/lib/gdk-pixbuf-2.0" ]; then
gdk-pixbuf-query-loaders > "$APPDIR/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" 2>/dev/null || true
fi
# Get version from CMakeLists.txt
VERSION=$(grep "CMAKE_PROJECT_VERSION" version.txt | cut -d'=' -f2 | tr -d ' ')
# Get version from version.txt (extract quoted CMAKE_PROJECT_VERSION value)
VERSION=$(sed -n 's/.*CMAKE_PROJECT_VERSION[[:space:]]*"\([^"]*\)".*/\1/p' version.txt | head -n1)
# Create AppImage
echo -e "${GREEN}Creating AppImage...${NC}"