build.sh: add option to create appdir

This makes it easier to create an AppImage from the build artifacts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-11-05 11:55:52 -08:00
parent 138f0255f8
commit 6ce4239884

View file

@ -55,6 +55,10 @@ while [[ $# -gt 0 ]] ; do
BUILD_MOBILE="1" BUILD_MOBILE="1"
BUILD_DESKTOP="1" BUILD_DESKTOP="1"
;; ;;
-create-appdir)
# we are building an AppImage as by product
CREATE_APPDIR="1"
;;
*) *)
echo "Unknown command line argument $arg" echo "Unknown command line argument $arg"
;; ;;
@ -485,4 +489,15 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
LIBRARY_PATH=$INSTALL_ROOT/lib make -j4 LIBRARY_PATH=$INSTALL_ROOT/lib make -j4
LIBRARY_PATH=$INSTALL_ROOT/lib make install LIBRARY_PATH=$INSTALL_ROOT/lib make install
if [ "$CREATE_APPDIR" = "1" ] ; then
# if we create an AppImage this makes gives us a sane starting point
cd $SRC
mkdir -p ./appdir
mkdir -p appdir/usr/share/metainfo
mkdir -p appdir/usr/share/icons/hicolor/256x256/apps
cp -r ./install-root/* ./appdir/usr
cp subsurface/appdata/subsurface.appdata.xml appdir/usr/share/metainfo/
cp subsurface/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/
fi
done done