learn-hieroglyphs/pack_appimage.sh

39 lines
875 B
Bash
Raw Normal View History

2024-05-03 18:00:03 +03:00
#!/bin/bash
if ! command -v appimagetool &> /dev/null
then
echo "No appimage tool installed. Please, install it."
exit 1
fi
cargo build --release
2024-05-03 18:57:26 +03:00
#Copying binary
2024-05-03 18:00:03 +03:00
mkdir -p AppImage/usr/bin
mkdir -p AppImage/usr/share/glib-2.0/schemas
cp resources/gschemas.compiled AppImage/usr/share/glib-2.0/schemas/ # Copy settings
cp target/release/learn-hieroglyph AppImage/usr/bin
2024-05-03 18:57:26 +03:00
#Copying libraries
libraries=`ldd target/release/learn-hieroglyph | grep so \
| sed -e '/^[^\t]/ d' \
| sed -e 's/\t//' \
| sed -e 's/.*=..//' \
| sed -e 's/ (0.*)//' `
libraries_arr=($libraries)
#creating necessary directories
for library in ${libraries_arr[@]}
do
mkdir -p AppImage/`dirname $library`
done
#copying libraries
for library in ${libraries_arr[@]}
do
cp $library AppImage/`dirname $library`
done
2024-05-03 18:00:03 +03:00
chmod +x AppImage/AppRun
ARCH=x86_64 appimagetool AppImage learn-hieroglyph.AppImage