diff --git a/README b/README index 07ade4b..7ca8d1e 100644 --- a/README +++ b/README @@ -4,7 +4,3 @@ Tool for installing deps, checking out source, and compiling the application. Execute hammer.sh for help. All build artifacts are placed in the "work" directory. - -Note: If you are building an AppImage, these scripts assumes that the -AppImageKit source directory is installed in the same parent directory -that the hammer directory is installed in. diff --git a/hammer.sh b/hammer.sh index 38edb7b..6bee8a6 100755 --- a/hammer.sh +++ b/hammer.sh @@ -170,11 +170,12 @@ function show_help() echo "Usage: hammer.sh install-deps " echo "Dependencies Available:" echo " all - install all dependencies listed below" - echo " cegui - a free library providing windowing and widgets for " + echo " cegui - a free library providing windowing and widgets for" echo " graphics APIs / engines" echo " ogre - 3D rendering engine" + echo " Hint: build ogre first then cegui" echo " cg - interactive effects toolkit" - echo "Hint: build ogre first then cegui" + echo " appimage - application packaging system" elif [ $1 = "checkout" ] ; then echo "Fetch latest source code for worldforge libraries and clients." echo "If you want Hammer to stash away any local changes, use the" @@ -408,6 +409,41 @@ function install_deps_CEGUI() echo " Done." } +function install_deps_AppImageKit() +{ + # AppImageKit + echo " Installing core AppImageKit functionality..." + mkdir -p $LOGDIR/deps/AppImageKit # create AppImageKit log directory + cd $DEPS_SOURCE + if [ ! -d "AppImageKit" ] ; then + echo " Downloading..." + mkdir AppImageKit && cd AppImageKit + curl -OL https://raw.github.com/probonopd/AppImageKit/master/CMakeLists.txt + curl -OL https://raw.github.com/probonopd/AppImageKit/master/AppRun.c + curl -OL https://raw.github.com/probonopd/AppImageKit/master/fuseiso.c + curl -OL https://raw.github.com/probonopd/AppImageKit/master/isofs.c + curl -OL https://raw.github.com/probonopd/AppImageKit/master/isofs.h + curl -OL https://raw.github.com/probonopd/AppImageKit/master/md5.c + curl -OL https://raw.github.com/probonopd/AppImageKit/master/md5.h + curl -OL https://raw.github.com/probonopd/AppImageKit/master/runtime.c + mkdir linux && cd linux + curl -OL https://raw.github.com/probonopd/AppImageKit/master/linux/iso_fs.h + curl -OL https://raw.github.com/probonopd/AppImageKit/master/linux/rock.h + fi + mkdir -p $DEPS_BUILD/AppImageKit + cd $DEPS_BUILD/AppImageKit + curl -OL https://raw.github.com/probonopd/AppImageKit/master/AppImageAssistant.AppDir/package + curl -OL https://raw.github.com/probonopd/AppImageKit/master/AppImageAssistant.AppDir/xdgappdir.py + echo " Configuring..." + cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" $CMAKE_EXTRA_FLAGS $DEPS_SOURCE/AppImageKit &> $LOGDIR/deps/AppImageKit/$CONFIGLOG + echo " Building..." + make $MAKEOPTS AppRun &> $LOGDIR/deps/AppImageKit/${MAKELOG}_AppRun + make $MAKEOPTS runtime &> $LOGDIR/deps/AppImageKit/${MAKELOG}_runtime + echo " Installing..." + echo "Installed." > $LOGDIR/deps/AppImageKit/$INSTALLLOG + echo " Done." +} + function ember_fetch_media() { if [ $1 = "dev" ] ; then @@ -494,6 +530,11 @@ elif [ "$1" = "install-deps" ] ; then install_deps_CEGUI fi + # AppImageKit + if [ "$2" = "appimage" ] ; then + install_deps_AppImageKit + fi + echo "Install of 3rd party dependencies is complete." # Source checkout @@ -864,21 +905,21 @@ elif [ "$1" = "release_ember" ] ; then # making an AppImage/AppBundle if [[ $OSTYPE == *darwin* ]] ; then echo "Creating AppBundle." - . $HAMMERDIR/support/AppBundler.sh + source $HAMMERDIR/support/AppBundler.sh echo "AppBundle creation complete." else echo "Creating AppImage." - mkdir -p $LOGDIR/AppImage/ - . $HAMMERDIR/support/linux_AppDir_create.sh 2>&1 | tee $LOGDIR/AppImage/AppDir.log + install_deps_AppImageKit + source $HAMMERDIR/support/linux_AppDir_create.sh &> $LOGDIR/deps/AppImageKit/AppDir.log echo "AppImage will be created from the AppDir at $APP_DIR_ROOT and placed into $WORKDIR." - python $HAMMERDIR/../AppImageKit/AppImageAssistant.AppDir/package $APP_DIR_ROOT $WORKDIR/ember-${2}-x86_$BUILDDIR create new 2>&1 | tee $LOGDIR/AppImage/AppImage.log + python $DEPS_BUILD/AppImageKit/package $APP_DIR_ROOT $WORKDIR/ember-${2}-x86_$BUILDDIR create new &> $LOGDIR/deps/AppImageKit/AppImage.log echo "AppImage creation complete." fi else # making a standard directory echo "Creating release directory." cd $HAMMERDIR - . $HAMMERDIR/support/linux_release_bundle.sh + source $HAMMERDIR/support/linux_release_bundle.sh echo "Release directory created." fi diff --git a/support/linux_AppDir_create.sh b/support/linux_AppDir_create.sh index 0c7f86a..2d0f27c 100755 --- a/support/linux_AppDir_create.sh +++ b/support/linux_AppDir_create.sh @@ -20,7 +20,7 @@ cd $APP_DIR_ROOT curl -OL https://raw.github.com/worldforge/ember/master/ember.desktop curl -OL https://raw.github.com/worldforge/ember/master/media/ember.png cp -a "ember.png" ".DirIcon" -cp $HAMMERDIR/../AppImageKit/AppRun . +cp $DEPS_BUILD/AppImageKit/AppRun . ####Adapted from linux_release_bundle.sh#### @@ -146,6 +146,9 @@ fi # Manually add and remove libraries which don't behave appropriately. +# Some libraries may not be present. If they are not present, continue processing. +set +e + rm $APP_DIR/lib/ld-linux* rm $APP_DIR/lib/libc.so* rm $APP_DIR/lib/libdl.so* @@ -158,5 +161,8 @@ rm $APP_DIR/lib/librt.so* rm $APP_DIR/lib/librtmp.so* rm $APP_DIR/lib/libX11.so* +# Resume exit-on-fail behavior. +set -e + cp -d $PREFIX/lib/libCEGUI* $APP_DIR/lib cp -r $PREFIX/lib/cegui* $APP_DIR/lib