From 8fa589e07302aa78940bb6e33c8825338a15bbce Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Nov 04 2016 14:42:31 +0000 Subject: fix compilation for linux --- diff --git a/build-all.sh b/build-all.sh index 03dc561..ed52d2b 100755 --- a/build-all.sh +++ b/build-all.sh @@ -1,8 +1,6 @@ #!/bin/bash -OLDDIR=`pwd` BASE_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" -"$BASE_DIR/update-opentoonz.sh" -"$BASE_DIR/update-synfigstudio.sh" +"$BASE_DIR/build-opentoonz-linux.sh" +"$BASE_DIR/build-synfigstudio-linux.sh" diff --git a/build-opentoonz-linux.sh b/build-opentoonz-linux.sh index 332f5e3..000b680 100755 --- a/build-opentoonz-linux.sh +++ b/build-opentoonz-linux.sh @@ -2,16 +2,10 @@ set -e -export IMAGE=build-debian-7 -export TASK=opentoonz-linux - -OLDDIR=`pwd` BASE_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" DATA_DIR="$BASE_DIR/docker-builder-data" BUILD_DIR=$DATA_DIR/build PUBLISH_DIR=$BASE_DIR/publish - CONFIG_FILE="$BASE_DIR/config.sh" PACKET_BUILD_DIR="$BUILD_DIR/packet" SCRIPT_BUILD_DIR="$BUILD_DIR/script" @@ -20,16 +14,16 @@ if [ -f $CONFIG_FILE ]; then fi run() { - export SCRIPT=$1 - export PLATFORM=$2 - export PLATFORM_SUFFIX=${ARCH}bit + local SCRIPT=$1 + local PLATFORM=$2 + local PLATFORM_SUFFIX=$3 echo "" echo "Update opentoonz for $PLATFORM_SUFFIX" echo "" - sudo $SCRIPT /build/script/common/manager.sh update opentoonz-master - sudo $SCRIPT /build/script/common/manager.sh clean_before_do install_release opentoonz-appimage + sudo $SCRIPT update opentoonz-master + sudo $SCRIPT clean_before_do install_release opentoonz-appimage local DIR="$PACKET_BUILD_DIR/$PLATFORM/opentoonz-appimage/install_release" local VERSION_FILE="$PACKET_BUILD_DIR/$PLATFORM/opentoonz-appimage/envdeps_release/version-opentoonz-master" local VERSION=`cat "$VERSION_FILE" | cut -d'-' -f 1` @@ -52,12 +46,5 @@ run() { fi } -if [ -z "$1" ] || [ -z "$2" ]; then -export ARCH=64 -run "$BASE_DIR/docker/run.sh" "linux-x64" -export ARCH=32 -run "$BASE_DIR/docker/run.sh" "linux-i386" -else -export ARCH=$2 -run "$BASE_DIR/docker/run.sh" "$1" -fi +run "$BASE_DIR/docker/debian-7-64bit/run.sh" "linux-x64" "64bits" +run "$BASE_DIR/docker/debian-7-32bit/run.sh" "linux-i386" "32bits" diff --git a/build-synfigstudio-linux.sh b/build-synfigstudio-linux.sh index c63b890..6dcfa92 100755 --- a/build-synfigstudio-linux.sh +++ b/build-synfigstudio-linux.sh @@ -2,12 +2,7 @@ set -e -export IMAGE=build-debian-7 -export TASK=synfig-linux - -OLDDIR=`pwd` BASE_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" DATA_DIR="$BASE_DIR/docker-builder-data" BUILD_DIR=$DATA_DIR/build PUBLISH_DIR=$BASE_DIR/publish @@ -20,18 +15,18 @@ if [ -f $CONFIG_FILE ]; then fi run() { - export SCRIPT=$1 - export PLATFORM=$2 - export PLATFORM_SUFFIX=${ARCH}bit + local SCRIPT=$1 + local PLATFORM=$2 + local PLATFORM_SUFFIX=$3 echo "" echo "Update synfigstudio for $PLATFORM_SUFFIX" echo "" - $SCRIPT /build/script/common/manager.sh update synfigetl-master - $SCRIPT /build/script/common/manager.sh update synfigcore-master - $SCRIPT /build/script/common/manager.sh update synfigstudio-master - $SCRIPT /build/script/common/manager.sh clean_before_do install_release synfigstudio-appimage + $SCRIPT update synfigetl-master + $SCRIPT update synfigcore-master + $SCRIPT update synfigstudio-master + $SCRIPT clean_before_do install_release synfigstudio-appimage local DIR="$PACKET_BUILD_DIR/$PLATFORM/synfigstudio-appimage/install_release" local VERSION_FILE="$PACKET_BUILD_DIR/$PLATFORM/synfigstudio-appimage/envdeps_release/version-synfigstudio-master" local VERSION=`cat "$VERSION_FILE" | cut -d'-' -f 1` @@ -42,7 +37,7 @@ run() { echo "Cannot find version, pheraps appimage not ready. Cancel." return 1 fi -if ! ls $PUBLISH_DIR/SynfigStudio-$VERSION-*-$COMMIT-$PLATFORM_SUFFIX.appimage 1> /dev/null 2>&1; then + if ! ls $PUBLISH_DIR/SynfigStudio-$VERSION-*-$COMMIT-$PLATFORM_SUFFIX.appimage 1> /dev/null 2>&1; then echo "Publish new version $VERSION-$COMMIT-$PLATFORM_SUFFIX" rm -f $PUBLISH_DIR/SynfigStudio-*-$PLATFORM_SUFFIX.appimage cp $DIR/synfigstudio.appimage $PUBLISH_DIR/SynfigStudio-$VERSION-$DATE-$COMMIT-$PLATFORM_SUFFIX.appimage @@ -54,12 +49,5 @@ if ! ls $PUBLISH_DIR/SynfigStudio-$VERSION-*-$COMMIT-$PLATFORM_SUFFIX.appimage 1 fi } -if [ -z "$1" ] || [ -z "$2" ]; then -export ARCH=64 -run "$BASE_DIR/docker/run.sh" "linux-x64" -export ARCH=32 -run "$BASE_DIR/docker/run.sh" "linux-i386" -else -export ARCH=$2 -run "$BASE_DIR/docker/run.sh" "$1" -fi +run "$BASE_DIR/docker/debian-7-64bit/run.sh" "linux-x64" "64bits" +run "$BASE_DIR/docker/debian-7-32bit/run.sh" "linux-i386" "32bits" diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index 16828fa..55a7e80 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -126,6 +126,9 @@ readdir() { if [ "$SUBFILE" = ".git" ]; then continue fi + if [[ "$SUBFILE" == *.po ]]; then + continue + fi local STAT=`stat -c%F:%a:%s "$FILE/$SUBFILE"` echo "$STAT:$SUBFILE" readdir "$FILE/$SUBFILE" diff --git a/docker-builder-data/build/script/include/inc-pkdownload-git.sh b/docker-builder-data/build/script/include/inc-pkdownload-git.sh index 152c4ce..a2e36be 100644 --- a/docker-builder-data/build/script/include/inc-pkdownload-git.sh +++ b/docker-builder-data/build/script/include/inc-pkdownload-git.sh @@ -5,13 +5,10 @@ pkdownload() { if [ -d "$DOWNLOAD_PACKET_DIR/$PK_DIRNAME/.git" ]; then - cd "$DOWNLOAD_PACKET_DIR/$PK_DIRNAME" + cd "$DOWNLOAD_PACKET_DIR/$PK_DIRNAME" || return 1 git fetch || return 1 - git stash || return 1 - git reset --hard origin/testing || return 1 + git reset --hard origin/$(git rev-parse --abbrev-ref HEAD) || return 1 else - if ! git clone "$PK_URL" $PK_GIT_OPTIONS; then - return 1 - fi + git clone "$PK_URL" $PK_GIT_OPTIONS || return 1 fi } diff --git a/docker-builder-data/build/script/packet/imagemagick-6.9.6.sh b/docker-builder-data/build/script/packet/imagemagick-6.9.6.sh index f218690..e778f60 100644 --- a/docker-builder-data/build/script/packet/imagemagick-6.9.6.sh +++ b/docker-builder-data/build/script/packet/imagemagick-6.9.6.sh @@ -1,6 +1,6 @@ DEPS="jpeg-9b png-1.6.25 tiff-4.0.6 xml-2.9.4 fftw-3.3.5" -PK_DIRNAME="ImageMagick-6.9.6-2" +PK_DIRNAME="ImageMagick-6.9.6-3" PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="http://www.imagemagick.org/download/$PK_ARCHIVE" diff --git a/docker/build.sh b/docker/build.sh deleted file mode 100755 index 73cf955..0000000 --- a/docker/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - -SCRIPT_DIR=$(cd `dirname "$0"`; pwd) - -${SCRIPT_DIR}/debian-7-64bit/build.sh -${SCRIPT_DIR}/debian-7-32bit/build.sh diff --git a/docker/debian-7-32bit/Dockerfile b/docker/debian-7-32bit/Dockerfile index 283eeac..261925d 100644 --- a/docker/debian-7-32bit/Dockerfile +++ b/docker/debian-7-32bit/Dockerfile @@ -1,4 +1,4 @@ -FROM my/debian-i386:wheezy +FROM morevna/debian-i386:wheezy ARG ALL_PROXY # Update diff --git a/docker/debian-7-32bit/build-base.sh b/docker/debian-7-32bit/build-base.sh index 9ce1c8d..a91561f 100755 --- a/docker/debian-7-32bit/build-base.sh +++ b/docker/debian-7-32bit/build-base.sh @@ -4,23 +4,25 @@ set -e arch=i386 suite=wheezy -docker_image="my/debian-$arch:$suite" +docker_image="morevna/debian-$arch:$suite" -OLDDIR=`pwd` SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" BASE_DIR=`dirname "$SCRIPT_DIR"` - +BASE_DIR=`dirname "$BASE_DIR"` CONFIG_FILE="$BASE_DIR/config.sh" if [ -f $CONFIG_FILE ]; then source $CONFIG_FILE fi +IMAGE_FILE="$SCRIPT_DIR/debian-$suite-$arch.tar.gz" +if [ ! -f "$IMAGE_FILE" ]; then + "$SCRIPT_DIR/build-tgz.sh" +fi + -if [ -f debian-$suite-$arch.tar.gz ]; then - docker import - $docker_image < debian-$suite-$arch.tar.gz +if [ -f "$IMAGE_FILE" ]; then + docker import - $docker_image < "$IMAGE_FILE" else - echo "File debian-$suite-$arch.tar.gz not found" - echo "You may try to create it by command ./build-tgz.sh" - echo "or download it from http://icystar.com/downloads/debian-wheezy-i386.tar.gz" + echo "File $IMAGE_FILE not found" + echo "You may try to create it by command $SCRIPT_DIR/build-tgz.sh" fi diff --git a/docker/debian-7-32bit/build-tgz.sh b/docker/debian-7-32bit/build-tgz.sh index edcfe71..fb799cd 100755 --- a/docker/debian-7-32bit/build-tgz.sh +++ b/docker/debian-7-32bit/build-tgz.sh @@ -7,6 +7,14 @@ suite=wheezy chroot_dir="/var/chroot/$suite" apt_mirror="ftp://ftp.debian.org/debian/" +SCRIPT_DIR=$(cd `dirname "$0"`; pwd) +BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` +CONFIG_FILE="$BASE_DIR/config.sh" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi + export DEBIAN_FRONTEND=noninteractive debootstrap --arch $arch $suite $chroot_dir $apt_mirror @@ -22,5 +30,5 @@ chroot $chroot_dir apt-get autoclean chroot $chroot_dir apt-get clean chroot $chroot_dir apt-get autoremove -tar cfz debian-$suite-$arch.tar.gz -C $chroot_dir . +tar cfz "$SCRIPT_DIR/debian-$suite-$arch.tar.gz" -C $chroot_dir . rm -rf $chroot_dir diff --git a/docker/debian-7-32bit/build.sh b/docker/debian-7-32bit/build.sh index 8f22c1d..fb371b3 100755 --- a/docker/debian-7-32bit/build.sh +++ b/docker/debian-7-32bit/build.sh @@ -1,9 +1,8 @@ #!/bin/bash -OLDDIR=`pwd` SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` CONFIG_FILE="$BASE_DIR/config.sh" PACKET_BUILD_DIR="$BUILD_DIR/packet" @@ -11,7 +10,6 @@ SCRIPT_BUILD_DIR="$BUILD_DIR/script" if [ -f $CONFIG_FILE ]; then source $CONFIG_FILE fi -export PACKET_BUILD_DIR mkdir -p $PACKET_BUILD_DIR docker build -t morevna/build-debian-7-32 $DOCKER_BUILD_OPTIONS "$SCRIPT_DIR" diff --git a/docker/debian-7-32bit/run.sh b/docker/debian-7-32bit/run.sh new file mode 100755 index 0000000..31d58e5 --- /dev/null +++ b/docker/debian-7-32bit/run.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname "$0"`; pwd) +BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` +DATA_DIR="$BASE_DIR/docker-builder-data" +BUILD_DIR=$DATA_DIR/build +CONFIG_FILE="$BASE_DIR/config.sh" +PACKET_BUILD_DIR="$BUILD_DIR/packet" +SCRIPT_BUILD_DIR="$BUILD_DIR/script" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi +mkdir -p $PACKET_BUILD_DIR + +docker stop "builder-i386" || true +docker rm "builder-i386" || true + +docker run -it \ + --name "builder-i386" \ + $DOCKER_RUN_OPTIONS \ + --privileged=true \ + -v "$PACKET_BUILD_DIR:/build/packet" \ + -v "$SCRIPT_BUILD_DIR:/build/script" \ + -e PLATFORM=linux-i386 \ + morevna/build-debian-7-32 \ + setarch i686 /build/script/common/manager.sh "$@" + diff --git a/docker/debian-7-64bit/build-base.sh b/docker/debian-7-64bit/build-base.sh index 008f91a..9f3e28f 100755 --- a/docker/debian-7-64bit/build-base.sh +++ b/docker/debian-7-64bit/build-base.sh @@ -6,21 +6,23 @@ arch=amd64 suite=wheezy docker_image="debian:7" -OLDDIR=`pwd` SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" BASE_DIR=`dirname "$SCRIPT_DIR"` - +BASE_DIR=`dirname "$BASE_DIR"` CONFIG_FILE="$BASE_DIR/config.sh" if [ -f $CONFIG_FILE ]; then source $CONFIG_FILE fi +IMAGE_FILE="$SCRIPT_DIR/debian-$suite-$arch.tar.gz" +if [ ! -f "$IMAGE_FILE" ]; then + "$SCRIPT_DIR/build-tgz.sh" +fi + -if [ -f debian-$suite-$arch.tar.gz ]; then - docker import - $docker_image < debian-$suite-$arch.tar.gz +if [ -f "$IMAGE_FILE" ]; then + docker import - $docker_image < "$IMAGE_FILE" else - echo "File debian-$suite-$arch.tar.gz not found" - echo "You may try to create it by command ./build-tgz.sh" - echo "or download it from http://icystar.com/downloads/debian-wheezy-i386.tar.gz" + echo "File $IMAGE_FILE not found" + echo "You may try to create it by command $SCRIPT_DIR/build-tgz.sh" fi diff --git a/docker/debian-7-64bit/build-tgz.sh b/docker/debian-7-64bit/build-tgz.sh index a42455f..5077de4 100755 --- a/docker/debian-7-64bit/build-tgz.sh +++ b/docker/debian-7-64bit/build-tgz.sh @@ -7,18 +7,14 @@ suite=wheezy chroot_dir="/var/chroot/$suite" apt_mirror="ftp://ftp.debian.org/debian/" -OLDDIR=`pwd` SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" BASE_DIR=`dirname "$SCRIPT_DIR"` - +BASE_DIR=`dirname "$BASE_DIR"` CONFIG_FILE="$BASE_DIR/config.sh" if [ -f $CONFIG_FILE ]; then source $CONFIG_FILE fi - -rm -rf $chroot_dir export DEBIAN_FRONTEND=noninteractive debootstrap --arch $arch $suite $chroot_dir $apt_mirror @@ -34,5 +30,5 @@ chroot $chroot_dir apt-get autoclean chroot $chroot_dir apt-get clean chroot $chroot_dir apt-get autoremove -tar cfz debian-$suite-$arch.tar.gz -C $chroot_dir . +tar cfz "$SCRIPT_DIR/debian-$suite-$arch.tar.gz" -C $chroot_dir . rm -rf $chroot_dir diff --git a/docker/debian-7-64bit/build.sh b/docker/debian-7-64bit/build.sh index 8b42466..c16624e 100755 --- a/docker/debian-7-64bit/build.sh +++ b/docker/debian-7-64bit/build.sh @@ -1,9 +1,8 @@ #!/bin/bash -OLDDIR=`pwd` SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` CONFIG_FILE="$BASE_DIR/config.sh" PACKET_BUILD_DIR="$BUILD_DIR/packet" diff --git a/docker/debian-7-64bit/run.sh b/docker/debian-7-64bit/run.sh new file mode 100755 index 0000000..90460c2 --- /dev/null +++ b/docker/debian-7-64bit/run.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname "$0"`; pwd) +BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` +DATA_DIR="$BASE_DIR/docker-builder-data" +BUILD_DIR=$DATA_DIR/build +CONFIG_FILE="$BASE_DIR/config.sh" +PACKET_BUILD_DIR="$BUILD_DIR/packet" +SCRIPT_BUILD_DIR="$BUILD_DIR/script" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi +mkdir -p $PACKET_BUILD_DIR + +docker stop "builder" || true +docker rm "builder" || true + +docker run -it \ + --name "builder" \ + --privileged=true \ + $DOCKER_RUN_OPTIONS \ + -v "$PACKET_BUILD_DIR:/build/packet" \ + -v "$SCRIPT_BUILD_DIR:/build/script" \ + morevna/build-debian-7-64 \ + /build/script/common/manager.sh "$@" + diff --git a/docker/fedora-cross-win/build.sh b/docker/fedora-cross-win/build.sh index 06b700b..d75bff4 100755 --- a/docker/fedora-cross-win/build.sh +++ b/docker/fedora-cross-win/build.sh @@ -1,5 +1,16 @@ #!/bin/bash -PREFIX=`dirname "$0"` -cd $PREFIX -docker build -t morevna/build-fedora-cross-win . +SCRIPT_DIR=$(cd `dirname "$0"`; pwd) +BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` + +CONFIG_FILE="$BASE_DIR/config.sh" +PACKET_BUILD_DIR="$BUILD_DIR/packet" +SCRIPT_BUILD_DIR="$BUILD_DIR/script" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi +export PACKET_BUILD_DIR +mkdir -p $PACKET_BUILD_DIR + +docker build -t morevna/build-fedora-cross-win $DOCKER_BUILD_OPTIONS "$SCRIPT_DIR"