From b727d130b121847762ce94e95eaf369a2185036d Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Nov 22 2017 20:12:26 +0000 Subject: fix mingw --- diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index a08e5d6..b4342ca 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -1047,10 +1047,9 @@ native() { } native_at_place() { - local ARGS="$@" local LOCAL_ERROR=0 if [ ! -z "$IS_NATIVE" ]; then - $ARGS + "$@" else local WAS_PLATFORM=$PLATFORM local WAS_ARCH=$ARCH @@ -1062,7 +1061,7 @@ native_at_place() { set_environment_vars $NAME fi - $ARGS + "$@" LOCAL_ERROR=$? PLATFORM=$WAS_PLATFORM @@ -1098,6 +1097,18 @@ chain() { if ! "${@:CNT}"; then return 1; fi } +with_envvar() { + local LOCAL_ENVVAR_NAME="$1" + local LOCAL_ENVVAR_VALUE="$2" + local LOCAL_ENVVAR_PREV="${!LOCAL_ENVVAR_NAME}" + eval export $LOCAL_ENVVAR_NAME="$LOCAL_ENVVAR_VALUE" + if ! "${@:3}"; then + eval export $1="$LOCAL_ENVVAR_PREV" + return 1 + fi + eval export $1="$LOCAL_ENVVAR_PREV" +} + set_toolchain "$@" 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 882e3e4..8f88c2f 100644 --- a/docker-builder-data/build/script/include/inc-pkbuild-default.sh +++ b/docker-builder-data/build/script/include/inc-pkbuild-default.sh @@ -13,13 +13,13 @@ pkbuild() { return 1 fi - if ! check_packet_function $NAME build.cunfigure; then + if ! check_packet_function $NAME build.configure; then CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" LDFLAGS="$PK_LDFLAGS $LDFLAGS" \ ./configure \ - $PK_CONFIGURE_OPTIONS_DEFAULT \ - $PK_CONFIGURE_OPTIONS \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + $PK_CONFIGURE_OPTIONS \ || return 1 - set_done $NAME build.cunfigure + set_done $NAME build.configure fi if ! CFLAGS="$PK_CFLAGS $CFLAGS" CPPFLAGS="$PK_CPPFLAGS $CPPFLAGS" LDFLAGS="$PK_LDFLAGS $LDFLAGS" \ diff --git a/docker-builder-data/build/script/include/inc-pkdownload-default.sh b/docker-builder-data/build/script/include/inc-pkdownload-default.sh index 63f6a26..bb57257 100644 --- a/docker-builder-data/build/script/include/inc-pkdownload-default.sh +++ b/docker-builder-data/build/script/include/inc-pkdownload-default.sh @@ -3,7 +3,7 @@ # PK_ARCHIVE pkdownload() { - if ! wget -c "$PK_URL" -O "$PK_ARCHIVE"; then - return 1 - fi + wget -c "$PK_URL" -O "$PK_ARCHIVE" \ + || curl "$PK_URL" -o "$PK_ARCHIVE" \ + || return 1 } diff --git a/docker-builder-data/build/script/toolchain/win-common.sh b/docker-builder-data/build/script/toolchain/win-common.sh index 57a5a89..92d5dad 100755 --- a/docker-builder-data/build/script/toolchain/win-common.sh +++ b/docker-builder-data/build/script/toolchain/win-common.sh @@ -15,49 +15,53 @@ # So no extra options for now TC_EXTRA_CPP_OPTIONS= -export TC_PATH="/usr/$TC_HOST/bin:/usr/$TC_HOST/sys-root/mingw/bin:$INITIAL_PATH" -export TC_LD_LIBRARY_PATH="/usr/$TC_HOST/sys-root/mingw/lib:$INITIAL_LD_LIBRARY_PATH" +TC_PREFIX="/usr/local/$TC_HOST/sys-root" +TC_BINPREFIX="$TC_PREFIX/bin/$TC_HOST" -export TC_ADDR2LINE=/usr/bin/$TC_HOST-addr2line -export TC_AS=/usr/bin/$TC_HOST-as -export TC_AR=/usr/bin/$TC_HOST-ar -export TC_CC=/usr/bin/$TC_HOST-gcc -export TC_CXXFILT=/usr/bin/$TC_HOST-c++filt -export TC_CXX=/usr/bin/$TC_HOST-c++ -export TC_CPP=/usr/bin/$TC_HOST-cpp -export TC_DLLTOOL=/usr/bin/$TC_HOST-dlltool -export TC_DLLWRAP=/usr/bin/$TC_HOST-dllwrap -export TC_ELFEDIT=/usr/bin/$TC_HOST-elfedit -export TC_FORTRAN=/usr/bin/$TC_HOST-gfortran -export TC_GXX=/usr/bin/$TC_HOST-g++ -export TC_GCC=/usr/bin/$TC_HOST-gcc -export TC_GCOV=/usr/bin/$TC_HOST-gcov -export TC_GCOV_TOOL=/usr/bin/$TC_HOST-gcov-tool -export TC_GFORTRAN=/usr/bin/$TC_HOST-gfortran -export TC_GPROF=/usr/bin/$TC_HOST-gprof -export TC_LD=/usr/bin/$TC_HOST-ld -export TC_LD_BFD=/usr/bin/$TC_HOST-ld.bfd -export TC_NM=/usr/bin/$TC_HOST-nm -export TC_OBJCOPY=/usr/bin/$TC_HOST-objcopy -export TC_OBJDUMP=/usr/bin/$TC_HOST-objdump -export TC_PKG_CONFIG=/usr/bin/$TC_HOST-pkg-config -export TC_RANLIB=/usr/bin/$TC_HOST-ranlib -export TC_READELF=/usr/bin/$TC_HOST-readelf -export TC_SIZE=/usr/bin/$TC_HOST-size -export TC_STRINGS=/usr/bin/$TC_HOST-strings -export TC_STRIP=/usr/bin/$TC_HOST-strip -export TC_WINDMC=/usr/bin/$TC_HOST-windmc -export TC_RC=/usr/bin/$TC_HOST-windres -export TC_WINDRES=/usr/bin/$TC_HOST-windres +export TC_PATH="$TC_PREFIX/bin:$INITIAL_PATH" +export TC_LD_LIBRARY_PATH="$TC_PREFIX/lib:/usr/local/lib:/usr/local/lib64:$INITIAL_LD_LIBRARY_PATH" -export TC_LDFLAGS=" -L/usr/$TC_HOST/sys-root/mingw/lib $INITIAL_LDFLAGS" +export TC_ADDR2LINE=$TC_BINPREFIX-addr2line +export TC_AS=$TC_BINPREFIX-as +export TC_AR=$TC_BINPREFIX-ar +export TC_CC=$TC_BINPREFIX-gcc +export TC_CXXFILT=$TC_BINPREFIX-c++filt +export TC_CXX=$TC_BINPREFIX-c++ +export TC_CPP=$TC_BINPREFIX-cpp +export TC_DLLTOOL=$TC_BINPREFIX-dlltool +export TC_DLLWRAP=$TC_BINPREFIX-dllwrap +export TC_ELFEDIT=$TC_BINPREFIX-elfedit +export TC_FORTRAN=$TC_BINPREFIX-gfortran +export TC_GXX=$TC_BINPREFIX-g++ +export TC_GCC=$TC_BINPREFIX-gcc +export TC_GCOV=$TC_BINPREFIX-gcov +export TC_GCOV_TOOL=$TC_BINPREFIX-gcov-tool +export TC_GFORTRAN=$TC_BINPREFIX-gfortran +export TC_GPROF=$TC_BINPREFIX-gprof +export TC_LD=$TC_BINPREFIX-ld +export TC_LD_BFD=$TC_BINPREFIX-ld.bfd +export TC_NM=$TC_BINPREFIX-nm +export TC_OBJCOPY=$TC_BINPREFIX-objcopy +export TC_OBJDUMP=$TC_BINPREFIX-objdump +export TC_RANLIB=$TC_BINPREFIX-ranlib +export TC_READELF=$TC_BINPREFIX-readelf +export TC_SIZE=$TC_BINPREFIX-size +export TC_STRINGS=$TC_BINPREFIX-strings +export TC_STRIP=$TC_BINPREFIX-strip +export TC_WINDMC=$TC_BINPREFIX-windmc +export TC_RC=$TC_BINPREFIX-windres +export TC_WINDRES=$TC_BINPREFIX-windres + +export TC_LDFLAGS=" -L$TC_PREFIX/lib $INITIAL_LDFLAGS" export TC_CFLAGS=" $TC_EXTRA_CPP_OPTIONS $INITIAL_CFLAGS" export TC_CPPFLAGS=" $TC_EXTRA_CPP_OPTIONS $INITIAL_CPPFLAGS" export TC_CXXFLAGS=" $TC_EXTRA_CPP_OPTIONS $INITIAL_CXXFLAGS" -export TC_PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/$TC_HOST/sys-root/mingw/lib/pkgconfig" -export TC_PKG_CONFIG_LIBDIR="/usr/$TC_HOST/sys-root/mingw/lib" +export TC_PKG_CONFIG_PATH="$TC_PREFIX/lib/pkgconfig" +export TC_PKG_CONFIG_LIBDIR="$TC_PREFIX/lib" export TC_XDG_DATA_DIRS="$INITIAL_XDG_DATA_DIRS" -export TC_CMAKE_INCLUDE_PATH="$INITIAL_CMAKE_INCLUDE_PATH" -export TC_CMAKE_LIBRARY_PATH="/usr/$TC_HOST/sys-root/mingw/lib:$INITIAL_CMAKE_LIBRARY_PATH" +export TC_CMAKE_INCLUDE_PATH="$TC_PREFIX/include:$INITIAL_CMAKE_INCLUDE_PATH" +export TC_CMAKE_LIBRARY_PATH="$TC_PREFIX/lib:$INITIAL_CMAKE_LIBRARY_PATH" +unset TC_BINPREFIX +unset TC_PREFIX unset TC_EXTRA_CPP_OPTIONS diff --git a/docker/debian-7-32bit/Dockerfile b/docker/debian-7-32bit/Dockerfile index 634772a..7a21140 100644 --- a/docker/debian-7-32bit/Dockerfile +++ b/docker/debian-7-32bit/Dockerfile @@ -64,5 +64,8 @@ RUN apt-get -yq install libegl1-mesa-dev RUN apt-get -yq install libdirectfb-dev RUN apt-get -yq install libxcursor-dev +# wget cannot check SSL-certificate for some sites +RUN apt-get -yq install curl + # build dir RUN mkdir /build diff --git a/docker/debian-7-64bit/Dockerfile b/docker/debian-7-64bit/Dockerfile index 7680806..345e4e1 100644 --- a/docker/debian-7-64bit/Dockerfile +++ b/docker/debian-7-64bit/Dockerfile @@ -68,5 +68,11 @@ RUN apt-get -yq install libegl1-mesa-dev RUN apt-get -yq install libdirectfb-dev RUN apt-get -yq install libxcursor-dev +# wget cannot check SSL-certificate for some sites +RUN apt-get -yq install curl + +# for synfigstudio-nsis +RUN apt-get -yq install unzip + # build dir RUN mkdir /build diff --git a/docker/debian-7-64bit/files/install-mingw.sh b/docker/debian-7-64bit/files/install-mingw.sh index e9561c2..8fec17f 100755 --- a/docker/debian-7-64bit/files/install-mingw.sh +++ b/docker/debian-7-64bit/files/install-mingw.sh @@ -116,6 +116,7 @@ install_gcc() { --target="$ARCH" \ --disable-multilib \ --enable-shared \ + --enable-threads=posix \ --with-sysroot="/usr/local/$ARCH/sys-root" \ --prefix="/usr/local/$ARCH/sys-root" touch "configure.done" @@ -162,22 +163,20 @@ finish_gcc() { cd ../../.. } -install_libmangle() { +install_library() { local ARCH="$1" + local NAME="$2" export PATH="/usr/local/$ARCH/sys-root/bin:$INITIAL_PATH" - mkdir -p "install-mingw/build/libmangle-$ARCH" - cd "install-mingw/build/libmangle-$ARCH" + mkdir -p "install-mingw/build/mingw-$NAME-$ARCH" + cd "install-mingw/build/mingw-$NAME-$ARCH" if [ ! -f "done" ]; then - echo && echo "install libmangle $ARCH" && echo + echo && echo "install library $NAME $ARCH" && echo if [ ! -f "configure.done" ]; then - "../../download/$DIR_MINGW/configure" \ + "../../download/$DIR_MINGW/mingw-w64-libraries/$NAME/configure" \ --host="$ARCH" \ - --without-headers \ - --without-crt \ - --with-libraries=libmangle \ - --with-tools=no \ --with-sysroot="/usr/local/$ARCH/sys-root" \ - --prefix="/usr/local/$ARCH/sys-root" + --prefix="/usr/local/$ARCH/sys-root" \ + ${@:3} touch "configure.done" fi make -j$THREADS || make @@ -187,22 +186,19 @@ install_libmangle() { cd ../../.. } -install_libs() { +install_tool() { local ARCH="$1" + local NAME="$2" export PATH="/usr/local/$ARCH/sys-root/bin:$INITIAL_PATH" - mkdir -p "install-mingw/build/libs-$ARCH" - cd "install-mingw/build/libs-$ARCH" + mkdir -p "install-mingw/build/mingw-$NAME-$ARCH" + cd "install-mingw/build/mingw-$NAME-$ARCH" if [ ! -f "done" ]; then - echo && echo "install libs $ARCH" && echo + echo && echo "install tool $NAME $ARCH" && echo if [ ! -f "configure.done" ]; then - "../../download/$DIR_MINGW/configure" \ - --host="$ARCH" \ - --without-headers \ - --without-crt \ - --with-libraries=winpthreads \ - --with-tools=all \ - --with-sysroot="/usr/local/$ARCH/sys-root" \ - --prefix="/usr/local/$ARCH/sys-root" + "../../download/$DIR_MINGW/mingw-w64-tools/$NAME/configure" \ + --target="$ARCH" \ + --prefix="/usr/local/$ARCH/sys-root" \ + ${@:3} touch "configure.done" fi make -j$THREADS || make @@ -296,9 +292,17 @@ install() { install_headers "$ARCH" install_gcc "$ARCH" install_crt "$ARCH" + install_library "$ARCH" "winpthreads" finish_gcc "$ARCH" - install_libmangle "$ARCH" - install_libs "$ARCH" + + install_library "$ARCH" "libmangle" + install_library "$ARCH" "winstorecompat" + install_tool "$ARCH" "gendef" + install_tool "$ARCH" "genidl" + install_tool "$ARCH" "genlib" + install_tool "$ARCH" "genpeimg" + install_tool "$ARCH" "widl" + install_iconv "$ARCH" install_gettext "$ARCH"