Update dockerfile and cross_compile.sh

This commit is contained in:
Andrea Cavalli 2020-10-08 03:44:13 +02:00
parent 2d541afbd0
commit 9a8b3d6e82
2 changed files with 42 additions and 38 deletions

View File

@ -57,18 +57,21 @@ ENV TRAVIS_OS_NAME=windows
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work
ENV TRAVIS_OUTPUT_DIR=/home/$UNAME/output
RUN sudo git clone --depth 1 https://github.com/openssl/openssl.git /var/lib/openssl_cross
RUN sudo chown -R $UNAME:$UNAME /var/lib/openssl_cross
RUN sudo rm -r /home/$UNAME/openssl_cross || true
RUN sudo git clone --depth 1 https://github.com/openssl/openssl.git /home/$UNAME/openssl_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/openssl_cross
RUN sudo git clone --depth 1 https://github.com/madler/zlib.git /var/lib/zlib_cross
RUN sudo chown -R $UNAME:$UNAME /var/lib/zlib_cross
RUN sudo rm -r /home/$UNAME/zlib_cross || true
RUN sudo git clone --depth 1 https://github.com/madler/zlib.git /home/$UNAME/zlib_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/zlib_cross
RUN sudo mkdir /var/lib/java11_cross
RUN sudo chown -R $UNAME:$UNAME /var/lib/java11_cross
RUN cd /var/lib/java11_cross
RUN wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_windows_hotspot_11.0.8_10.zip -O /var/lib/java11_cross/jdk.zip
RUN unzip /var/lib/java11_cross/jdk.zip -d /var/lib/java11_cross/
RUN mv /var/lib/java11_cross/jdk-11.0.8+10/ /var/lib/java11_cross/jdk
RUN sudo rm -r /home/$UNAME/java11_cross || true
RUN sudo mkdir /home/$UNAME/java11_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/java11_cross
RUN cd /home/$UNAME/java11_cross
RUN wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_windows_hotspot_11.0.8_10.zip -O /home/$UNAME/java11_cross/jdk.zip
RUN unzip /home/$UNAME/java11_cross/jdk.zip -d /home/$UNAME/java11_cross/
RUN mv /home/$UNAME/java11_cross/jdk-11.0.8+10/ /home/$UNAME/java11_cross/jdk
RUN cd /home/$UNAME/work

View File

