2023-02-17 00:45:30 +08:00
|
|
|
|
# Linux Appimage - 通用 Linux 平台 Appimage 构建方案
|
|
|
|
|
|
|
|
|
|
include linux-universal.mk
|
|
|
|
|
|
|
|
|
|
CPUS=$(shell nproc)
|
|
|
|
|
|
2023-02-17 02:25:32 +08:00
|
|
|
|
builddir := build/linux-appimage
|
2023-02-17 00:45:30 +08:00
|
|
|
|
# sourcedir := .
|
|
|
|
|
# CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
|
# CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
|
|
|
|
|
CMAKE_OPTIONS := -DUSE_LINUX_APPIMAGE=ON $(CMAKE_OPTIONS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------- Appimage Build Tools -------------------------------- #
|
|
|
|
|
# Appimage 的构建流 --
|
|
|
|
|
# 在 Makefile 进行构建目标构建 Appimage (要求提供工具的绝对路径,然后可依次进行linuxdeployqt, genrate-appimage)
|
|
|
|
|
# 来自于 https://github.com/probonopd/linuxdeployqt 的 linuxdeployqt
|
|
|
|
|
# 来自于 https://github.com/AppImage/AppImageKit 的 appimagetool
|
|
|
|
|
# 来自于 https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git 托管存储的工具
|
|
|
|
|
|
|
|
|
|
# 或指定你所想存放克隆项目的位置
|
2023-02-17 02:25:32 +08:00
|
|
|
|
BUNDLE_LINUXDEPLOYQT := $(shell pwd)/$(builddir)/bundle-linuxdeployqt
|
2023-02-17 00:45:30 +08:00
|
|
|
|
|
|
|
|
|
download-bundle-linuxdeploytools:
|
|
|
|
|
-git clone https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git $(BUNDLE_LINUXDEPLOYQT)
|
|
|
|
|
|
|
|
|
|
LINUXDEPLOYQT := "$(BUNDLE_LINUXDEPLOYQT)/linuxdeployqt-continuous-x86_64.AppImage"
|
|
|
|
|
APPIMAGETOOL := "$(BUNDLE_LINUXDEPLOYQT)/appimagetool-x86_64.AppImage"
|
|
|
|
|
|
|
|
|
|
# 追加 Appimagetool、linuxdeployqt 构建配置
|
|
|
|
|
CMAKE_OPTIONS := -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL) $(CMAKE_OPTIONS)
|
|
|
|
|
|
2023-03-29 00:58:00 +08:00
|
|
|
|
# 执行 Linux DeployQt 并生成可制作 Appimage 的目录结构
|
2023-02-17 00:45:30 +08:00
|
|
|
|
linuxdeploy: download-bundle-linuxdeploytools
|
2023-03-29 00:58:00 +08:00
|
|
|
|
cmake -B$(builddir) $(CMAKE_OPTIONS) -DUSE_APPIMAGE_NEW_GLIBC=ON
|
|
|
|
|
cmake --build $(builddir) --target linuxdeploy
|
|
|
|
|
|
|
|
|
|
# 执行 Linux DeployQt 并生成可制作 Appimage 的目录结构
|
|
|
|
|
# 但生成的应用程序将只使用操作系统中已安装的标准glibc库版本。
|
|
|
|
|
linuxdeploy-fast: download-bundle-linuxdeploytools
|
|
|
|
|
cmake -B$(builddir) $(CMAKE_OPTIONS) -DUSE_APPIMAGE_NEW_GLIBC=OFF
|
|
|
|
|
cmake --build $(builddir) --target linuxdeploy
|
2023-02-17 00:45:30 +08:00
|
|
|
|
|
2023-03-29 00:58:00 +08:00
|
|
|
|
# 执行 Appimage 目录结构的打包生成
|
|
|
|
|
make-appimage:
|
2023-02-17 00:45:30 +08:00
|
|
|
|
cmake -B$(builddir) $(CMAKE_OPTIONS)
|
2023-03-29 00:58:00 +08:00
|
|
|
|
cmake --build $(builddir) --target appimage
|
2023-02-17 00:45:30 +08:00
|
|
|
|
|
2023-03-29 00:58:00 +08:00
|
|
|
|
package: linux-universal-release linuxdeploy make-appimage
|
2023-02-17 00:45:30 +08:00
|
|
|
|
|
2023-03-29 00:58:00 +08:00
|
|
|
|
# 不要一开始就使用 - 否则无法生成 AppRun
|
|
|
|
|
package-fast: linux-universal-release linuxdeploy-fast make-appimage
|
2023-02-17 00:45:30 +08:00
|
|
|
|
|
|
|
|
|
linux-build-options:
|
|
|
|
|
@echo $(CMAKE_OPTIONS)
|
|
|
|
|
|
|
|
|
|
# 此配置为构建 linux Appimage 通用版本构建
|