diff --git a/.gitignore b/.gitignore index d8fe4fa..97ac6e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /.project +/config.sh diff --git a/config.sh.blank b/config.sh.blank new file mode 100644 index 0000000..5b9c145 --- /dev/null +++ b/config.sh.blank @@ -0,0 +1 @@ +# PACKET_BUILD_DIR=/data/builder \ No newline at end of file diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index 2ac621d..8d0cb01 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -29,6 +29,10 @@ export INCLUDE_SCRIPT_DIR=$SCRIPT_DIR/include export PACKET_SCRIPT_DIR=$SCRIPT_DIR/packet export PACKET_DIR=$ROOT_DIR/packet/$PLATFORM +if [ ! -z $PACKET_BUILD_DIR ]; then + export PACKET_DIR=$PACKET_BUILD_DIR/$PLATFORM +fi + # vars INITIAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH @@ -103,7 +107,7 @@ set_done() { } set_undone_silent() { - rm -f "$PACKET_DIR/$1/$2.*.done" + rm -f $PACKET_DIR/$1/$2.*.done rm -f "$PACKET_DIR/$1/$2.done" } @@ -117,7 +121,7 @@ clean_packet_directory_silent() { return 0 fi set_undone_silent $1 $2 - rm -f -r "$PACKET_DIR/$1/$2" + rm -rf "$PACKET_DIR/$1/$2" } clean_packet_directory() { @@ -422,6 +426,16 @@ clean() { clean_env_release $1 } +clean_all_install() { + clean_envdeps $1 + clean_build $1 + clean_install $1 + clean_env $1 + clean_install_release $1 + clean_envdeps_release $1 + clean_env_release $1 +} + ############# set_undone_download() { diff --git a/docker-builder-data/build/script/packet/opentoonz-master.sh b/docker-builder-data/build/script/packet/opentoonz-master.sh index abe730b..5db1998 100644 --- a/docker-builder-data/build/script/packet/opentoonz-master.sh +++ b/docker-builder-data/build/script/packet/opentoonz-master.sh @@ -40,7 +40,8 @@ pkbuild() { set_done $NAME build.configure fi - if ! make; then + # making in single thread is too slow, but life is too short... + if ! (make -j${THREADS} || make -j${THREADS} || make); then return 1 fi } diff --git a/docker-builder-data/build/script/packet/qt-5.7.sh b/docker-builder-data/build/script/packet/qt-5.7.sh index d4bdd19..e4fc904 100644 --- a/docker-builder-data/build/script/packet/qt-5.7.sh +++ b/docker-builder-data/build/script/packet/qt-5.7.sh @@ -17,7 +17,8 @@ pkbuild() { set_done $NAME build.cunfigure fi - if ! make; then + # making in single thread is too slow, but life is too short... + if ! (make -j${THREADS} || make -j${THREADS} || make); then return 1 fi } @@ -28,7 +29,8 @@ pkinstall() { return 1 fi - if ! cp -f "/lib/x86_64-linux-gnu/libudev.so.0" "$INSTALL_PACKET_DIR/lib/libudev.so.0"; then + if ! (cp -f "/lib/x86_64-linux-gnu/libudev.so.0" "$INSTALL_PACKET_DIR/lib/libudev.so.0" \ + || cp -f "/lib/i386-linux-gnu/libudev.so.0" "$INSTALL_PACKET_DIR/lib/libudev.so.0"); then return 1 fi diff --git a/docker-builder-i386/Dockerfile b/docker-builder-i386/Dockerfile index 3091dee..8ccdcee 100644 --- a/docker-builder-i386/Dockerfile +++ b/docker-builder-i386/Dockerfile @@ -89,3 +89,5 @@ RUN apt-get -yq install ratfor RUN apt-get -yq install csh RUN apt-get -yq install libxcb-xinerama0-dev RUN apt-get -yq install xsltproc + +CMD mkdir /build \ No newline at end of file diff --git a/docker-builder-i386/run.sh b/docker-builder-i386/run.sh index 3f422b8..018f895 100755 --- a/docker-builder-i386/run.sh +++ b/docker-builder-i386/run.sh @@ -10,9 +10,19 @@ BUILD_DIR=$DATA_DIR/build docker stop "builder-i386" || true docker rm "builder-i386" || true +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 run -it \ --name "builder-i386" \ - -v "$BUILD_DIR:/build" \ + -v "$PACKET_BUILD_DIR:/build/packet" \ + -v "$SCRIPT_BUILD_DIR:/build/script" \ -e PLATFORM=linux-i386 \ my/builder-i386 \ /build/script/common/manager.sh "$@" diff --git a/docker-builder/Dockerfile b/docker-builder/Dockerfile index 377df11..eb8ca6f 100644 --- a/docker-builder/Dockerfile +++ b/docker-builder/Dockerfile @@ -56,3 +56,4 @@ RUN apt-get -yq install libxcb-xinerama0-dev RUN apt-get -yq install xsltproc RUN apt-get -yq install libudev-dev +CMD mkdir /build \ No newline at end of file diff --git a/docker-builder/run.sh b/docker-builder/run.sh index 55bdabf..64c5f17 100755 --- a/docker-builder/run.sh +++ b/docker-builder/run.sh @@ -10,9 +10,19 @@ BUILD_DIR=$DATA_DIR/build docker stop "builder" || true docker rm "builder" || true +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 run -it \ --name "builder" \ - -v "$BUILD_DIR:/build" \ + -v "$PACKET_BUILD_DIR:/build/packet" \ + -v "$SCRIPT_BUILD_DIR:/build/script" \ my/builder \ /build/script/common/manager.sh "$@" diff --git a/run-native.sh b/run-native.sh index 09ef3f3..51648d3 100755 --- a/run-native.sh +++ b/run-native.sh @@ -3,7 +3,15 @@ SCRIPT_FILE=`realpath "$0"` BASE_DIR=`dirname "$SCRIPT_FILE"` DATA_DIR="$BASE_DIR/docker-builder-data" - BUILD_DIR=$DATA_DIR/build -$BUILD_DIR/script/common/manager.sh "$@" +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 + +$SCRIPT_BUILD_DIR/common/manager.sh "$@"