1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Linux: implement automatic creation of AppImage bundle during build of generic binaries

This commit is contained in:
Mounir IDRASSI
2025-05-10 23:32:55 +09:00
parent b80e6b329b
commit 4944477b5a
5 changed files with 66 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ fi
make WXSTATIC=1 clean || exit 1
make WXSTATIC=1 || exit 1
make WXSTATIC=1 package || exit 1
make WXSTATIC=1 appimage || exit 1
echo "Building console version of VeraCrypt"

View File

@@ -314,6 +314,9 @@ ifndef TC_NO_GUI
cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
cp $(BASE_DIR)/Setup/Linux/$(APPNAME).desktop $(BASE_DIR)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
cp $(BASE_DIR)/Setup/Linux/$(APPNAME).xml $(BASE_DIR)/Setup/Linux/usr/share/mime/packages/$(APPNAME).xml
cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/Linux/veracrypt.AppDir/$(APPNAME).xpm
cp -r $(BASE_DIR)/Setup/Linux/usr $(BASE_DIR)/Setup/Linux/veracrypt.AppDir/.
endif
@@ -344,6 +347,48 @@ package: prepare
cp $(INTERNAL_INSTALLER_NAME) $(BASE_DIR)/Setup/Linux/packaging/.
makeself $(BASE_DIR)/Setup/Linux/packaging $(BASE_DIR)/Setup/Linux/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) Installer" ./$(INTERNAL_INSTALLER_NAME)
appimage: prepare
@set -e; \
_appimagetool_arch_suffix=""; \
_final_appimage_arch_suffix=""; \
case "$(CPU_ARCH)" in \
x86) \
_appimagetool_arch_suffix="i686"; \
_final_appimage_arch_suffix="i686"; \
;; \
x64) \
_appimagetool_arch_suffix="x86_64"; \
_final_appimage_arch_suffix="x86_64"; \
;; \
arm64) \
_appimagetool_arch_suffix="aarch64"; \
_final_appimage_arch_suffix="aarch64"; \
;; \
arm7) \
_appimagetool_arch_suffix="armhf"; \
_final_appimage_arch_suffix="armhf"; \
;; \
*) \
echo "Error: Unsupported CPU_ARCH for AppImage: $(CPU_ARCH). Supported: x86, x64, arm64, arm7" >&2; \
exit 1; \
;; \
esac; \
_appimagetool_executable_name="appimagetool-$${_appimagetool_arch_suffix}.AppImage"; \
_appimagetool_executable_path="$(BASE_DIR)/Setup/Linux/$${_appimagetool_executable_name}"; \
_appimagetool_url="https://github.com/AppImage/appimagetool/releases/download/continuous/$${_appimagetool_executable_name}"; \
_final_appimage_filename="VeraCrypt-$(TC_VERSION)-$${_final_appimage_arch_suffix}.AppImage"; \
_final_appimage_path="$(BASE_DIR)/Setup/Linux/$${_final_appimage_filename}"; \
\
echo "Preparing AppImage for $(CPU_ARCH) (using $${_appimagetool_arch_suffix})..."; \
echo "Downloading appimagetool from $${_appimagetool_url}..."; \
wget --quiet -O "$${_appimagetool_executable_path}" "$${_appimagetool_url}"; \
chmod +x "$${_appimagetool_executable_path}"; \
echo "Creating AppImage $${_final_appimage_path}..."; \
ARCH="$${_final_appimage_arch_suffix}" "$${_appimagetool_executable_path}" "$(BASE_DIR)/Setup/Linux/veracrypt.AppDir" "$${_final_appimage_path}"; \
echo "AppImage created: $${_final_appimage_path}"; \
echo "Cleaning up appimagetool..."; \
rm -f "$${_appimagetool_executable_path}";
endif
endif

View File

@@ -602,6 +602,9 @@ install:
package:
$(MAKE) -C Main -f Main.make NAME=Main package
appimage:
$(MAKE) -C Main -f Main.make NAME=Main appimage
#------ wxWidgets build ------
ifeq "$(MAKECMDGOALS)" "wxbuild"

View File

@@ -0,0 +1,6 @@
#!/bin/sh
# Get the directory where AppRun is located
APPDIR=$(dirname "$(readlink -f "$0")")
# Execute the main VeraCrypt application
exec "${APPDIR}/usr/bin/veracrypt" "$@"

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=VeraCrypt
GenericName=VeraCrypt volume manager
Comment=Create and mount VeraCrypt encrypted volumes
Icon=veracrypt
Exec=AppRun
Categories=System;Security;Utility;Filesystem;
Keywords=encryption,filesystem
Terminal=false
MimeType=application/x-veracrypt-volume;application/x-truecrypt-volume;