Properly create AppImage

This commit is contained in:
inori-z 2019-10-22 00:00:31 -07:00
parent fe77b40d28
commit de44811e12
2 changed files with 40 additions and 4 deletions

0
linux/copy_dependencies.sh Normal file → Executable file
View file

44
linux/make_appimg.sh Normal file → Executable file
View file

@ -1,5 +1,41 @@
BINNAME=$1
APPIMGKIT=$2
#!/bin/bash
# Author : Hemanth.HM
# Email : hemanth[dot]hm[at]gmail[dot]com
# License : GNU GPLv3
#
exec("./copy_dependencies.sh $BINNAME ${MESON_INSTALL_PREFIX}/usr/lib")
$APPIMGKIT ${MESON_INSTALL_PREFIX} ${MESON_BUILD_ROOT}
function useage()
{
cat << EOU
Useage: bash $0 <path to the binary> <path to copy the dependencies>
EOU
exit 1
}
INSTALLDIR=${MESON_INSTALL_PREFIX}/usr/lib
#Validate the inputs
[[ $# < 2 ]] && useage
#Check if the paths are vaild
[[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1
[[ -d $2 ]] || echo "No such directory $INSTALLDIR creating..."&& mkdir -p "$INSTALLDIR"
#Get the library dependencies
echo "Collecting the shared library dependencies for $1..."
deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1\
~/^\//{print $1}$3~/^\//{print $3}'\
| sed 's/,$/\n/')
echo "Copying the dependencies to $INSTALLDIR"
#Copy the deps
for dep in $deps
do
echo "Copying $dep to $INSTALLDIR"
cp "$dep" "$INSTALLDIR"
done
echo $PWD
cp ${MESON_INSTALL_PREFIX}/share/mkxp-z/* ${MESON_INSTALL_PREFIX}
rm -rf ${MESON_INSTALL_PREFIX}/share
$2 ${MESON_INSTALL_PREFIX}