Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Automatically build key portions of AppImageKit #13

Merged
merged 2 commits into from
Apr 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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.
55 changes: 48 additions & 7 deletions hammer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ function show_help()
echo "Usage: hammer.sh install-deps <dependency to install>"
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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion support/linux_AppDir_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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####
Expand Down Expand Up @@ -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*
Expand All @@ -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