forked from koreader/koreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make: factorize code for generating release updates
Instead of splitting remove / exclusion of unwanted files in 2-3 places (`all` rule, `update` rule, and update script in some cases), install the same files in debug & release builds, and exclude unwanted stuff when generating the update. This should finally fix the CI issue with OCR tests (since we don't remove the `data/dict` & `data/tessdata` directories on release build anymore).
- Loading branch information
1 parent
bcb7753
commit 9fdaa33
Showing
15 changed files
with
544 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
APPIMAGE_DIR = $(PLATFORM_DIR)/appimage | ||
|
||
APPIMAGETOOL = appimagetool-x86_64.AppImage | ||
APPIMAGETOOL_URL = https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage | ||
APPIMAGETOOL_URL = https://github.com/AppImage/AppImageKit/releases/download/13/$(APPIMAGETOOL) | ||
|
||
KOREADER_APPIMAGE = koreader-$(DIST)-$(MACHINE)-$(VERSION).AppImage | ||
|
||
UBUNTU_LIBBSD = /lib/x86_64-linux-gnu/libbsd.so.0 | ||
|
||
define UPDATE_PATH_EXCLUDES += | ||
plugins/SSH.koplugin | ||
plugins/autofrontlight.koplugin | ||
plugins/timesync.koplugin | ||
$(filter-out tools/trace_require.lua tools/wbuilder.lua,$(wildcard tools/*)) | ||
endef | ||
|
||
update: all | ||
# remove old package if any | ||
rm -f koreader-appimage-$(MACHINE)-$(VERSION).appimage | ||
$(SYMLINK) $(APPIMAGE_DIR)/AppRun $(INSTALL_DIR)/koreader/ | ||
$(SYMLINK) $(APPIMAGE_DIR)/koreader.desktop $(INSTALL_DIR)/koreader/ | ||
$(SYMLINK) resources/koreader.png $(INSTALL_DIR)/koreader/ | ||
sed -e 's/%%VERSION%%/$(VERSION)/' -e 's/%%DATE%%/$(RELEASE_DATE)/' $(PLATFORM_DIR)/common/koreader.metainfo.xml >$(INSTALL_DIR)/koreader/koreader.appdata.xml | ||
# also copy libbsd.so.0, cf. https://github.com/koreader/koreader/issues/4627 | ||
$(SYMLINK) /lib/x86_64-linux-gnu/libbsd.so.0 $(INSTALL_DIR)/koreader/libs/ | ||
ifeq ("$(wildcard $(APPIMAGETOOL))","") | ||
# download appimagetool | ||
wget "$(APPIMAGETOOL_URL)" | ||
chmod a+x "$(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 | ||
# 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/ | ||
endif | ||
ifeq (,$(wildcard $(APPIMAGETOOL))) | ||
# Download appimagetool. | ||
wget '$(APPIMAGETOOL_URL)' | ||
chmod a+x ./$(APPIMAGETOOL) | ||
endif | ||
cd $(INSTALL_DIR) && pwd && \ | ||
rm -rf tmp && mkdir -p tmp && \ | ||
cp -Lr koreader tmp && \ | ||
rm -rf tmp/koreader/ota && \ | ||
rm -rf tmp/koreader/resources/icons/src && \ | ||
rm -rf tmp/koreader/spec | ||
# generate AppImage | ||
cd $(INSTALL_DIR)/tmp && \ | ||
ARCH=x86_64 "$$OLDPWD/$(APPIMAGETOOL)" --appimage-extract-and-run koreader && \ | ||
mv *.AppImage ../../koreader-$(DIST)-$(MACHINE)-$(VERSION).AppImage | ||
# Generate AppImage. | ||
ARCH=x86_64 ./$(APPIMAGETOOL) --appimage-extract-and-run $(INSTALL_DIR)/appimage $(KOREADER_APPIMAGE) | ||
|
||
PHONY += update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.