From f7b44e552b27b820fe28a9bf57b1ea9de7eecfbc Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Mon, 16 Jan 2023 22:29:09 +0100 Subject: [PATCH] fixes to crete manual script in appimage --- utils/Zano_appimage_wrapper.sh | 41 ++++++++++++++++++++++++++++ utils/build_script_linux_appimage.sh | 25 ++++++++++++----- 2 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 utils/Zano_appimage_wrapper.sh diff --git a/utils/Zano_appimage_wrapper.sh b/utils/Zano_appimage_wrapper.sh new file mode 100644 index 00000000..3d8ef13a --- /dev/null +++ b/utils/Zano_appimage_wrapper.sh @@ -0,0 +1,41 @@ +#!/bin/bash -x +script_dir=$( dirname "$(readlink -f "$0")" ) + +out_dir=~/.local/share/applications +out_file_name="${out_dir}/Zano.desktop" + +call_app() +{ + pushd $script_dir + usr/bin/Zano "$@" + popd + exit +} + + +create_desktop_icon() +{ + target_file_name=$1 + echo "Generating icon file: $target_file_name..." + rm -f "${out_dir}/Zano.png" + rm -f $target_file_name + cp -Rv "${APPDIR}/usr/share/icons/hicolor/256x256/apps/Zano.png" "${out_dir}/Zano.png" + echo [Desktop Entry] | tee -a $target_file_name > /dev/null + echo Version=1.0 | tee -a $target_file_name > /dev/null + echo Name=Zano | tee -a $target_file_name > /dev/null + echo GenericName=Zano | tee -a $target_file_name > /dev/null + echo Comment=Privacy blockchain | tee -a $target_file_name > /dev/null + echo Icon=${out_dir}/Zano.png | tee -a $target_file_name > /dev/null + echo Exec=$0 --deeplink-params=%u | tee -a $target_file_name > /dev/null + echo Terminal=true | tee -a $target_file_name > /dev/null + echo Type=Application | tee -a $target_file_name > /dev/null + echo "Categories=Qt;Utility;" | tee -a $target_file_name > /dev/null + echo "MimeType=x-scheme-handler/zano;" | tee -a $target_file_name > /dev/null +} + + +create_desktop_icon $out_file_name + +xdg-mime default Zano.desktop x-scheme-handler/zano + +call_app "$@" \ No newline at end of file diff --git a/utils/build_script_linux_appimage.sh b/utils/build_script_linux_appimage.sh index 77dff12c..94cb3cce 100755 --- a/utils/build_script_linux_appimage.sh +++ b/utils/build_script_linux_appimage.sh @@ -11,6 +11,7 @@ # export QT_PREFIX_PATH=/home/user/Qt5.10.1/5.10.1/gcc_64 # export OPENSSL_ROOT_DIR=/home/user/openssl # export LINUX_DEPLOY_QT=/home/user/QtDeployment.appimage +# export LINUX_APPIMAGE_TOOL=/home/user/AppImageTool.appimage ARCHIVE_NAME_PREFIX=zano-linux-x64- @@ -98,28 +99,38 @@ cp -Rv ../../resources/app_icon.svg ./Zano/usr/share/icons/hicolor/scalable/apps cp -Rv ../../resources/app_icon_256.png ./Zano/usr/share/icons/hicolor/256x256/apps/Zano.png -echo "Exec=$prj_root/build/release/Zano/usr/bin/Zano --no-sandbox --deeplink-params=%u" >> ./Zano/usr/share/applications/Zano.desktop +echo "Exec=$prj_root/build/release/Zano/usr/bin/Zano" >> ./Zano/usr/share/applications/Zano.desktop if [ $? -ne 0 ]; then echo "Failed to append deskyop file" exit 1 fi -$LINUX_DEPLOY_QT ./Zano/usr/share/applications/Zano.desktop -appimage -qmake=$QT_PREFIX_PATH/bin/qmake +$LINUX_DEPLOY_QT ./Zano/usr/share/applications/Zano.desktop -qmake=$QT_PREFIX_PATH/bin/qmake if [ $? -ne 0 ]; then echo "Failed to run linuxqtdeployment" exit 1 fi -rm -f ./Zano-x86_64.AppImage +rm -f $prj_root/build/release/Zano/AppRun +cp -Rv ../../utils/Zano_appimage_wrapper.sh $prj_root/build/release/Zano/AppRun package_filename=${ARCHIVE_NAME_PREFIX}${version_str}.AppImage -pattern="*.AppImage" -files=( $pattern ) -app_image_file=${files[0]} +$LINUX_APPIMAGE_TOOL ./Zano ./$package_filename +if [ $? -ne 0 ]; then + echo "Failed to run appimagetool" + exit 1 +fi -mv ./$app_image_file ./$package_filename + + +#pattern="*.AppImage" +#files=( $pattern ) +#app_image_file=${files[0]} + + +#mv ./$app_image_file ./$package_filename echo "Build success"