2023-08-03 00:30:24 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
function readlink() {
|
|
|
|
echo "$(cd "$(dirname "$1")"; pwd -P)"
|
|
|
|
}
|
|
|
|
|
|
|
|
root_dir="$(dirname "$(dirname "$(readlink "$0")")")"
|
|
|
|
multiplatform_dir=$root_dir/apps/multiplatform
|
|
|
|
release_app_dir=$root_dir/apps/multiplatform/release/main/app
|
|
|
|
|
|
|
|
cd $multiplatform_dir
|
2023-10-05 00:06:23 +08:00
|
|
|
libcrypto_path=$(ldd common/src/commonMain/cpp/desktop/libs/*/libHSdirect-sqlcipher-*.so | grep libcrypto | cut -d'=' -f 2 | cut -d ' ' -f 2)
|
|
|
|
trap "rm common/src/commonMain/cpp/desktop/libs/*/`basename $libcrypto_path` 2> /dev/null || true" EXIT
|
|
|
|
cp $libcrypto_path common/src/commonMain/cpp/desktop/libs/*
|
2023-08-03 00:30:24 +03:00
|
|
|
|
|
|
|
./gradlew createDistributable
|
2023-10-05 00:06:23 +08:00
|
|
|
rm common/src/commonMain/cpp/desktop/libs/*/`basename $libcrypto_path`
|
2023-08-03 00:30:24 +03:00
|
|
|
|
|
|
|
rm -rf $release_app_dir/AppDir 2>/dev/null
|
|
|
|
mkdir -p $release_app_dir/AppDir/usr
|
|
|
|
|
|
|
|
cd $release_app_dir/AppDir
|
|
|
|
cp -r ../*imple*/{bin,lib} usr
|
|
|
|
cp usr/lib/simplex.png .
|
|
|
|
|
|
|
|
# For https://github.com/TheAssassin/AppImageLauncher to be able to show the icon
|
2023-09-21 20:19:24 +08:00
|
|
|
mkdir -p usr/share/{icons,metainfo,applications}
|
2023-08-03 00:30:24 +03:00
|
|
|
cp usr/lib/simplex.png usr/share/icons
|
|
|
|
|
|
|
|
ln -s usr/bin/*imple* AppRun
|
2023-09-21 20:19:24 +08:00
|
|
|
cp $multiplatform_dir/desktop/src/jvmMain/resources/distribute/*imple*.desktop chat.simplex.app.desktop
|
2023-08-03 00:30:24 +03:00
|
|
|
sed -i 's|Exec=.*|Exec=simplex|g' *imple*.desktop
|
|
|
|
sed -i 's|Icon=.*|Icon=simplex|g' *imple*.desktop
|
2023-09-21 20:19:24 +08:00
|
|
|
cp *imple*.desktop usr/share/applications/
|
|
|
|
cp $multiplatform_dir/desktop/src/jvmMain/resources/distribute/*.appdata.xml usr/share/metainfo
|
2023-08-03 00:30:24 +03:00
|
|
|
|
|
|
|
if [ ! -f ../appimagetool-x86_64.AppImage ]; then
|
2024-01-17 15:23:43 +00:00
|
|
|
wget --secure-protocol=TLSv1_3 https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O ../appimagetool-x86_64.AppImage
|
2023-08-03 00:30:24 +03:00
|
|
|
chmod +x ../appimagetool-x86_64.AppImage
|
|
|
|
fi
|
2024-12-10 18:09:01 +07:00
|
|
|
if [ ! -f ../runtime-x86_64 ]; then
|
|
|
|
wget --secure-protocol=TLSv1_3 https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64 -O ../runtime-x86_64
|
|
|
|
chmod +x ../runtime-x86_64
|
2024-08-02 17:34:04 +09:00
|
|
|
fi
|
2024-12-10 18:09:01 +07:00
|
|
|
../appimagetool-x86_64.AppImage --runtime-file ../runtime-x86_64 .
|
2023-08-03 00:30:24 +03:00
|
|
|
|
|
|
|
mv *imple*.AppImage ../../
|