appimage: fix metadata

- correct appstream metadata filename and location
- correct desktop entry filename
This commit is contained in:
Benoit Pierre authored and Frans de Jonge committed 2026-02-10 08:04:24 +01:00
1 parent d18736fcc4
commit 2237dce2e3
1 file changed
+19 -5
+19 -5
View File
@@ -3,6 +3,11 @@ APPIMAGE_DIR = $(PLATFORM_DIR)/appimage
APPIMAGETOOL = appimagetool-$(APPIMAGE_ARCH).AppImage
APPIMAGETOOL_URL = https://github.com/AppImage/appimagetool/releases/download/continuous/$(APPIMAGETOOL)
APPID = rocks.koreader.koreader
APPDIR = $(INSTALL_DIR)/appimage
DESKTOP = usr/share/applications/$(APPID).desktop
METAINFO = usr/share/metainfo/$(APPID).appdata.xml
KOREADER_APPIMAGE = koreader-$(DIST)-$(APPIMAGE_ARCH)-$(VERSION).AppImage
UBUNTU_LIBBSD = /lib/$(TARGET_MACHINE)/libbsd.so.0
@@ -24,18 +29,27 @@ appimagetool $(APPIMAGETOOL):
mv $(APPIMAGETOOL).part $(APPIMAGETOOL)
update: all $(APPIMAGETOOL)
cd $(INSTALL_DIR)/koreader && '$(abspath tools/mkrelease.sh)' ../appimage/ . $(release_excludes)
cp $(APPIMAGE_DIR)/{AppRun,koreader.desktop} resources/koreader.png $(INSTALL_DIR)/appimage/
sed -e 's/%%VERSION%%/$(VERSION)/' -e 's/%%DATE%%/$(RELEASE_DATE)/' $(PLATFORM_DIR)/common/koreader.metainfo.xml >$(INSTALL_DIR)/appimage/koreader.appdata.xml
cd $(INSTALL_DIR)/koreader && '$(abspath tools/mkrelease.sh)' $(abspath $(APPDIR))/ . $(release_excludes)
# Launcher.
install -D $(APPIMAGE_DIR)/AppRun $(APPDIR)/
# Icon.
install -D resources/koreader.png $(APPDIR)/
ln -s koreader.png $(APPDIR)/.DirIcon
# Desktop entry.
install -D $(APPIMAGE_DIR)/koreader.desktop $(APPDIR)/$(DESKTOP)
ln -s $(DESKTOP) $(APPDIR)/$(notdir $(DESKTOP))
# AppStream metadata.
install -D $(PLATFORM_DIR)/common/koreader.metainfo.xml $(APPDIR)/$(METAINFO)
sed -i -e 's/%%VERSION%%/$(VERSION)/' -e 's/%%DATE%%/$(RELEASE_DATE)/' $(APPDIR)/$(METAINFO)
# Also copy libbsd.so.0 (cf. https://github.com/koreader/koreader/issues/4627).
ifeq (,$(wildcard $(UBUNTU_LIBBSD)))
# Only warn if it's missing (e.g. when testing on a non-Ubuntu distribution).
echo 'WARNING: not bundling missing $(UBUNTU_LIBBSD)' 1>&2
else
cp $(UBUNTU_LIBBSD) $(INSTALL_DIR)/appimage/libs/
install $(UBUNTU_LIBBSD) $(APPDIR)/libs/
endif
# Generate AppImage.
ARCH='$(APPIMAGE_ARCH)' ./$(APPIMAGETOOL) --appimage-extract-and-run $(INSTALL_DIR)/appimage $(KOREADER_APPIMAGE)
ARCH='$(APPIMAGE_ARCH)' ./$(APPIMAGETOOL) --appimage-extract-and-run $(APPDIR) $(KOREADER_APPIMAGE)
PHONY += appimagetool update
SOUND += $(APPIMAGETOOL)