|
|
cf6cd8 |
#!/bin/bash
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
set -e
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
export IMAGE=build-fedora-cross-win
|
|
|
cf6cd8 |
export TASK=synfig-linux
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
OLDDIR=`pwd`
|
|
|
cf6cd8 |
BASE_DIR=$(cd `dirname "$0"`; pwd)
|
|
|
cf6cd8 |
cd "$OLDDIR"
|
|
|
cf6cd8 |
DATA_DIR="$BASE_DIR/docker-builder-data"
|
|
|
cf6cd8 |
BUILD_DIR=$DATA_DIR/build
|
|
|
cf6cd8 |
PUBLISH_DIR=$BASE_DIR/publish
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
CONFIG_FILE="$BASE_DIR/config.sh"
|
|
|
cf6cd8 |
PACKET_BUILD_DIR="$BUILD_DIR/packet"
|
|
|
cf6cd8 |
SCRIPT_BUILD_DIR="$BUILD_DIR/script"
|
|
|
cf6cd8 |
if [ -f $CONFIG_FILE ]; then
|
|
|
cf6cd8 |
source $CONFIG_FILE
|
|
|
cf6cd8 |
fi
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
run() {
|
|
|
cf6cd8 |
export SCRIPT="$BASE_DIR/docker/run.sh"
|
|
|
cf6cd8 |
export PLATFORM=win-${ARCH}
|
|
|
cf6cd8 |
export PLATFORM_SUFFIX=${ARCH}bit
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
echo ""
|
|
|
cf6cd8 |
echo "Update synfigstudio for ${PLATFORM}"
|
|
|
cf6cd8 |
echo ""
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
$SCRIPT /build/script/common/manager.sh update synfigstudio-master
|
|
|
cf6cd8 |
# QUICK HACK:
|
|
|
cf6cd8 |
$SCRIPT /build/packet/${PLATFORM}/synfigstudio-master/download/synfig/autobuild/fedora-crosscompile-win.sh
|
|
|
cf6cd8 |
local DIR="$PACKET_BUILD_DIR/$PLATFORM/synfigstudio-appimage/install_release"
|
|
|
cf6cd8 |
local VERSION_FILE="$PACKET_BUILD_DIR/$PLATFORM/synfigstudio-appimage/envdeps_release/version-synfigstudio-master"
|
|
|
cf6cd8 |
local VERSION=`cat "$VERSION_FILE" | cut -d'-' -f 1`
|
|
|
cf6cd8 |
local COMMIT=`cat "$VERSION_FILE" | cut -d'-' -f 2-`
|
|
|
cf6cd8 |
COMMIT="${COMMIT:0:5}"
|
|
|
cf6cd8 |
local DATE=`date -u +%Y.%m.%d`
|
|
|
cf6cd8 |
if [ -z "$COMMIT" ]; then
|
|
|
cf6cd8 |
echo "Cannot find version, pheraps appimage not ready. Cancel."
|
|
|
cf6cd8 |
return 1
|
|
|
cf6cd8 |
fi
|
|
|
cf6cd8 |
if ! ls $PUBLISH_DIR/SynfigStudio-$VERSION-*-$COMMIT-$PLATFORM_SUFFIX.appimage 1> /dev/null 2>&1; then
|
|
|
cf6cd8 |
echo "Publish new version $VERSION-$COMMIT-$PLATFORM_SUFFIX"
|
|
|
cf6cd8 |
rm -f $PUBLISH_DIR/SynfigStudio-*-$PLATFORM_SUFFIX.appimage
|
|
|
cf6cd8 |
cp $DIR/synfigstudio.appimage $PUBLISH_DIR/SynfigStudio-$VERSION-$DATE-$COMMIT-$PLATFORM_SUFFIX.appimage
|
|
|
cf6cd8 |
if [ -f "$PUBLISH_DIR/publish-synfigstudio.sh" ]; then
|
|
|
cf6cd8 |
"$PUBLISH_DIR/publish-synfigstudio.sh" "$PUBLISH_DIR/SynfigStudio-$VERSION-$DATE-$COMMIT-$PLATFORM_SUFFIX.appimage"
|
|
|
cf6cd8 |
fi
|
|
|
cf6cd8 |
else
|
|
|
cf6cd8 |
echo "Version $VERSION-$COMMIT-$PLATFORM_SUFFIX already published"
|
|
|
cf6cd8 |
fi
|
|
|
cf6cd8 |
}
|
|
|
cf6cd8 |
|
|
|
cf6cd8 |
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
|
cf6cd8 |
export ARCH=64
|
|
|
cf6cd8 |
run
|
|
|
cf6cd8 |
export ARCH=32
|
|
|
cf6cd8 |
run
|
|
|
cf6cd8 |
else
|
|
|
cf6cd8 |
export ARCH=$2
|
|
|
cf6cd8 |
run
|
|
|
cf6cd8 |
fi
|