diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index 14aae38..9a8fe1c 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -1,23 +1,54 @@ #!/bin/bash -# options +############################################### +# +# Input environment variables +# +# PLATFORM - target platform (linux or windows) +# ARCH - bits (32 or 64) +# NATIVE_PLATFORM - folder name for store compiled utilities for build-time (debian, fedora, etc) +# NATIVE_ARCH - ^^^ bits (32 or 64) +# THREADS - amount of simultaneous threads for build process +# PACKET_BUILD_DIR - output directory (optional) +# +############################################### -if [ -z "$PLATFORM" ]; then - PLATFORM="linux-x64" +# check options + +if [ -z "$NATIVE_PLATFORM" ]; then + NATIVE_PLATFORM="default" +fi + +if [ -z "$NATIVE_ARCH" ]; then + NATIVE_ARCH=`uname -m` + if [ "$NATIVE_ARCH" = "x86_64" ]; then + NATIVE_ARCH="64" + elif [ "$NATIVE_ARCH" = "i686" ]; then + NATIVE_ARCH="32" + fi +fi + +if [ -z "$TARGET_PLATFORM" ]; then + TARGET_PLATFORM="$NATIVE_PLATFORM" +fi + +if [ -z "$ARCH" ]; then + ARCH="$NATIVE_ARCH" fi -export PLATFORM if [ -z "$THREADS" ]; then - THREADS=8 + THREADS=8 fi -export THREADS +export NATIVE_PLATFORM +export NATIVE_ARCH +export PLATFORM +export ARCH +export THREADS # root -OLDDIR=`pwd` ROOT_DIR=$(cd `dirname "$0"`; pwd) -cd "$OLDDIR" ROOT_DIR=`dirname "$ROOT_DIR"` ROOT_DIR=`dirname "$ROOT_DIR"` export ROOT_DIR @@ -28,23 +59,28 @@ export SCRIPT_DIR=$ROOT_DIR/script export COMMON_SCRIPT_DIR=$SCRIPT_DIR/common 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 +if [ -z "$PACKET_BUILD_DIR" ]; then + export PACKET_BUILD_DIR=$ROOT_DIR/packet fi +export PACKET_DIR=$PACKET_BUILD_DIR/$PLATFORM-$ARCH +export NATIVE_PACKET_DIR=$PACKET_BUILD_DIR/$NATIVE_PLATFORM-$NATIVE_ARCH-native # toolchain -if [ -f "$COMMON_SCRIPT_DIR/toolchain-$PLATFORM.sh" ]; then - echo "use toolchain $PLATFORM" - source "$COMMON_SCRIPT_DIR/toolchain-$PLATFORM.sh" || exit 1 +export TOOLCHAIN_SCRIPT_DIR=$SCRIPT_DIR/toolchain +export NATIVE_TOOLCHAIN_SCRIPT="$TOOLCHAIN_SCRIPT_DIR/none.sh" +export TOOLCHAIN_SCRIPT="$TOOLCHAIN_SCRIPT_DIR/$PLATFORM-$ARCH.sh" +if [ ! -f "$TOOLCHAIN_SCRIPT" ]; then + TOOLCHAIN_SCRIPT=$NATIVE_TOOLCHAIN_SCRIPT fi -# vars +# initial system vars -INITIAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH +INITIAL_HOST=$HOST INITIAL_PATH=$PATH +INITIAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH +INITIAL_CC=$CC +INITIAL_CXX=$CXX INITIAL_LDFLAGS=$LDFLAGS INITIAL_CFLAGS=$CFLAGS INITIAL_CPPFLAGS=$CPPFLAGS @@ -53,14 +89,16 @@ INITIAL_PKG_CONFIG_PATH=$PKG_CONFIG_PATH INITIAL_XDG_DATA_DIRS=$XDG_DATA_DIRS INITIAL_ACLOCAL_PATH=$ACLOCAL_PATH +# work vars + +IS_NATIVE= DRY_RUN= FORCE= CLEAN_BEFORE_DO= NO_CHECK_DEPS= declare -A COMPLETION_STATUS - -################################### +############################################### # # Fairy Tale # @@ -68,57 +106,75 @@ declare -A COMPLETION_STATUS # # Function dependency: # -# 1. download -# | -# 2. unpack -# | -# | env^ -# | | -# 3. | envdeps -# | | | | -# 4. build | | -# | | | -# 5. install | -# | | | -# 6. | env -# | | -# | envdeps* -# | -# | env_release^ -# | | -# 7. | envdeps_release -# | | | -# 8. install_release | -# | | -# 9. env_release -# | -# envdeps_release* +# 1. download +# | +# 2. unpack +# | +# | env^ +# | | +# 3. | envdeps +# | | | | +# env^^ | | | | +# | | | | | +# | env_native^ | | | | +# | | | | | | +# 4. envdeps_native | | | | +# | | | | | | | +# 5. | | build | | +# | | | | | +# 6. | --install | +# | | | | +# 7. | | env +# | | | | +# | | | envdeps* +# | | | +# | | envdeps_native** +# | | +# 8. env_native | +# | | +# envdeps_native* | +# | +# | env_release^ +# | | +# 9. | envdeps_release +# | | | +# 10. install_release | +# | | +# 11. env_release +# | +# envdeps_release* # -################################### +############################################### FUNC_DEPS_download="" FUNC_DEPS_unpack="download" FUNC_DEPS_envdeps="-env" -FUNC_DEPS_build="envdeps unpack" -FUNC_DEPS_install="envdeps build" +FUNC_DEPS_envdeps_native="--env -env_native" +FUNC_DEPS_build="envdeps envdeps_native unpack" +FUNC_DEPS_install="envdeps envdeps_native build" FUNC_DEPS_env="envdeps install" +FUNC_DEPS_env_native="envdeps_native" FUNC_DEPS_envdeps_release="-env_release" FUNC_DEPS_install_release="envdeps_release install" FUNC_DEPS_env_release="envdeps_release install_release" +# helpers + copy() { - if [ -d "$1" ]; then - if ! mkdir -p $2; then + local SRC=$1 + local DEST=$2 + if [ -d "$SRC" ]; then + if ! mkdir -p $DEST; then return 1 fi if [ "$(ls -A $1)" ]; then - if ! cp --remove-destination -rlP $1/* "$2/"; then + if ! cp --remove-destination -rlP $SRC/* "$DEST/"; then return 1 fi fi - elif [ -f "$1" ]; then - if ! (mkdir -p `dirname $2` && cp --remove-destination -l "$1" "$2"); then + elif [ -f "$SRC" ]; then + if ! (mkdir -p `dirname $DEST` && cp --remove-destination -l "$SRC" "$DEST"); then return 1 fi else @@ -149,29 +205,37 @@ readdir() { } md5() { - local MD5=`readdir "$1" | md5sum -b` + local FILE=$1 + local MD5=`readdir "$FILE" | md5sum -b` echo "${MD5:0:32}" } remove_recursive() { - rm -f $1/$2 - for FILE in $1; do - if [ -d "$1/$FILE" ]; then - remove_recursive "$1/$FILE" $2 - fi - done + local CURRENT_PATH="$1" + local NEEDLE="$2" + rm -f "$CURRENT_PATH/"$NEEDLE + for FILE in $CURRENT_PATH; do + if [ -d "$CURRENT_PATH/$FILE" ]; then + remove_recursive "$CURRENT_PATH/$FILE" "$NEEDLE" + fi + done } copy_system_lib() { - cp --remove-destination /lib/x86_64-linux-gnu/$1* "$2" &> /dev/null \ - || cp --remove-destination /lib/i386-linux-gnu/$1* "$2" &> /dev/null \ - || cp --remove-destination /usr/lib/x86_64-linux-gnu/$1* "$2" &> /dev/null \ - || cp --remove-destination /usr/lib/i386-linux-gnu/$1* "$2" &> /dev/null \ - || (echo "$1 not found in system libraries" && return 1) + local SRC_NAME=$1 + local DST_PATH=$2 + cp --remove-destination /lib/x86_64-linux-gnu/$SRC_NAME* "$DST_PATH" &> /dev/null \ + || cp --remove-destination /lib/i386-linux-gnu/$SRC_NAME* "$DST_PATH" &> /dev/null \ + || cp --remove-destination /usr/lib/x86_64-linux-gnu/$SRC_NAME* "$DST_PATH" &> /dev/null \ + || cp --remove-destination /usr/lib/i386-linux-gnu/$SRC_NAME* "$DST_PATH" &> /dev/null \ + || (echo "$SRC_NAME not found in system libraries" && return 1) } +# internal functions + message() { - echo " ------ $1" + local MESSAGE=$1 + echo " ------ $MESSAGE" } try_do_nothing() { @@ -182,43 +246,55 @@ try_do_nothing() { } set_done() { - local COMPLETION_KEY="$1:$2" + local PACKET=$1 + local FUNC=$2 + local COMPLETION_KEY="$PLATFORM:$ARCH:$PACKET:$FUNC" if [ -z "$DRY_RUN" ]; then - touch "$PACKET_DIR/$1/$2.done" + touch "$PACKET_DIR/$PACKET/$FUNC.done" fi COMPLETION_STATUS[$COMPLETION_KEY]=complete } set_undone_silent() { - local COMPLETION_KEY="$1:$2" + local PACKET=$1 + local FUNC=$2 + local COMPLETION_KEY="$PLATFORM:$ARCH:$PACKET:$FUNC" if [ -z "$DRY_RUN" ]; then - rm -f $PACKET_DIR/$1/$2.*.done - rm -f "$PACKET_DIR/$1/$2.done" + rm -f $PACKET_DIR/$PACKET/$FUNC.*.done + rm -f "$PACKET_DIR/$PACKET/$FUNC.done" fi COMPLETION_STATUS[$COMPLETION_KEY]=incomplete } set_undone() { - message "$1 set_undone $2" - set_undone_silent $1 $2 + local PACKET=$1 + local FUNC=$2 + message "$PACKET set_undone $FUNC" + set_undone_silent $PACKET $FUNC } clean_packet_directory_silent() { - set_undone_silent $1 $2 - try_do_nothing $1 $2 && return 0 - rm -rf "$PACKET_DIR/$1/$2" + local PACKET=$1 + local FUNC=$2 + set_undone_silent $PACKET $FUNC + try_do_nothing $PACKET $FUNC && return 0 + rm -rf "$PACKET_DIR/$PACKET/$FUNC" } clean_packet_directory() { - message "$1 clean $2" - clean_packet_directory_silent $1 $2 + local PACKET=$1 + local FUNC=$2 + message "$PACKET clean $FUNC" + clean_packet_directory_silent $PACKET $FUNC } check_packet_function() { + local PACKET=$1 + local FUNC=$2 if [ ! -z "$FORCE" ]; then return 1 fi - if [ ! -f "$PACKET_DIR/$1/$2.done" ]; then + if [ ! -f "$PACKET_DIR/$PACKET/$FUNC.done" ]; then return 1 fi } @@ -249,22 +325,52 @@ set_environment_vars() { export DOWNLOAD_PACKET_DIR=$CURRENT_PACKET_DIR/download export UNPACK_PACKET_DIR=$CURRENT_PACKET_DIR/unpack export ENVDEPS_PACKET_DIR=$CURRENT_PACKET_DIR/envdeps + export ENVDEPS_NATIVE_PACKET_DIR=$CURRENT_PACKET_DIR/envdeps_native export BUILD_PACKET_DIR=$CURRENT_PACKET_DIR/build export INSTALL_PACKET_DIR=$CURRENT_PACKET_DIR/install export INSTALL_RELEASE_PACKET_DIR=$CURRENT_PACKET_DIR/install_release export ENV_PACKET_DIR=$CURRENT_PACKET_DIR/env + export ENV_NATIVE_PACKET_DIR=$CURRENT_PACKET_DIR/env_native export ENVDEPS_RELEASE_PACKET_DIR=$CURRENT_PACKET_DIR/envdeps_release export ENV_RELEASE_PACKET_DIR=$CURRENT_PACKET_DIR/env_release - export LD_LIBRARY_PATH="$ENV_PACKET_DIR/lib:$ENV_PACKET_DIR/lib64:$ENVDEPS_PACKET_DIR/lib:$ENVDEPS_PACKET_DIR/lib64:$INITIAL_LD_LIBRARY_PATH" - export PATH="$ENVDEPS_PACKET_DIR/bin:$INITIAL_PATH" - export LDFLAGS="-L$ENVDEPS_PACKET_DIR/lib -L$ENVDEPS_PACKET_DIR/lib64 $INITIAL_LDFLAGS" - export CFLAGS="-I$ENVDEPS_PACKET_DIR/include $INITIAL_CFLAGS" - export CPPFLAGS="-I$ENVDEPS_PACKET_DIR/include $INITIAL_CPPFLAGS" - export CXXFLAGS="-I$ENVDEPS_PACKET_DIR/include $INITIAL_CXXFLAGS" - export PKG_CONFIG_PATH="$ENVDEPS_PACKET_DIR/lib/pkgconfig:$INITIAL_PKG_CONFIG_PATH" - export XDG_DATA_DIRS="$ENVDEPS_PACKET_DIR/share:$INITIAL_XDG_DATA_DIRS" - export ACLOCAL_PATH="$ENVDEPS_PACKET_DIR/share/aclocal:$INITIAL_ACLOCAL_PATH" + export HOST=$TOOLCHAIN_HOST + + export PATH="\ +$ENVDEPS_NATIVE_PACKET_DIR/bin:\ +$ENV_NATIVE_PACKET_DIR/bin:\ +$ENVDEPS_PACKET_DIR/bin:\ +$ENV_PACKET_DIR/bin:\ +$TOOLCHAIN_PATH" + + export LD_LIBRARY_PATH="\ +$ENVDEPS_NATIVE_PACKET_DIR/lib:\ +$ENVDEPS_NATIVE_PACKET_DIR/lib64\ +$ENV_NATIVE_PACKET_DIR/lib:\ +$ENV_NATIVE_PACKET_DIR/lib64:\ +$ENVDEPS_PACKET_DIR/lib:\ +$ENVDEPS_PACKET_DIR/lib64:\ +$ENV_PACKET_DIR/lib:\ +$ENV_PACKET_DIR/lib64:\ +$TOOLCHAIN_LD_LIBRARY_PATH" + + export CC=$TOOLCHAIN_CC + export CXX=$TOOLCHAIN_CXX + + if [ -z "$CC" ]; then + export -n CC + fi + if [ -z "$CXX" ]; then + export -n CXX + fi + + export LDFLAGS="-L$ENVDEPS_PACKET_DIR/lib -L$ENVDEPS_PACKET_DIR/lib64 $TOOLCHAIN_LDFLAGS" + export CFLAGS="-I$ENVDEPS_PACKET_DIR/include $TOOLCHAIN_CFLAGS" + export CPPFLAGS="-I$ENVDEPS_PACKET_DIR/include $TOOLCHAIN_CPPFLAGS" + export CXXFLAGS="-I$ENVDEPS_PACKET_DIR/include $TOOLCHAIN_CXXFLAGS" + export PKG_CONFIG_PATH="$ENVDEPS_PACKET_DIR/lib/pkgconfig:$TOOLCHAIN_PKG_CONFIG_PATH" + export XDG_DATA_DIRS="$ENVDEPS_PACKET_DIR/share:$TOOLCHAIN_XDG_DATA_DIRS" + export ACLOCAL_PATH="$ENVDEPS_PACKET_DIR/share/aclocal:$TOOLCHAIN_ACLOCAL_PATH" } call_packet_function() { @@ -333,120 +439,255 @@ foreach_deps() { local NAME=$1 local FUNC=$2 local RECURSIVE=$3 + local NATIVE=$4 + local WAS_NATIVE=$IS_NATIVE source $INCLUDE_SCRIPT_DIR/inc-pkall-none.sh [ ! $? -eq 0 ] && return 1 source "$PACKET_SCRIPT_DIR/$NAME.sh" [ ! $? -eq 0 ] && return 1 - + if [ ! -z "$WAS_NATIVE" ]; then + DEPS="$DEPS $DEPS_NATIVE" + DEPS_NATIVE= + fi + local CURRENT_DEPS=$DEPS + local CURRENT_DEPS_NATIVE=$DEPS_NATIVE + local PROCESS_SELF="" + if [ "$NATIVE" = "native" ]; then + CURRENT_DEPS=$DEPS_NATIVE + if [ ! -z "$TOOLCHAIN_HOST" ]; then + PROCESS_SELF="process_self" + fi + fi + for DEP in $CURRENT_DEPS; do - if [ ! -z "$DEP" ]; then - local DEP_LOCAL=$DEP - if [ "$RECURSIVE" = "recursive" ]; then - if ! foreach_deps "$DEP_LOCAL" "$FUNC" "$RECURSIVE"; then - return 1 - fi - fi + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" -o "$PROCESS_SELF" = "process_self" ]; then + local DEP_LOCAL=$DEP + if [ "$RECURSIVE" = "recursive" ]; then + if ! foreach_deps "$DEP_LOCAL" "$FUNC" "$RECURSIVE"; then + return 1 + fi + fi if ! "$FUNC" "$DEP_LOCAL" "$NAME"; then return 1 fi fi - done + done + + if [ "$RECURSIVE" = "recursive" ]; then + for DEP in $CURRENT_DEPS_NATIVE; do + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" -o ! -z "$TOOLCHAIN_HOST" ]; then + local DEP_LOCAL=$DEP + if ! native foreach_deps "$DEP_LOCAL" "$FUNC" "$RECURSIVE"; then + return 1 + fi + if ! native "$FUNC" "$DEP_LOCAL" "$NAME"; then + return 1 + fi + fi + done + fi +} + +set_toolchain() { + if [ "$1" = "native" ]; then + IS_NATIVE=1 + if [ ! "$2" = "silent" ]; then + echo " --- set toolchain $NATIVE_PLATFORM-$NATIVE_ARCH (native)" + fi + source $NATIVE_TOOLCHAIN_SCRIPT + else + IS_NATIVE= + if [ ! "$2" = "silent" ]; then + echo " --- set toolchain $PLATFORM-$ARCH (target)" + fi + source $NATIVE_TOOLCHAIN_SCRIPT + source $TOOLCHAIN_SCRIPT + fi } is_complete() { - local NAME=$1 - local FUNC=$2 - local SUBFUNCS_VAR_NAME=FUNC_DEPS_$FUNC + local NAME=$1 + local FUNC=$2 + + local WAS_NATIVE=$IS_NATIVE + local WAS_PLATFORM=$PLATFORM + local WAS_ARCH=$ARCH + local WAS_PACKET_DIR=$PACKET_DIR + local PROCESS_SELF="" + if [ ! -z "$TOOLCHAIN_HOST" ]; then + PROCESS_SELF="process_self" + fi + + local SUBFUNCS_VAR_NAME=FUNC_DEPS_$FUNC local SUBFUNCS=${!SUBFUNCS_VAR_NAME} - local COMPLETION_KEY="$NAME:$FUNC" - if [ ! -z ${COMPLETION_STATUS[$COMPLETION_KEY]} ]; then - if [ "${COMPLETION_STATUS[$COMPLETION_KEY]}" = "complete" ]; then - return 0 - else - return 1 - fi - fi - - COMPLETION_STATUS[$COMPLETION_KEY]=incomplete - - if ! check_packet_function $1 $2; then - return 1 - fi - if [ ! -z "$NO_CHECK_DEPS" ]; then - COMPLETION_STATUS[$COMPLETION_KEY]=complete - return 0 - fi + local COMPLETION_KEY="$PLATFORM:$ARCH:$NAME:$FUNC" + if [ ! -z ${COMPLETION_STATUS[$COMPLETION_KEY]} ]; then + if [ "${COMPLETION_STATUS[$COMPLETION_KEY]}" = "complete" ]; then + return 0 + else + return 1 + fi + fi - source $INCLUDE_SCRIPT_DIR/inc-pkall-none.sh + COMPLETION_STATUS[$COMPLETION_KEY]=incomplete + + if ! check_packet_function $1 $2; then + return 1 + fi + if [ ! -z "$NO_CHECK_DEPS" ]; then + COMPLETION_STATUS[$COMPLETION_KEY]=complete + return 0 + fi + + source $INCLUDE_SCRIPT_DIR/inc-pkall-none.sh [ ! $? -eq 0 ] && return 1 source "$PACKET_SCRIPT_DIR/$NAME.sh" [ ! $? -eq 0 ] && return 1 + if [ ! -z "$WAS_NATIVE" ]; then + DEPS="$DEPS $DEPS_NATIVE" + DEPS_NATIVE= + fi - local CURRENT_DEPS=$DEPS - for SUBFUNC in $SUBFUNCS; do - local SUBFUNC_LOCAL=$SUBFUNC - if [ "${SUBFUNC_LOCAL:0:1}" = "-" ]; then - SUBFUNC_LOCAL=${SUBFUNC_LOCAL:1} - for DEP in $CURRENT_DEPS; do - if [ ! -z "$DEP" ]; then - local DEP_LOCAL=$DEP - if ! is_complete $DEP_LOCAL $SUBFUNC_LOCAL; then - return 1 - fi - if [ "$PACKET_DIR/$NAME/$FUNC.done" -ot "$PACKET_DIR/$DEP_LOCAL/$SUBFUNC_LOCAL.done" ]; then - return 1 - fi - fi - done - else - if ! is_complete $NAME $SUBFUNC_LOCAL; then - return 1 - fi - if [ "$PACKET_DIR/$NAME/$FUNC.done" -ot "$PACKET_DIR/$NAME/$SUBFUNC_LOCAL.done" ]; then - return 1 - fi - fi - done + local FAIL= + local CURRENT_DEPS="$DEPS" + local CURRENT_DEPS_NATIVE="$DEPS_NATIVE" + for SUBFUNC in $SUBFUNCS; do + local SUBFUNC_LOCAL=$SUBFUNC + if [ "${SUBFUNC_LOCAL:0:2}" = "--" ]; then + if [ ! -z "$CURRENT_DEPS_NATIVE" ]; then + SUBFUNC_LOCAL=${SUBFUNC_LOCAL:2} + if [ -z "$WAS_NATIVE" ]; then + set_toolchain "native" "silent" + PLATFORM=$NATIVE_PLATFORM + ARCH=$NATIVE_ARCH + PACKET_DIR=$NATIVE_PACKET_DIR + fi + for DEP in $CURRENT_DEPS_NATIVE; do + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" -o "$PROCESS_SELF" = "process_self" ]; then + local DEP_LOCAL=$DEP + if ! is_complete $DEP_LOCAL $SUBFUNC_LOCAL; then + FAIL=1 + break + fi + if [ "$WAS_PACKET_DIR/$NAME/$FUNC.done" -ot "$PACKET_DIR/$DEP_LOCAL/$SUBFUNC_LOCAL.done" ]; then + FAIL=1 + break + fi + fi + done + if [ -z "$WAS_NATIVE" ]; then + PLATFORM=$WAS_PLATFORM + ARCH=$WAS_ARCH + PACKET_DIR=$WAS_PACKET_DIR + set_toolchain "" "silent" + fi + if [ ! -z "$FAIL" ]; then + return 1 + fi + fi + elif [ "${SUBFUNC_LOCAL:0:1}" = "-" ]; then + SUBFUNC_LOCAL=${SUBFUNC_LOCAL:1} + for DEP in $CURRENT_DEPS; do + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" ]; then + local DEP_LOCAL=$DEP + if ! is_complete $DEP_LOCAL $SUBFUNC_LOCAL; then + return 1 + fi + if [ "$PACKET_DIR/$NAME/$FUNC.done" -ot "$PACKET_DIR/$DEP_LOCAL/$SUBFUNC_LOCAL.done" ]; then + return 1 + fi + fi + done + else + if ! is_complete $NAME $SUBFUNC_LOCAL; then + return 1 + fi + if [ "$PACKET_DIR/$NAME/$FUNC.done" -ot "$PACKET_DIR/$NAME/$SUBFUNC_LOCAL.done" ]; then + return 1 + fi + fi + done - COMPLETION_STATUS[$COMPLETION_KEY]=complete + COMPLETION_STATUS[$COMPLETION_KEY]=complete } prepare() { - local NAME=$1 - local FUNC=$2 - local SUBFUNCS_VAR_NAME=FUNC_DEPS_$FUNC + local NAME=$1 + local FUNC=$2 + + local WAS_NATIVE=$IS_NATIVE + local WAS_PLATFORM=$PLATFORM + local WAS_ARCH=$ARCH + local WAS_PACKET_DIR=$PACKET_DIR + local PROCESS_SELF="" + if [ ! -z "$TOOLCHAIN_HOST" ]; then + PROCESS_SELF="process_self" + fi + + local SUBFUNCS_VAR_NAME=FUNC_DEPS_$FUNC local SUBFUNCS=${!SUBFUNCS_VAR_NAME} - source $INCLUDE_SCRIPT_DIR/inc-pkall-none.sh + source $INCLUDE_SCRIPT_DIR/inc-pkall-none.sh [ ! $? -eq 0 ] && return 1 source "$PACKET_SCRIPT_DIR/$NAME.sh" [ ! $? -eq 0 ] && return 1 - - local CURRENT_DEPS=$DEPS - local DODEPS= - for SUBFUNC in $SUBFUNCS; do - local SUBFUNC_LOCAL=$SUBFUNC - if [ "${SUBFUNC_LOCAL:0:1}" = "-" ]; then - SUBFUNC_LOCAL=${SUBFUNC_LOCAL:1} - for DEP in $CURRENT_DEPS; do - if [ ! -z "$DEP" ]; then - if ! $SUBFUNC_LOCAL $DEP; then - return 1 - fi - fi - done - elif ! $SUBFUNC_LOCAL $NAME; then - return 1 - fi - done - - if [ ! -z "$CLEAN_BEFORE_DO" ]; then - if ! clean_packet_directory $NAME $FUNC; then - return 1 - fi - fi + if [ ! -z "$WAS_NATIVE" ]; then + DEPS="$DEPS $DEPS_NATIVE" + DEPS_NATIVE= + fi + local FAIL= + local CURRENT_DEPS="$DEPS" + local CURRENT_DEPS_NATIVE="$DEPS_NATIVE" + for SUBFUNC in $SUBFUNCS; do + local SUBFUNC_LOCAL=$SUBFUNC + if [ "${SUBFUNC_LOCAL:0:2}" = "--" ]; then + if [ ! -z "$CURRENT_DEPS_NATIVE" ]; then + SUBFUNC_LOCAL=${SUBFUNC_LOCAL:2} + if [ -z "$WAS_NATIVE" ]; then + set_toolchain "native" + PLATFORM=$NATIVE_PLATFORM + ARCH=$NATIVE_ARCH + PACKET_DIR=$NATIVE_PACKET_DIR + fi + for DEP in $CURRENT_DEPS_NATIVE; do + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" -o "$PROCESS_SELF" = "process_self" ]; then + if ! $SUBFUNC_LOCAL $DEP; then + FAIL=1 + break + fi + fi + done + if [ -z "$WAS_NATIVE" ]; then + PLATFORM=$WAS_PLATFORM + ARCH=$WAS_ARCH + PACKET_DIR="$WAS_PACKET_DIR" + set_toolchain + fi + if [ ! -z "$FAIL" ]; then + return 1 + fi + fi + elif [ "${SUBFUNC_LOCAL:0:1}" = "-" ]; then + SUBFUNC_LOCAL=${SUBFUNC_LOCAL:1} + for DEP in $CURRENT_DEPS; do + if [ ! -z "$DEP" ] && [ "$DEP" != "$NAME" ]; then + if ! $SUBFUNC_LOCAL $DEP; then + return 1 + fi + fi + done + elif ! $SUBFUNC_LOCAL $NAME; then + return 1 + fi + done + + if [ ! -z "$CLEAN_BEFORE_DO" ]; then + if ! clean_packet_directory $NAME $FUNC; then + return 1 + fi + fi } add_envdeps() { @@ -455,12 +696,26 @@ add_envdeps() { fi } +add_envdeps_native() { + if ! copy "$PACKET_DIR/$1/env_native" "$PACKET_DIR/$2/envdeps_native"; then + return 1 + fi +} + +add_envdeps_native_cross() { + if ! copy "$NATIVE_PACKET_DIR/$1/env" "$PACKET_DIR/$2/envdeps_native"; then + return 1 + fi +} + add_envdeps_release() { if ! copy "$PACKET_DIR/$1/env_release" "$PACKET_DIR/$2/envdeps_release"; then return 1 fi } +# functions + update() { local NAME=$1 prepare $NAME download || return 1 @@ -497,6 +752,25 @@ envdeps() { set_done $NAME envdeps } +envdeps_native() { + local NAME=$1 + is_complete $NAME envdeps_native && return 0 + prepare $NAME envdeps_native || return 1 + + message "$NAME envdeps_native" + try_do_nothing $NAME envdeps_native && return 0 + + clean_packet_directory_silent $NAME envdeps_native + mkdir -p "$PACKET_DIR/$NAME/envdeps_native" + if ! foreach_deps $NAME add_envdeps_native; then + return 1 + fi + if ! foreach_deps $NAME add_envdeps_native_cross "" "native"; then + return 1 + fi + set_done $NAME envdeps_native +} + build() { local NAME=$1 is_complete $NAME build && return 0 @@ -528,6 +802,22 @@ env() { set_done $NAME env } +env_native() { + local NAME=$1 + is_complete $NAME env_native && return 0 + prepare $NAME env_native || return 1 + + message "$NAME env_native" + try_do_nothing $NAME env_native && return 0 + + clean_packet_directory_silent $NAME env_native + mkdir -p "$PACKET_DIR/$NAME/env_native" + if ! copy "$PACKET_DIR/$NAME/envdeps_native" "$PACKET_DIR/$NAME/env_native"; then + return 1 + fi + set_done $NAME env_native +} + envdeps_release() { local NAME=$1 is_complete $NAME envdeps_release && return 0 @@ -583,6 +873,10 @@ clean_envdeps() { clean_packet_directory $1 envdeps } +clean_envdeps_native() { + clean_packet_directory $1 envdeps_native +} + clean_build() { clean_packet_directory $1 build } @@ -595,6 +889,10 @@ clean_env() { clean_packet_directory $1 env } +clean_env_native() { + clean_packet_directory $1 env_native +} + clean_install_release() { clean_packet_directory $1 install_release } @@ -611,7 +909,9 @@ clean_all_env() { clean_install $1 clean_install_release $1 clean_envdeps $1 + clean_envdeps_native $1 clean_env $1 + clean_env_native $1 clean_envdeps_release $1 clean_env_release $1 } @@ -627,8 +927,8 @@ clean_all_unpack() { } clean() { - message "$1 clean all" - try_do_nothing $NAME clean_all && return 0 + message "$1 clean all" + try_do_nothing $NAME clean_all && return 0 rm -rf "$PACKET_DIR/$1" } @@ -646,6 +946,10 @@ set_undone_envdeps() { set_undone $1 envdeps } +set_undone_envdeps_native() { + set_undone $1 envdeps_native +} + set_undone_build() { set_undone $1 build } @@ -658,6 +962,10 @@ set_undone_env() { set_undone $1 env } +set_undone_env_native() { + set_undone $1 env_native +} + set_undone_install_release() { set_undone $1 install_release } @@ -674,7 +982,9 @@ set_undone_all_env() { set_undone_install $1 set_undone_install_release $1 set_undone_envdeps $1 + set_undone_envdeps_native $1 set_undone_env $1 + set_undone_env_native $1 set_undone_envdeps_release $1 set_undone_env_release $1 } @@ -700,6 +1010,9 @@ with_deps() { if ! foreach_deps "$2" "$1" "recursive"; then return 1 fi + if ! foreach_deps "$2" "$1" "recursive" "native"; then + return 1 + fi if ! "$1" "$2"; then return 1 fi @@ -736,5 +1049,35 @@ clean_before_do() { "$@" } +native() { + local ARGS="$@" + if [ ! -z "$IS_NATIVE" ]; then + $ARGS + else + local WAS_PLATFORM=$PLATFORM + local WAS_ARCH=$ARCH + local WAS_PACKET_DIR=$PACKET_DIR + + set_toolchain "native" + PLATFORM=$NATIVE_PLATFORM + ARCH=$NATIVE_ARCH + PACKET_DIR=$NATIVE_PACKET_DIR + if [ ! -z "$NAME" ]; then + set_environment_vars $NAME + fi + + $ARGS + + PLATFORM=$WAS_PLATFORM + ARCH=$WAS_ARCH + PACKET_DIR=$WAS_PACKET_DIR + set_toolchain + if [ ! -z "$NAME" ]; then + set_environment_vars $NAME + fi + fi +} + +set_toolchain "$@" diff --git a/docker-builder-data/build/script/common/toolchain-win-64.sh b/docker-builder-data/build/script/common/toolchain-win-64.sh deleted file mode 100755 index e423313..0000000 --- a/docker-builder-data/build/script/common/toolchain-win-64.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -export TOOLCHAIN_HOST="x86_64-w64-mingw32" -export HOST="$TOOLCHAIN_HOST" - -export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib/pkgconfig/ -export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig -export PATH=/usr/${TOOLCHAIN_HOST}/bin:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/bin:${PREFIX}/bin:$PATH -export LD_LIBRARY_PATH=${PREFIX}/lib:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib:$LD_LIBRARY_PATH - -export CC=/usr/bin/${TOOLCHAIN_HOST}-gcc -export CXX=/usr/bin/${TOOLCHAIN_HOST}-g++ -export CFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CFLAGS" -export CPPFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CPPFLAGS" -export CXXFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CPPFLAGS" -export LDFLAGS=" -L/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib $LDFLAGS" diff --git a/docker-builder-data/build/script/include/inc-pkall-none.sh b/docker-builder-data/build/script/include/inc-pkall-none.sh index 6b0eae9..e28301c 100644 --- a/docker-builder-data/build/script/include/inc-pkall-none.sh +++ b/docker-builder-data/build/script/include/inc-pkall-none.sh @@ -1,4 +1,5 @@ DEPS= +DEPS_NATIVE= PK_URL= PK_VERSION= @@ -43,3 +44,7 @@ pkinstall() { pkinstall_release() { return 0 } + +pkhook_prebuild() { + return 0 +} diff --git a/docker-builder-data/build/script/include/inc-pkbuild-default.sh b/docker-builder-data/build/script/include/inc-pkbuild-default.sh index 07d2834..4c0febe 100644 --- a/docker-builder-data/build/script/include/inc-pkbuild-default.sh +++ b/docker-builder-data/build/script/include/inc-pkbuild-default.sh @@ -7,13 +7,18 @@ pkbuild() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 - if ! check_packet_function $NAME build.cunfigure; then - CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ - ./configure \ - $PK_CONFIGURE_OPTIONS_DEFAULT \ - $PK_CONFIGURE_OPTIONS \ - || return 1 - set_done $NAME build.cunfigure + + if ! pkhook_prebuild; then + return 1 + fi + + if ! check_packet_function $NAME build.cunfigure; then + CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + ./configure \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ + || return 1 + set_done $NAME build.cunfigure fi if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ diff --git a/docker-builder-data/build/script/packet/appimagekit-master.sh b/docker-builder-data/build/script/packet/appimagekit-master.sh index 501023c..0de88d8 100644 --- a/docker-builder-data/build/script/packet/appimagekit-master.sh +++ b/docker-builder-data/build/script/packet/appimagekit-master.sh @@ -1,4 +1,5 @@ -DEPS="png-1.6.26 cmake-3.6.2" +DEPS="png-1.6.26" +DEPS_NATIVE="cmake-3.6.2" PK_DIRNAME="AppImageKit" PK_URL="https://github.com/probonopd/$PK_DIRNAME.git" diff --git a/docker-builder-data/build/script/packet/atk-2.22.0.sh b/docker-builder-data/build/script/packet/atk-2.22.0.sh index 6d48ffe..9cb5097 100644 --- a/docker-builder-data/build/script/packet/atk-2.22.0.sh +++ b/docker-builder-data/build/script/packet/atk-2.22.0.sh @@ -1,4 +1,5 @@ -DEPS="gobjectintrospection-1.50.0" +DEPS="glib-2.50.0" +#DEPS_NATIVE="gobjectintrospection-1.50.0" PK_DIRNAME="atk-2.22.0" PK_ARCHIVE="$PK_DIRNAME.tar.xz" diff --git a/docker-builder-data/build/script/packet/berkeleydb-5.3.28.sh b/docker-builder-data/build/script/packet/berkeleydb-5.3.28.sh new file mode 100644 index 0000000..c6013e2 --- /dev/null +++ b/docker-builder-data/build/script/packet/berkeleydb-5.3.28.sh @@ -0,0 +1,24 @@ +DEPS="" + +PK_DIRNAME="db-5.3.28/build_unix" +PK_ARCHIVE="db-5.3.28.tar.gz" +PK_URL="http://download.oracle.com/berkeley-db/$PK_ARCHIVE" + +source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +pkbuild() { + cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 + if ! check_packet_function $NAME build.cunfigure; then + CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + ../dist/configure \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ + || return 1 + set_done $NAME build.cunfigure + fi + + if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + make -j${THREADS}; then + return 1 + fi +} diff --git a/docker-builder-data/build/script/packet/boost-1.61.0.sh b/docker-builder-data/build/script/packet/boost-1.61.0.sh index 21e7868..3f6aa73 100644 --- a/docker-builder-data/build/script/packet/boost-1.61.0.sh +++ b/docker-builder-data/build/script/packet/boost-1.61.0.sh @@ -9,16 +9,27 @@ source $INCLUDE_SCRIPT_DIR/inc-pkinstall_release-default.sh pkbuild() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" - if ! check_packet_function $NAME build.configure; then - ./bootstrap.sh --prefix=$INSTALL_PACKET_DIR --without-libraries=python || return 1 - set_done $NAME build.configure - fi - ./b2 -j${THREADS} || return 1 + if ! check_packet_function $NAME build.configure; then + local LOCAL_PREFIX=$INSTALL_PACKET_DIR + native ./bootstrap.sh --prefix=$LOCAL_PREFIX --without-libraries=python || return 1 + set_done $NAME build.configure + fi + + local LOCAL_OPTIONS= + if [ "$PLATFORM" = "win" ]; then + LOCAL_OPTIONS="toolset=gcc-win binary-format=pe abi=ms target-os=windows --user-config=$BUILD_PACKET_DIR/$PK_DIRNAME/user-config.jam" + echo "using gcc : win : $CXX : cflags=$CFLAGS cxxflags=$CXXFLAGS linkflags=$LDFLAGS ;" > user-config.jam + fi + ./b2 -j${THREADS} variant=release runtime-link=shared $LOCAL_OPTIONS || return 1 } pkinstall() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" - if ! ./b2 install; then + local LOCAL_OPTIONS= + if [ "$PLATFORM" = "win" ]; then + LOCAL_OPTIONS="toolset=gcc-win binary-format=pe abi=ms target-os=windows --user-config=$BUILD_PACKET_DIR/$PK_DIRNAME/user-config.jam" + fi + if ! ./b2 variant=release runtime-link=shared $LOCAL_OPTIONS install; then return 1 fi rm -rf "$INSTALL_RELEASE_PACKET_DIR/include" diff --git a/docker-builder-data/build/script/packet/cairo-1.14.6.sh b/docker-builder-data/build/script/packet/cairo-1.14.6.sh index 75ff836..f6fb647 100644 --- a/docker-builder-data/build/script/packet/cairo-1.14.6.sh +++ b/docker-builder-data/build/script/packet/cairo-1.14.6.sh @@ -1,4 +1,4 @@ -DEPS="png-1.6.26 pixman-0.34.0 xcbfull-1.12" +DEPS="png-1.6.26 pixman-0.34.0" PK_DIRNAME="cairo-1.14.6" PK_ARCHIVE="$PK_DIRNAME.tar.xz" @@ -6,3 +6,6 @@ PK_URL="https://www.cairographics.org/releases/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh +if [ "$PLATFORM" = "linux" ] || [ ! -z "$IS_NATIVE" ]; then + DEPS="$DEPS xcbfull-1.12" +fi diff --git a/docker-builder-data/build/script/packet/cairo-1.15.4.sh b/docker-builder-data/build/script/packet/cairo-1.15.4.sh new file mode 100644 index 0000000..56084af --- /dev/null +++ b/docker-builder-data/build/script/packet/cairo-1.15.4.sh @@ -0,0 +1,11 @@ +DEPS="png-1.6.26 pixman-0.34.0 fontconfig-2.11.0 glib-2.50.0" + +PK_DIRNAME="cairo-1.15.4" +PK_ARCHIVE="$PK_DIRNAME.tar.xz" +PK_URL="https://www.cairographics.org/snapshots/$PK_ARCHIVE" + +source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +if [ "$PLATFORM" = "linux" ] || [ ! -z "$IS_NATIVE" ]; then + DEPS="$DEPS xcbfull-1.12" +fi diff --git a/docker-builder-data/build/script/packet/cairomm-1.10.0.sh b/docker-builder-data/build/script/packet/cairomm-1.10.0.sh index 65a3e60..cc4060d 100644 --- a/docker-builder-data/build/script/packet/cairomm-1.10.0.sh +++ b/docker-builder-data/build/script/packet/cairomm-1.10.0.sh @@ -1,4 +1,4 @@ -DEPS="cairo-1.14.6 sigcpp-2.2.11" +DEPS="cairo-1.15.4 sigcpp-2.2.11" PK_DIRNAME="cairomm-1.10.0" PK_ARCHIVE="$PK_DIRNAME.tar.gz" diff --git a/docker-builder-data/build/script/packet/cairomm-1.12.0.sh b/docker-builder-data/build/script/packet/cairomm-1.12.0.sh index 15a7798..7ecc6ae 100644 --- a/docker-builder-data/build/script/packet/cairomm-1.12.0.sh +++ b/docker-builder-data/build/script/packet/cairomm-1.12.0.sh @@ -1,7 +1,11 @@ -DEPS="cairo-1.14.6 sigcpp-2.10.0" +DEPS="cairo-1.15.4 sigcpp-2.10.0" PK_DIRNAME="cairomm-1.12.0" PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="https://www.cairographics.org/releases/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +if [ "$PLATFORM" = "win" ]; then + PK_CONFIGURE_OPTIONS="CXXFLAGS=-DM_PI=3.14159265358979323846" +fi \ No newline at end of file diff --git a/docker-builder-data/build/script/packet/cmake-3.6.2.sh b/docker-builder-data/build/script/packet/cmake-3.6.2.sh index 9efc248..ce7c28e 100644 --- a/docker-builder-data/build/script/packet/cmake-3.6.2.sh +++ b/docker-builder-data/build/script/packet/cmake-3.6.2.sh @@ -4,8 +4,6 @@ PK_DIRNAME="cmake-3.6.2" PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="https://cmake.org/files/v3.6/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS_DEFAULT="--prefix=$INSTALL_PACKET_DIR" +PK_CONFIGURE_OPTIONS_DEFAULT="--host=$HOST --prefix=$INSTALL_PACKET_DIR" -source $INCLUDE_SCRIPT_DIR/inc-pkallunpack-default.sh -source $INCLUDE_SCRIPT_DIR/inc-pkbuild-default.sh -source $INCLUDE_SCRIPT_DIR/inc-pkinstall-default.sh +source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/croco-0.6.11.sh b/docker-builder-data/build/script/packet/croco-0.6.11.sh new file mode 100644 index 0000000..fce51f4 --- /dev/null +++ b/docker-builder-data/build/script/packet/croco-0.6.11.sh @@ -0,0 +1,8 @@ +DEPS="glib-2.50.0 xml-2.9.4" + +PK_DIRNAME="libcroco-0.6.11" +PK_ARCHIVE="$PK_DIRNAME.tar.xz" +PK_URL="https://download.gnome.org/sources/libcroco/0.6/$PK_ARCHIVE" + +source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + diff --git a/docker-builder-data/build/script/packet/doxygen-1.8.8.sh b/docker-builder-data/build/script/packet/doxygen-1.8.8.sh index 1500c69..47cbf76 100644 --- a/docker-builder-data/build/script/packet/doxygen-1.8.8.sh +++ b/docker-builder-data/build/script/packet/doxygen-1.8.8.sh @@ -4,6 +4,6 @@ PK_DIRNAME="doxygen-1.8.8" PK_ARCHIVE="$PK_DIRNAME.src.tar.gz" PK_URL="http://ftp.stack.nl/pub/users/dimitri/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS_DEFAULT="--prefix $INSTALL_PACKET_DIR" +PK_CONFIGURE_OPTIONS_DEFAULT="--host=$HOST --prefix $INSTALL_PACKET_DIR" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/epoxy-master.sh b/docker-builder-data/build/script/packet/epoxy-master.sh index 08c689f..642ed48 100644 --- a/docker-builder-data/build/script/packet/epoxy-master.sh +++ b/docker-builder-data/build/script/packet/epoxy-master.sh @@ -10,7 +10,7 @@ source $INCLUDE_SCRIPT_DIR/inc-pkinstall_release-default.sh pkbuild() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 if ! check_packet_function $NAME build.cunfigure; then - ./autogen.sh --prefix=$INSTALL_PACKET_DIR || return 1 + ./autogen.sh --host=$HOST --prefix=$INSTALL_PACKET_DIR || return 1 set_done $NAME build.cunfigure fi make -j${THREADS} || return 1 diff --git a/docker-builder-data/build/script/packet/ffmpeg-2.4.13.sh b/docker-builder-data/build/script/packet/ffmpeg-2.4.13.sh index 5330420..716a0f6 100644 --- a/docker-builder-data/build/script/packet/ffmpeg-2.4.13.sh +++ b/docker-builder-data/build/script/packet/ffmpeg-2.4.13.sh @@ -1,4 +1,5 @@ -DEPS="sdl-1.2.15 yasm-1.3.0 lame-3.99.5 ogg-1.3.2 theora-1.1.1 vorbis-1.3.5 x264-master" +DEPS="lame-3.99.5 ogg-1.3.2 theora-1.1.1 vorbis-1.3.5 x264-master sdl-1.2.15" +DEPS_NATIVE="yasm-1.3.0" PK_DIRNAME="ffmpeg-2.4.13" PK_ARCHIVE="$PK_DIRNAME.tar.bz2" diff --git a/docker-builder-data/build/script/packet/ffmpeg-3.1.5.sh b/docker-builder-data/build/script/packet/ffmpeg-3.1.5.sh index 1abc53d..fc83fbd 100644 --- a/docker-builder-data/build/script/packet/ffmpeg-3.1.5.sh +++ b/docker-builder-data/build/script/packet/ffmpeg-3.1.5.sh @@ -6,13 +6,20 @@ # + vorbis # + x264 -DEPS="sdl-1.2.15 yasm-1.3.0 lame-3.99.5 ogg-1.3.2 theora-1.1.1 vorbis-1.3.5 x264-master" +DEPS="lame-3.99.5 ogg-1.3.2 theora-1.1.1 vorbis-1.3.5 x264-master sdl-1.2.15" +DEPS_NATIVE="yasm-1.3.0" PK_DIRNAME="ffmpeg-3.1.5" PK_ARCHIVE="$PK_DIRNAME.tar.bz2" PK_URL="http://ffmpeg.org/releases/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS=" \ +PK_CONFIGURE_OPTIONS_DEFAULT=" \ + --prefix=$INSTALL_PACKET_DIR \ + --disable-static \ + --enable-shared" + +PK_CONFIGURE_OPTIONS=" + --disable-doc \ --enable-rpath \ --enable-gpl \ --enable-libx264 \ @@ -20,4 +27,14 @@ PK_CONFIGURE_OPTIONS=" \ --enable-libtheora \ --enable-libvorbis" +if [ "$PLATFORM" = "win" ]; then + PK_CONFIGURE_OPTIONS="$PK_CONFIGURE_OPTIONS \ + --arch=x86_$ARCH \ + --target-os=mingw$ARCH \ + --cross-prefix=$HOST- \ + --host-cc=$HOST-gcc \ + --host-ld=$HOST-gcc \ + --enable-cross-compile" +fi + source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/fontconfig-2.11.0.sh b/docker-builder-data/build/script/packet/fontconfig-2.11.0.sh index a5fe5ff..6643013 100644 --- a/docker-builder-data/build/script/packet/fontconfig-2.11.0.sh +++ b/docker-builder-data/build/script/packet/fontconfig-2.11.0.sh @@ -7,3 +7,8 @@ PK_URL="https://www.freedesktop.org/software/fontconfig/release/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkallunpack-default.sh source $INCLUDE_SCRIPT_DIR/inc-pkbuild-default.sh source $INCLUDE_SCRIPT_DIR/inc-pkinstall-default.sh + +pkhook_prebuild() { + rm -rf test + ln -s src test +} diff --git a/docker-builder-data/build/script/packet/freeglut-3.0.0.sh b/docker-builder-data/build/script/packet/freeglut-3.0.0.sh index 848c34c..ee682dc 100644 --- a/docker-builder-data/build/script/packet/freeglut-3.0.0.sh +++ b/docker-builder-data/build/script/packet/freeglut-3.0.0.sh @@ -1,4 +1,4 @@ -DEPS="cmake-3.6.2" +DEPS_NATIVE="cmake-3.6.2" PK_DIRNAME="freeglut-3.0.0" PK_ARCHIVE="$PK_DIRNAME.tar.gz" diff --git a/docker-builder-data/build/script/packet/gdkpixbuf-2.36.0.sh b/docker-builder-data/build/script/packet/gdkpixbuf-2.36.0.sh index 7fb9a85..cf5bbd2 100644 --- a/docker-builder-data/build/script/packet/gdkpixbuf-2.36.0.sh +++ b/docker-builder-data/build/script/packet/gdkpixbuf-2.36.0.sh @@ -1,11 +1,10 @@ -DEPS="jpeg-9b png-1.6.26 tiff-4.0.6 gobjectintrospection-1.50.0" +DEPS="jpeg-9b png-1.6.26 tiff-4.0.6 glib-2.50.0" +#DEPS_NATIVE="gobjectintrospection-1.50.0" PK_DIRNAME="gdk-pixbuf-2.36.0" PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="https://download.gnome.org/sources/gdk-pixbuf/2.36/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS=" \ - --enable-introspection=yes \ - --enable-relocations=yes " +PK_CONFIGURE_OPTIONS="--enable-relocations=yes" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/glib-2.50.0.sh b/docker-builder-data/build/script/packet/glib-2.50.0.sh index 8c49b16..46a36e6 100644 --- a/docker-builder-data/build/script/packet/glib-2.50.0.sh +++ b/docker-builder-data/build/script/packet/glib-2.50.0.sh @@ -1,4 +1,5 @@ DEPS="" +DEPS_NATIVE="glib-2.50.0" PK_DIRNAME="glib-2.50.0" PK_ARCHIVE="$PK_DIRNAME.tar.xz" diff --git a/docker-builder-data/build/script/packet/glibmm-2.50.0.sh b/docker-builder-data/build/script/packet/glibmm-2.50.0.sh index 67f9e03..8d5b22f 100644 --- a/docker-builder-data/build/script/packet/glibmm-2.50.0.sh +++ b/docker-builder-data/build/script/packet/glibmm-2.50.0.sh @@ -4,7 +4,6 @@ PK_DIRNAME="glibmm-2.50.0" PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="https://download.gnome.org/sources/glibmm/2.50/$PK_ARCHIVE" -#PK_CPPFLAGS="-std=c++11 -pthread" -PK_CONFIGURE_OPTIONS="CXXFLAGS=\"-std=c++11 -pthread\"" +#PK_CONFIGURE_OPTIONS="CXXFLAGS=\"-std=c++11 -pthread\"" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/gobjectintrospection-1.50.0.sh b/docker-builder-data/build/script/packet/gobjectintrospection-1.50.0.sh index 06e4248..e05820f 100644 --- a/docker-builder-data/build/script/packet/gobjectintrospection-1.50.0.sh +++ b/docker-builder-data/build/script/packet/gobjectintrospection-1.50.0.sh @@ -5,3 +5,4 @@ PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="https://download.gnome.org/sources/gobject-introspection/1.50/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + diff --git a/docker-builder-data/build/script/packet/graphviz-2.40.1.sh b/docker-builder-data/build/script/packet/graphviz-2.40.1.sh index 6f19798..446ebbd 100644 --- a/docker-builder-data/build/script/packet/graphviz-2.40.1.sh +++ b/docker-builder-data/build/script/packet/graphviz-2.40.1.sh @@ -1,5 +1,5 @@ # TODO: find deps -DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 atspi2atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.14.6 pango-1.40.3" +DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 atspi2atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.15.4 pango-1.40.3" PK_DIRNAME="graphviz-2.40.1" PK_ARCHIVE="$PK_DIRNAME.tar.gz" diff --git a/docker-builder-data/build/script/packet/gtk-3.14.14.sh b/docker-builder-data/build/script/packet/gtk-3.14.14.sh index d4782bc..5ac0eaf 100644 --- a/docker-builder-data/build/script/packet/gtk-3.14.14.sh +++ b/docker-builder-data/build/script/packet/gtk-3.14.14.sh @@ -1,7 +1,12 @@ -DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 atspi2atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.14.6 pango-1.40.3" +DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.15.4 pango-1.40.3" PK_DIRNAME="gtk+-3.14.14" PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="https://download.gnome.org/sources/gtk+/3.14/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +if [ "$PLATFORM" = "linux" ] || [ ! -z "$IS_NATIVE" ]; then + DEPS="$DEPS atspi2atk-2.22.0" +fi + diff --git a/docker-builder-data/build/script/packet/gtk-3.22.2.sh b/docker-builder-data/build/script/packet/gtk-3.22.2.sh index 385d5bb..589d16e 100644 --- a/docker-builder-data/build/script/packet/gtk-3.22.2.sh +++ b/docker-builder-data/build/script/packet/gtk-3.22.2.sh @@ -1,7 +1,32 @@ -DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 atspi2atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.14.6 pango-1.40.3" +DEPS="epoxy-master rsvg-2.40.16 atk-2.22.0 gdkpixbuf-2.36.0 cairo-1.15.4 pango-1.40.3" +DEPS_NATIVE="gtk-3.22.2" PK_DIRNAME="gtk+-3.22.2" PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="https://download.gnome.org/sources/gtk+/3.22/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +PK_CONFIGURE_OPTIONS="--enable-introspection=no" + +if [ "$PLATFORM" = "linux" ] || [ ! -z "$IS_NATIVE" ]; then + DEPS="$DEPS atspi2atk-2.22.0" +fi + +pkinstall() { + cd "$BUILD_PACKET_DIR/$PK_DIRNAME" + local LOCAL_BIN="$BUILD_PACKET_DIR/$PK_DIRNAME/gtk" + local LOCAL_BIN_NATIVE="$ENVDEPS_NATIVE_PACKET_DIR/bin" + if [ "$PLATFORM" = "win" ] && [ ! -f "$LOCAL_BIN/gtk-query-immodules-3.0.exe.orig" ]; then + mv "$LOCAL_BIN/gtk-query-immodules-3.0.exe" "$LOCAL_BIN/gtk-query-immodules-3.0.exe.orig" || return 1 + cp "$LOCAL_BIN_NATIVE/gtk-query-immodules-3.0" "$LOCAL_BIN/gtk-query-immodules-3.0.exe" + mv "$LOCAL_BIN/gtk-update-icon-cache.exe" "$LOCAL_BIN/gtk-update-icon-cache.exe.orig" + cp "$LOCAL_BIN_NATIVE/gtk-update-icon-cache" "$LOCAL_BIN/gtk-update-icon-cache.exe" + fi + make install || return 1 + if [ "$PLATFORM" = "win" ]; then + cp "$LOCAL_BIN/gtk-query-immodules-3.0.exe.orig" "$INSTALL_PACKET_DIR/bin/" || return 1 + cp "$LOCAL_BIN/gtk-update-icon-cache.exe.orig" "$INSTALL_PACKET_DIR/bin/" || return 1 + fi +} + diff --git a/docker-builder-data/build/script/packet/mlt-0.9.6.sh b/docker-builder-data/build/script/packet/mlt-0.9.6.sh index 0c97fe6..db9eb3e 100644 --- a/docker-builder-data/build/script/packet/mlt-0.9.6.sh +++ b/docker-builder-data/build/script/packet/mlt-0.9.6.sh @@ -1,4 +1,4 @@ -DEPS="ffmpeg-3.1.5 xml-2.9.4 fftw-3.3.5 samplerate-0.1.9 sox-14.4.2 sdl-1.2.15 jack-0.125.0 glib-2.50.0" +DEPS="ffmpeg-3.1.5 xml-2.9.4 fftw-3.3.5 samplerate-0.1.9 sdl-1.2.15 sox-14.4.2 glib-2.50.0" PK_DIRNAME="mlt-0.9.6" PK_ARCHIVE="v0.9.6.tar.gz" @@ -11,5 +11,9 @@ PK_CONFIGURE_OPTIONS=" \ --disable-opengl \ --disable-qt" +if [ "$PLATFORM" = "win" ]; then + DEPS="$DEPS jack-0.125.0" +fi + source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/mlt-6.2.0.sh b/docker-builder-data/build/script/packet/mlt-6.2.0.sh index 7c1bf7f..741d007 100644 --- a/docker-builder-data/build/script/packet/mlt-6.2.0.sh +++ b/docker-builder-data/build/script/packet/mlt-6.2.0.sh @@ -7,7 +7,7 @@ # + jack # + glib -DEPS="ffmpeg-3.1.5 xml-2.9.4 fftw-3.3.5 samplerate-0.1.9 sox-14.4.2 sdl-1.2.15 jack-0.125.0 glib-2.50.0" +DEPS="ffmpeg-3.1.5 xml-2.9.4 fftw-3.3.5 samplerate-0.1.9 sdl-1.2.15 sox-14.4.2 glib-2.50.0" PK_DIRNAME="mlt-6.2.0" PK_ARCHIVE="v6.2.0.tar.gz" @@ -22,5 +22,18 @@ PK_CONFIGURE_OPTIONS=" \ --disable-qt \ --disable-rtaudio" +if [ "$PLATFORM" = "linux" ]; then + DEPS="$DEPS jack-0.125.0" +fi + +if [ "$PLATFORM" = "win" ]; then + PK_CONFIGURE_OPTIONS="$PK_CONFIGURE_OPTIONS --target-os=MinGW" + if [ "$ARCH" = "32" ]; then + PK_CONFIGURE_OPTIONS="$PK_CONFIGURE_OPTIONS --target-arch=i686" + else + PK_CONFIGURE_OPTIONS="$PK_CONFIGURE_OPTIONS --target-arch=x86_$ARCH" + fi +fi + source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/opentoonz-debug.sh b/docker-builder-data/build/script/packet/opentoonz-debug.sh index 091a85e..cf603e7 100644 --- a/docker-builder-data/build/script/packet/opentoonz-debug.sh +++ b/docker-builder-data/build/script/packet/opentoonz-debug.sh @@ -1,4 +1,5 @@ -DEPS="jpeg-9b png-1.6.26 lz4-master glew-2.0.0 usb-1.0.20 sdl-2.0.5 superlu-4.3 cmake-3.6.2 freeglut-3.0.0 openblas-master boost-1.61.0 qt-5.7" +DEPS="jpeg-9b png-1.6.26 lz4-master glew-2.0.0 usb-1.0.20 sdl-2.0.5 superlu-4.3 freeglut-3.0.0 openblas-master boost-1.61.0 qt-5.7" +DEPS_NATIVE="cmake-3.6.2" PK_VERSION="1.1.2" PK_DIRNAME="opentoonz" diff --git a/docker-builder-data/build/script/packet/opentoonz-master.sh b/docker-builder-data/build/script/packet/opentoonz-master.sh index 7899c4e..e54ce21 100644 --- a/docker-builder-data/build/script/packet/opentoonz-master.sh +++ b/docker-builder-data/build/script/packet/opentoonz-master.sh @@ -1,4 +1,5 @@ -DEPS="jpeg-9b png-1.6.26 lz4-master glew-2.0.0 usb-1.0.20 sdl-2.0.5 superlu-5.2.1 cmake-3.6.2 freeglut-3.0.0 openblas-master boost-1.61.0 qt-5.7" +DEPS="jpeg-9b png-1.6.26 lz4-master glew-2.0.0 usb-1.0.20 sdl-2.0.5 superlu-5.2.1 freeglut-3.0.0 openblas-master boost-1.61.0 qt-5.7" +DEPS_NATIVE="cmake-3.6.2" PK_VERSION="1.1.2" PK_DIRNAME="opentoonz" diff --git a/docker-builder-data/build/script/packet/pango-1.40.3.sh b/docker-builder-data/build/script/packet/pango-1.40.3.sh index 5f8894d..5281763 100644 --- a/docker-builder-data/build/script/packet/pango-1.40.3.sh +++ b/docker-builder-data/build/script/packet/pango-1.40.3.sh @@ -1,4 +1,5 @@ -DEPS="harfbuzz-1.3.2 fontconfig-2.11.0 cairo-1.14.6 gobjectintrospection-1.50.0" +DEPS="harfbuzz-1.3.2 fontconfig-2.11.0 glib-2.50.0 cairo-1.15.4" +#DEPS_NATIVE="gobjectintrospection-1.50.0" PK_DIRNAME="pango-1.40.3" PK_ARCHIVE="$PK_DIRNAME.tar.xz" diff --git a/docker-builder-data/build/script/packet/rsvg-2.40.16.sh b/docker-builder-data/build/script/packet/rsvg-2.40.16.sh index 9d2cd12..522845c 100644 --- a/docker-builder-data/build/script/packet/rsvg-2.40.16.sh +++ b/docker-builder-data/build/script/packet/rsvg-2.40.16.sh @@ -1,4 +1,4 @@ -DEPS="xml-2.9.4 gdkpixbuf-2.36.0 cairo-1.14.6 pango-1.40.3" +DEPS="croco-0.6.11 gdkpixbuf-2.36.0 cairo-1.15.4 pango-1.40.3" PK_DIRNAME="librsvg-2.40.16" PK_ARCHIVE="$PK_DIRNAME.tar.xz" @@ -8,6 +8,8 @@ source $INCLUDE_SCRIPT_DIR/inc-pkallunpack-default.sh source $INCLUDE_SCRIPT_DIR/inc-pkbuild-default.sh source $INCLUDE_SCRIPT_DIR/inc-pkinstall_release-default.sh +PK_CONFIGURE_OPTIONS="--enable-introspection=no" + pkinstall() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" make install || return 1 @@ -17,5 +19,5 @@ pkinstall() { fi local GDK_LOADERS="$INSTALL_PACKET_DIR/lib/gdk-pixbuf-2.0/$GDK_API_VERSION/loaders" mkdir -p "$GDK_LOADERS" || return 1 - cp --remove-destination "$BUILD_PACKET_DIR/$PK_DIRNAME/gdk-pixbuf-loader/.libs/libpixbufloader-svg.so" "$GDK_LOADERS/" || return 1 + cp --remove-destination "$BUILD_PACKET_DIR/$PK_DIRNAME/gdk-pixbuf-loader/.libs/libpixbufloader-svg."* "$GDK_LOADERS/" || return 1 } diff --git a/docker-builder-data/build/script/packet/sdl-1.2.15.files/SDL_x11sym.h.patch b/docker-builder-data/build/script/packet/sdl-1.2.15.files/SDL_x11sym.h.patch new file mode 100644 index 0000000..b241b22 --- /dev/null +++ b/docker-builder-data/build/script/packet/sdl-1.2.15.files/SDL_x11sym.h.patch @@ -0,0 +1,4 @@ +168c168 +< SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) +--- +> SDL_X11_SYM(int,_XData32,(Display *dpy,register const long *data,unsigned len),(dpy,data,len),return) diff --git a/docker-builder-data/build/script/packet/sdl-1.2.15.sh b/docker-builder-data/build/script/packet/sdl-1.2.15.sh index b816bcf..7bd46a5 100644 --- a/docker-builder-data/build/script/packet/sdl-1.2.15.sh +++ b/docker-builder-data/build/script/packet/sdl-1.2.15.sh @@ -4,6 +4,26 @@ PK_DIRNAME="SDL-1.2.15" PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="https://www.libsdl.org/release/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS_DEFAULT="--prefix=$INSTALL_PACKET_DIR" +PK_CONFIGURE_OPTIONS_DEFAULT="--host=$HOST --prefix=$INSTALL_PACKET_DIR" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +pkbuild() { + cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 + if ! check_packet_function $NAME build.cunfigure; then + if [ "$PLATFORM" = "fedora" ]; then + cp --remove-destination "$UNPACK_PACKET_DIR/$PK_DIRNAME/src/video/x11/SDL_x11sym.h" "src/video/x11" + patch "src/video/x11/SDL_x11sym.h" "$FILES_PACKET_DIR/SDL_x11sym.h.patch" || return 1 + fi + CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + ./configure \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ + || return 1 + set_done $NAME build.cunfigure + fi + if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + make -j${THREADS}; then + return 1 + fi +} diff --git a/docker-builder-data/build/script/packet/sdl-2.0.5.sh b/docker-builder-data/build/script/packet/sdl-2.0.5.sh index 4db2aaa..e33942b 100644 --- a/docker-builder-data/build/script/packet/sdl-2.0.5.sh +++ b/docker-builder-data/build/script/packet/sdl-2.0.5.sh @@ -4,6 +4,6 @@ PK_DIRNAME="SDL2-2.0.5" PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="https://www.libsdl.org/release/$PK_ARCHIVE" -PK_CONFIGURE_OPTIONS_DEFAULT="--prefix=$INSTALL_PACKET_DIR" +PK_CONFIGURE_OPTIONS_DEFAULT="--host=$HOST --prefix=$INSTALL_PACKET_DIR" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/synfigcore-master.sh b/docker-builder-data/build/script/packet/synfigcore-master.sh index f18285d..8d06b6f 100644 --- a/docker-builder-data/build/script/packet/synfigcore-master.sh +++ b/docker-builder-data/build/script/packet/synfigcore-master.sh @@ -62,12 +62,10 @@ DEPS=" \ synfigetl-master \ jpeg-9b tiff-4.0.6 fftw-3.3.5 imagemagick-6.8.7 \ ffmpeg-3.1.5 mlt-6.2.0 \ - boost-1.61.0 cairo-1.14.6 pango-1.40.3 glibmm-2.41.4 xmlpp-2.22.0" + boost-1.61.0 cairo-1.15.4 pango-1.40.3 glibmm-2.41.4 xmlpp-2.22.0" -LINUX_DEPS="jack-0.125.0" - -if [ "$PLATFORM" -eq "linux-32" ] || [ "$PLATFORM" -eq "linux-64" ]; then - DEPS="$DEPS $LINUX_DEPS" +if [ "$PLATFORM" = "linux" ]; then + DEPS="$DEPS jack-0.125.0" fi PK_DIRNAME="synfig" @@ -78,18 +76,19 @@ source $INCLUDE_SCRIPT_DIR/inc-pkallunpack-git.sh source $INCLUDE_SCRIPT_DIR/inc-pkinstall_release-default.sh pkbuild() { - cd "$BUILD_PACKET_DIR/$PK_DIRNAME/synfig-core" || return 1 - if ! check_packet_function $NAME build.configure; then - libtoolize --ltdl --copy --force || return 1 - autoreconf --install --force || return 1 - ./configure \ - --prefix=$INSTALL_PACKET_DIR \ - --sysconfdir=$INSTALL_PACKET_DIR/etc \ - --with-boost-libdir=$ENVDEPS_PACKET_DIR/lib \ - --without-opengl || return 1 - set_done $NAME build.configure - fi - make -j${THREADS} || return 1 + cd "$BUILD_PACKET_DIR/$PK_DIRNAME/synfig-core" || return 1 + if ! check_packet_function $NAME build.configure; then + libtoolize --ltdl --copy --force || return 1 + autoreconf --install --force || return 1 + ./configure \ + --host=$HOST \ + --prefix=$INSTALL_PACKET_DIR \ + --sysconfdir=$INSTALL_PACKET_DIR/etc \ + --with-boost-libdir=$ENVDEPS_PACKET_DIR/lib \ + --without-opengl || return 1 + set_done $NAME build.configure + fi + make -j${THREADS} || return 1 } pkinstall() { diff --git a/docker-builder-data/build/script/packet/synfigstudio-master.sh b/docker-builder-data/build/script/packet/synfigstudio-master.sh index 7b7f34f..5d94e63 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-master.sh +++ b/docker-builder-data/build/script/packet/synfigstudio-master.sh @@ -17,7 +17,8 @@ # adwaitaicons | gtk, rsvg # gnomethemes | gtk, rsvg -DEPS="synfigcore-master gtkmm-3.14.0 adwaitaicontheme-3.15.1 gnomethemesstandard-3.15.2" +DEPS="synfigcore-master gtkmm-3.22.0 adwaitaicontheme-3.22.0 gnomethemesstandard-3.22.2" +DEPS_NATIVE="synfigcore-master" PK_DIRNAME="synfig" PK_URL="https://github.com/synfig/$PK_DIRNAME.git" @@ -32,6 +33,7 @@ pkbuild() { if ! check_packet_function $NAME build.configure; then ./bootstrap.sh || return 1 ./configure \ + --host=$HOST \ --prefix=$INSTALL_PACKET_DIR \ --sysconfdir=$INSTALL_PACKET_DIR/etc \ || return 1 diff --git a/docker-builder-data/build/script/packet/theora-1.1.1.files/configure.patch b/docker-builder-data/build/script/packet/theora-1.1.1.files/configure.patch new file mode 100644 index 0000000..14e725b --- /dev/null +++ b/docker-builder-data/build/script/packet/theora-1.1.1.files/configure.patch @@ -0,0 +1,4 @@ +8628c8628 +< archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +--- +> archive_expsym_cmds='if [[ "x`$SED 1q $export_symbols`" = xEXPORTS* ]]; then diff --git a/docker-builder-data/build/script/packet/theora-1.1.1.sh b/docker-builder-data/build/script/packet/theora-1.1.1.sh index 742237b..869c1ce 100644 --- a/docker-builder-data/build/script/packet/theora-1.1.1.sh +++ b/docker-builder-data/build/script/packet/theora-1.1.1.sh @@ -4,4 +4,24 @@ PK_DIRNAME="libtheora-1.1.1" PK_ARCHIVE="$PK_DIRNAME.tar.bz2" PK_URL="http://downloads.xiph.org/releases/theora/$PK_ARCHIVE" +PK_CONFIGURE_OPTIONS="--disable-examples" + source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +pkbuild() { + cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 + if ! check_packet_function $NAME build.cunfigure; then + cp --remove-destination "$UNPACK_PACKET_DIR/$PK_DIRNAME/configure" . + patch configure "$FILES_PACKET_DIR/configure.patch" + CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + ./configure \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ + || return 1 + set_done $NAME build.cunfigure + fi + if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + make -j${THREADS}; then + return 1 + fi +} diff --git a/docker-builder-data/build/script/packet/x264-master.sh b/docker-builder-data/build/script/packet/x264-master.sh index 4b1c6b9..9fa3777 100644 --- a/docker-builder-data/build/script/packet/x264-master.sh +++ b/docker-builder-data/build/script/packet/x264-master.sh @@ -1,4 +1,4 @@ -DEPS="yasm-1.3.0" +DEPS_NATIVE="yasm-1.3.0" PK_DIRNAME="x264" PK_URL="http://git.videolan.org/git/$PK_DIRNAME.git" diff --git a/docker-builder-data/build/script/packet/xmlpp-2.22.0.sh b/docker-builder-data/build/script/packet/xmlpp-2.22.0.sh index cf3bc4a..b0d0a8a 100644 --- a/docker-builder-data/build/script/packet/xmlpp-2.22.0.sh +++ b/docker-builder-data/build/script/packet/xmlpp-2.22.0.sh @@ -5,3 +5,27 @@ PK_ARCHIVE="$PK_DIRNAME.tar.gz" PK_URL="https://download.gnome.org/sources/libxml++/2.22/$PK_ARCHIVE" source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh + +pkbuild() { + cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 + if ! check_packet_function $NAME build.cunfigure; then + CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + ./configure \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ + || return 1 + set_done $NAME build.cunfigure + fi + + if [ "$PLATFORM" = "win" ]; then + if [ ! -f "libxml++/exceptions/exception.h.orig" ]; then + mv libxml++/exceptions/exception.h libxml++/exceptions/exception.h.orig + fi + cat libxml++/exceptions/exception.h.orig | sed -e 's/LIBXMLPP_API//g' > libxml++/exceptions/exception.h + fi + + if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" \ + make -j${THREADS}; then + return 1 + fi +} diff --git a/docker-builder-data/build/script/toolchain/none.sh b/docker-builder-data/build/script/toolchain/none.sh new file mode 100755 index 0000000..f76794d --- /dev/null +++ b/docker-builder-data/build/script/toolchain/none.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +export TOOLCHAIN_HOST=$INITIAL_HOST +export TOOLCHAIN_PATH=$INITIAL_PATH +export TOOLCHAIN_LD_LIBRARY_PATH=$INITIAL_LD_LIBRARY_PATH +export TOOLCHAIN_CC=$INITIAL_CC +export TOOLCHAIN_CXX=$INITIAL_CXX +export TOOLCHAIN_LDFLAGS=$INITIAL_LDFLAGS +export TOOLCHAIN_CFLAGS=$INITIAL_CFLAGS +export TOOLCHAIN_CPPFLAGS=$INITIAL_CPPFLAGS +export TOOLCHAIN_CXXFLAGS=$INITIAL_CXXFLAGS +export TOOLCHAIN_PKG_CONFIG_PATH=$INITIAL_PKG_CONFIG_PATH +export TOOLCHAIN_XDG_DATA_DIRS=$INITIAL_XDG_DATA_DIRS +export TOOLCHAIN_ACLOCAL_PATH=$INITIAL_ACLOCAL_PATH + diff --git a/docker-builder-data/build/script/toolchain/win-64.sh b/docker-builder-data/build/script/toolchain/win-64.sh new file mode 100755 index 0000000..441d48e --- /dev/null +++ b/docker-builder-data/build/script/toolchain/win-64.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +export TOOLCHAIN_HOST="x86_64-w64-mingw32" +export TOOLCHAIN_PATH="/usr/$TOOLCHAIN_HOST/bin:/usr/$TOOLCHAIN_HOST/sys-root/mingw/bin:$INITIAL_PATH" +export TOOLCHAIN_LD_LIBRARY_PATH="/usr/$TOOLCHAIN_HOST/sys-root/mingw/lib:$INITIAL_LD_LIBRARY_PATH" +export TOOLCHAIN_CC=/usr/bin/$TOOLCHAIN_HOST-gcc +export TOOLCHAIN_CXX=/usr/bin/$TOOLCHAIN_HOST-g++ +export TOOLCHAIN_LDFLAGS=" -L/usr/$TOOLCHAIN_HOST/sys-root/mingw/lib $INITIAL_LDFLAGS" +export TOOLCHAIN_CFLAGS=" -I/usr/$TOOLCHAIN_HOST/sys-root/mingw/include $INITIAL_CFLAGS" +export TOOLCHAIN_CPPFLAGS=" -I/usr/$TOOLCHAIN_HOST/sys-root/mingw/include $INITIAL_CPPFLAGS" +export TOOLCHAIN_CXXFLAGS=" -I/usr/$TOOLCHAIN_HOST/sys-root/mingw/include $INITIAL_CXXFLAGS" +export TOOLCHAIN_PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/$TOOLCHAIN_HOST/sys-root/mingw/lib/pkgconfig/" +export TOOLCHAIN_XDG_DATA_DIRS="$INITIAL_XDG_DATA_DIRS" +export TOOLCHAIN_ACLOCAL_PATH="$INITIAL_ACLOCAL_PATH" + diff --git a/docker/debian-7-32bit/run.sh b/docker/debian-7-32bit/run.sh index 31d58e5..6646346 100755 --- a/docker/debian-7-32bit/run.sh +++ b/docker/debian-7-32bit/run.sh @@ -9,20 +9,32 @@ 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 + source $CONFIG_FILE fi mkdir -p $PACKET_BUILD_DIR -docker stop "builder-i386" || true -docker rm "builder-i386" || true +export NATIVE_PLATFORM=debian +if [ -z "$PLATFORM" ]; then + export PLATFORM=linux +fi +if [ -z "$TASK" ]; then + export TASK=builder-$NATIVE_PLATFORM +fi +export INSTANCE=$TASK-$PLATFORM$ARCH +docker stop "$INSTANCE" || true +docker rm "$INSTANCE" || true docker run -it \ - --name "builder-i386" \ - $DOCKER_RUN_OPTIONS \ + --name "$INSTANCE" \ --privileged=true \ + $DOCKER_RUN_OPTIONS \ -v "$PACKET_BUILD_DIR:/build/packet" \ -v "$SCRIPT_BUILD_DIR:/build/script" \ - -e PLATFORM=linux-i386 \ + -e NATIVE_PLATFORM="$NATIVE_PLATFORM" \ + -e NATIVE_ARCH="$NATIVE_ARCH" \ + -e PLATFORM="$PLATFORM" \ + -e ARCH="$ARCH" \ + -e THREADS="$THREADS" \ morevna/build-debian-7-32 \ - setarch i686 /build/script/common/manager.sh "$@" + /build/script/common/manager.sh "$@" diff --git a/docker/debian-7-64bit/run.sh b/docker/debian-7-64bit/run.sh index 90460c2..0f09c32 100755 --- a/docker/debian-7-64bit/run.sh +++ b/docker/debian-7-64bit/run.sh @@ -13,15 +13,28 @@ if [ -f $CONFIG_FILE ]; then fi mkdir -p $PACKET_BUILD_DIR -docker stop "builder" || true -docker rm "builder" || true +export NATIVE_PLATFORM=debian +if [ -z "$PLATFORM" ]; then + export PLATFORM=linux +fi +if [ -z "$TASK" ]; then + export TASK=builder-$NATIVE_PLATFORM +fi +export INSTANCE=$TASK-$PLATFORM$ARCH +docker stop "$INSTANCE" || true +docker rm "$INSTANCE" || true docker run -it \ - --name "builder" \ + --name "$INSTANCE" \ --privileged=true \ $DOCKER_RUN_OPTIONS \ -v "$PACKET_BUILD_DIR:/build/packet" \ -v "$SCRIPT_BUILD_DIR:/build/script" \ + -e NATIVE_PLATFORM="$NATIVE_PLATFORM" \ + -e NATIVE_ARCH="$NATIVE_ARCH" \ + -e PLATFORM="$PLATFORM" \ + -e ARCH="$ARCH" \ + -e THREADS="$THREADS" \ morevna/build-debian-7-64 \ /build/script/common/manager.sh "$@" diff --git a/docker/fedora-cross-win/Dockerfile b/docker/fedora-cross-win/Dockerfile index f224b41..026124e 100644 --- a/docker/fedora-cross-win/Dockerfile +++ b/docker/fedora-cross-win/Dockerfile @@ -36,8 +36,25 @@ RUN dnf -y install dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts # deps for synfig appimage RUN dnf -y install fuse fuse-libs bzip2 bzip2-libs libXdmcp -# additional deps for win-builds -RUN dnf -y install mingw64-zlib +# native build tools +RUN dnf -y install gcc gcc-c++ make automake autoconf flex +RUN dnf -y install bison +RUN dnf -y install zlib-devel +RUN dnf -y install libffi-devel +RUN dnf -y install libmount-devel +RUN dnf -y install python2-devel +RUN dnf -y install xorg-x11-util-macros +RUN dnf -y install mesa-libEGL-devel +RUN dnf -y install freetype-devel +RUN dnf -y install expat-devel +RUN dnf -y install libXi-devel +RUN dnf -y install dbus-devel +RUN dnf -y install libXtst-devel +RUN dnf -y install bzip2-devel + +# great! +RUN rm /usr/local/bin/synfig + #RUN groupadd -g 1111 konstantin && useradd -u 1111 -g konstantin konstantin diff --git a/docker/fedora-cross-win/run.sh b/docker/fedora-cross-win/run.sh index a8d0a7b..398e484 100755 --- a/docker/fedora-cross-win/run.sh +++ b/docker/fedora-cross-win/run.sh @@ -13,26 +13,28 @@ if [ -f $CONFIG_FILE ]; then fi mkdir -p $PACKET_BUILD_DIR -docker stop "builder" || true -docker rm "builder" || true - -if [ -z "$ARCH" ];then - export ARCH=64 +export NATIVE_PLATFORM=fedora +if [ -z "$PLATFORM" ]; then + export PLATFORM=win fi - -if [ -z "$PLATFORM" ];then - export PLATFORM=win-$ARCH +if [ -z "$TASK" ]; then + export TASK=builder-$NATIVE_PLATFORM fi +export INSTANCE=$TASK-$PLATFORM$ARCH - +docker stop "$INSTANCE" || true +docker rm "$INSTANCE" || true docker run -it \ - --name "builder" \ + --name "$INSTANCE" \ --privileged=true \ $DOCKER_RUN_OPTIONS \ -v "$PACKET_BUILD_DIR:/build/packet" \ -v "$SCRIPT_BUILD_DIR:/build/script" \ - -e ARCH="$ARCH" \ + -e NATIVE_PLATFORM="$NATIVE_PLATFORM" \ + -e NATIVE_ARCH="$NATIVE_ARCH" \ -e PLATFORM="$PLATFORM" \ + -e ARCH="$ARCH" \ + -e THREADS="$THREADS" \ morevna/build-fedora-cross-win \ /build/script/common/manager.sh "$@" diff --git a/docker/run.sh b/docker/run.sh index 38e70b4..1d68951 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,49 +1,11 @@ #!/bin/bash SCRIPT_DIR=$(cd `dirname "$0"`; pwd) -BASE_DIR=`dirname "$SCRIPT_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 -export PACKET_BUILD_DIR -mkdir -p $PACKET_BUILD_DIR - -if [ -z "${IMAGE}" ];then - export IMAGE=build-fedora-cross-win -fi - -if [ -z "$TASK" ];then - export TASK=synfig-win -fi - -if [ -z "$ARCH" ];then - export ARCH=64 +if [ "$PLATFORM" -eq "win" ]; then + "$SCRIPT_DIR/fedora-cross-win/run.sh" +elif [ "$ARCH" -eq "32" ]; then + "$SCRIPT_DIR/debian-7-32bit/run.sh" +else + "$SCRIPT_DIR/debian-7-64bit/run.sh" fi - - - -export INSTANCE="build-${TASK}-${ARCH}" - -# TODO: Automatically build image if not found - -docker stop "${INSTANCE}" || true -docker rm "${INSTANCE}" || true - - -docker run -it \ - --name "${INSTANCE}" \ - --privileged=true \ - $DOCKER_RUN_OPTIONS \ - -v "${PACKET_BUILD_DIR}:/build/packet" \ - -v "${SCRIPT_BUILD_DIR}:/build/script" \ - -e ARCH="$ARCH" \ - -e PLATFORM="$PLATFORM" \ - morevna/${IMAGE} \ - "$@"