From de44811e12cd6f8026f1c08cae2b4f32110535e5 Mon Sep 17 00:00:00 2001 From: inori-z Date: Tue, 22 Oct 2019 00:00:31 -0700 Subject: [PATCH] Properly create AppImage --- linux/copy_dependencies.sh | 0 linux/make_appimg.sh | 44 ++++++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) mode change 100644 => 100755 linux/copy_dependencies.sh mode change 100644 => 100755 linux/make_appimg.sh diff --git a/linux/copy_dependencies.sh b/linux/copy_dependencies.sh old mode 100644 new mode 100755 diff --git a/linux/make_appimg.sh b/linux/make_appimg.sh old mode 100644 new mode 100755 index 15802ff3..52caeb49 --- a/linux/make_appimg.sh +++ b/linux/make_appimg.sh @@ -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 +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}