@ -4,24 +4,25 @@ cd $TRAVIS_BUILD_DIR
source ./jenkins/scripts/setup_workspace.sh
export JAVA_HOME=/usr/lib/jvm/zulu-11-amd64
export JAVA_AWT_LIBRARY=/var/lib/java11_cross/jdk/lib/jawt.lib
export JAVA_JVM_LIBRARY=/var/lib/java11_cross/jdk/lib/jvm.lib
export JAVA_INCLUDE_PATH=/var/lib/java11_cross/jdk/include
export JAVA_INCLUDE_PATH2=/var/lib/java11_cross/jdk/include/win32
export JAVA_AWT_INCLUDE_PATH=/var/lib/java11_cross/jdk/include
export JAVA_AWT_LIBRARY=/home/jenkins/java11_cross/jdk/lib/jawt.lib
export JAVA_JVM_LIBRARY=/home/jenkins/java11_cross/jdk/lib/jvm.lib
export JAVA_INCLUDE_PATH=/home/jenkins/java11_cross/jdk/include
export JAVA_INCLUDE_PATH2=/home/jenkins/java11_cross/jdk/include/win32
export JAVA_AWT_INCLUDE_PATH=/home/jenkins/java11_cross/jdk/include
TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/toolchain-win64.cmake
# ====== Prepare dependencies
## Install zlib for windows
cd /var/lib/zlib_cross
cd /home/jenkins/zlib_cross
export CC=x86_64-w64-mingw32-gcc-posix
nice -n 5 chrt -b 0 ./configure --prefix=/var/lib/zlib_cross
nice -n 5 chrt -b 0 make -f win32/Makefile.gcc BINARY_PATH=/var/lib/zlib_cross/bin INCLUDE_PATH=/var/lib/zlib_cross/include LIBRARY_PATH=/var/lib/zlib_cross/lib PREFIX=x86_64-w64-mingw32- install
nice -n 5 chrt -b 0 ./configure --prefix=/home/jenkins/zlib_cross
nice -n 5 chrt -b 0 make -f win32/Makefile.gcc BINARY_PATH=/home/jenkins/zlib_cross/bin INCLUDE_PATH=/home/jenkins/zlib_cross/include LIBRARY_PATH=/home/jenkins/zlib_cross/lib PREFIX=x86_64-w64-mingw32- install
## Install openssl for windows
cd /var/lib/openssl_cross
cd /home/jenkins/openssl_cross
export CC=
nice -n 5 chrt -b 0 ./Configure --cross-compile-prefix=x86_64-w64-mingw32- --prefix=/var/lib/openssl_cross mingw64 shared
nice -n 5 chrt -b 0 ./Configure --cross-compile-prefix=x86_64-w64-mingw32- --prefix=/home/jenkins/openssl_cross mingw64 shared
nice -n 5 chrt -b 0 make 2>&1 | tee make.log
nice -n 5 chrt -b 0 sudo make install
# ====== Prepare TdLib
@ -37,15 +38,15 @@ nice -n 5 chrt -b 0 \
-DJAVA_JVM_LIBRARY=${JAVA_JVM_LIBRARY} \
-DJAVA_INCLUDE_PATH=${JAVA_INCLUDE_PATH} \
-DJAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2} \
-DOPENSSL_ROOT_DIR=/var/lib/openssl_cross \
-DOPENSSL_LIBRARIES_DIR=/var/lib/openssl_cross/lib \
-DOPENSSL_INCLUDE_DIR=/var/lib/openssl_cross/include \
-DOPENSSL_CRYPTO_LIBRARY=/var/lib/openssl_cross/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/var/lib/openssl_cross/libssl-3-x64.dll \
-DZLIB_ROOT=/var/lib/zlib_cross \
-DZLIB_LIBRARY=/var/lib/zlib_cross/zlib1.dll \
-DZLIB_LIBRARIES_DIR=/var/lib/zlib_cross \
-DZLIB_INCLUDE_DIR=/var/lib/zlib_cross/include \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross \
-DOPENSSL_LIBRARIES_DIR=/home/jenkins/openssl_cross/lib \
-DOPENSSL_INCLUDE_DIR=/home/jenkins/openssl_cross/include \
-DOPENSSL_CRYPTO_LIBRARY=/home/jenkins/openssl_cross/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/home/jenkins/openssl_cross/libssl-3-x64.dll \
-DZLIB_ROOT=/home/jenkins/zlib_cross \
-DZLIB_LIBRARY=/home/jenkins/zlib_cross/zlib1.dll \
-DZLIB_LIBRARIES_DIR=/home/jenkins/zlib_cross \
-DZLIB_INCLUDE_DIR=/home/jenkins/zlib_cross/include \
\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} \
@ -76,15 +77,15 @@ nice -n 5 chrt -b 0 \
-DJAVA_JVM_LIBRARY=${JAVA_JVM_LIBRARY} \
-DJAVA_INCLUDE_PATH=${JAVA_INCLUDE_PATH} \
-DJAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2} \
-DOPENSSL_ROOT_DIR=/var/lib/openssl_cross \
-DOPENSSL_LIBRARIES_DIR=/var/lib/openssl_cross/lib \
-DOPENSSL_INCLUDE_DIR=/var/lib/openssl_cross/include \
-DOPENSSL_CRYPTO_LIBRARY=/var/lib/openssl_cross/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/var/lib/openssl_cross/libssl-3-x64.dll \
-DZLIB_ROOT=/var/lib/zlib_cross \
-DZLIB_LIBRARY=/var/lib/zlib_cross/zlib1.dll \
-DZLIB_LIBRARIES_DIR=/var/lib/zlib_cross \
-DZLIB_INCLUDE_DIR=/var/lib/zlib_cross/include \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross \
-DOPENSSL_LIBRARIES_DIR=/home/jenkins/openssl_cross/lib \
-DOPENSSL_INCLUDE_DIR=/home/jenkins/openssl_cross/include \
-DOPENSSL_CRYPTO_LIBRARY=/home/jenkins/openssl_cross/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/home/jenkins/openssl_cross/libssl-3-x64.dll \
-DZLIB_ROOT=/home/jenkins/zlib_cross \
-DZLIB_LIBRARY=/home/jenkins/zlib_cross/zlib1.dll \
-DZLIB_LIBRARIES_DIR=/home/jenkins/zlib_cross \
-DZLIB_INCLUDE_DIR=/home/jenkins/zlib_cross/include \
\
-DCMAKE_BUILD_TYPE=Release \
-DTD_GENERATED_BINARIES_DIR=${TD_CROSS_BIN_DIR}/td/generate \