Update dockerfile and cross_compile.sh

This commit is contained in:
Andrea Cavalli 2020-10-09 02:29:37 +02:00
parent 48551961e8
commit f02cec5fac
2 changed files with 32 additions and 32 deletions

View File

@ -68,10 +68,21 @@ RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/zlib_cross
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/java11_cross && \
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 && \
unzip /home/$UNAME/java11_cross/jdk.zip -d /home/$UNAME/java11_cross/ && \
mv /home/$UNAME/java11_cross/jdk-11.0.8+10/ /home/$UNAME/java11_cross/jdk
RUN cd /home/$UNAME/zlib_cross && \
export CC=x86_64-w64-mingw32-gcc-posix && \
nice -n 5 chrt -b 0 ./configure --prefix=/home/$UNAME/zlib_cross && \
nice -n 5 chrt -b 0 make -f win32/Makefile.gcc BINARY_PATH=/home/$UNAME/zlib_cross/bin INCLUDE_PATH=/home/$UNAME/zlib_cross/include LIBRARY_PATH=/home/$UNAME/zlib_cross/lib PREFIX=x86_64-w64-mingw32- install
RUN cd /home/$UNAME/openssl_cross && \
export CC="" && \
nice -n 5 chrt -b 0 ./Configure --cross-compile-prefix=x86_64-w64-mingw32- --prefix=/home/$UNAME/openssl_cross_dir --openssldir=/home/$UNAME/openssl_cross_dir mingw64 shared no-zlib no-comp && \
nice -n 5 chrt -b 0 make 2>&1 | tee make.log && \
nice -n 5 chrt -b 0 sudo make install
RUN cd /home/$UNAME/work

View File

@ -11,20 +11,6 @@ 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 /home/jenkins/zlib_cross
export CC=x86_64-w64-mingw32-gcc-posix
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 /home/jenkins/openssl_cross
export CC=
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 || true
# ====== Prepare TdLib
# Cross compilation preparation (also needed for split sources)
cd $TD_BUILD_DIR
@ -38,11 +24,11 @@ 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=/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 \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross_dir \
-DOPENSSL_LIBRARIES_DIR=/home/jenkins/openssl_cross_dir/lib \
-DOPENSSL_INCLUDE_DIR=/home/jenkins/openssl_cross_dir/include \
-DOPENSSL_CRYPTO_LIBRARY=/home/jenkins/openssl_cross_dir/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/home/jenkins/openssl_cross_dir/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 \
@ -77,11 +63,11 @@ 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=/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 \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross_dir \
-DOPENSSL_LIBRARIES_DIR=/home/jenkins/openssl_cross_dir/lib \
-DOPENSSL_INCLUDE_DIR=/home/jenkins/openssl_cross_dir/include \
-DOPENSSL_CRYPTO_LIBRARY=/home/jenkins/openssl_cross_dir/libcrypto-3-x64.dll \
-DOPENSSL_SSL_LIBRARY=/home/jenkins/openssl_cross_dir/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 \
@ -105,7 +91,10 @@ ccache -s
# ====== Copy output
cd $TDNATIVES_CPP_BUILD_DIR
mkdir -p $TDLIB_RESOURCES_OUTPUT_DIR
mv $TDNATIVES_BIN_DIR/$SRC_TDJNI_LIBNAME $TDLIB_RESOURCES_OUTPUT_DIR/$DEST_TDJNI_LIBNAME
mv /home/jenkins/zlib_cross/zlib1.dll $TDLIB_RESOURCES_OUTPUT_DIR/zlib1.dll
mv /home/jenkins/openssl_cross/libcrypto-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libcrypto-3-x64.dll
mv /home/jenkins/openssl_cross/libssl-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libssl-3-x64.dll
cp $TDNATIVES_BIN_DIR/$SRC_TDJNI_LIBNAME $TDLIB_RESOURCES_OUTPUT_DIR/$DEST_TDJNI_LIBNAME
cp /home/jenkins/zlib_cross/zlib1.dll $TDLIB_RESOURCES_OUTPUT_DIR/zlib1.dll
cp /home/jenkins/openssl_cross_dir/bin/libcrypto-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libcrypto-3-x64.dll
cp /home/jenkins/openssl_cross_dir/bin/libssl-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libssl-3-x64.dll
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll $TDLIB_RESOURCES_OUTPUT_DIR/libwinpthread-1.dll
cp /usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/libstdc++-6.dll $TDLIB_RESOURCES_OUTPUT_DIR/libstdc++-6.dll