learn-hieroglyphs/pack_appimage.sh

39 lines
875 B
Bash
Executable File

#!/bin/bash
if ! command -v appimagetool &> /dev/null
then
echo "No appimage tool installed. Please, install it."
exit 1
fi
cargo build --release
#Copying binary
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
#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
chmod +x AppImage/AppRun
ARCH=x86_64 appimagetool AppImage learn-hieroglyph.AppImage