From: Ilya Shipitsin Date: Sat, 25 Feb 2017 18:00:04 +0000 (+0500) Subject: travis-ci: add 3 missing patches from master to release/2.4 X-Git-Tag: v2.4.4~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5852a035b444a41140a7fc7007b7df718a2e6c43;p=thirdparty%2Fopenvpn.git travis-ci: add 3 missing patches from master to release/2.4 travis-ci: add 'make distcheck' to test scenario, V2 in rare cases openvpn is built from tarball, it happens during "installer build" process. "make distcheck" helps to prevent problems during such builds. V2: limit "make distcheck" to one build configuration Signed-off-by: Ilya Shipitsin Acked-by: Steffan Karger Message-Id: <1488045604-25460-1-git-send-email-chipitsine@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14208.html Signed-off-by: Gert Doering (cherry picked from commit 56e6bd8967d72c4374389dfd5cf32f5e3b86242c) v4, travis-ci: add 2 mingw "build only" configurations Inspired by https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13032.html build options are taken from regular windows installer builds Signed-off-by: Ilya Shipitsin Acked-by: Steffan Karger Message-Id: <1494007697-6882-1-git-send-email-chipitsine@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14542.html Signed-off-by: David Sommerseth (cherry picked from commit 81ba70b39b78d7677aabab957421264800028f53) travis-ci: added gcc and clang openssl-1.1.0 builds openssl build script was modified according to official openssl manual: https://wiki.openssl.org/index.php/Compilation_and_Installation Acked-by: Steffan Karger Message-Id: <1497897488-15999-1-git-send-email-chipitsine@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14890.html Signed-off-by: Gert Doering (cherry picked from commit aeac1139a34321a7f770ca20bfef886a21a89fe9) --- diff --git a/.travis.yml b/.travis.yml index a68374ae1..db90e03a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,9 @@ env: global: - JOBS=3 - PREFIX="${HOME}/opt" + - TAP_WINDOWS_VERSION=9.21.2 + - LZO_VERSION=2.10 + - PKCS11_HELPER_VERSION=1.11 - MBEDTLS_VERSION="2.4.0" - MBEDTLS_CFLAGS="-I${PREFIX}/include" - MBEDTLS_LIBS="-L${PREFIX}/lib -lmbedtls -lmbedx509 -lmbedcrypto" @@ -24,16 +27,22 @@ matrix: - env: SSLLIB="openssl" os: linux compiler: gcc + - env: SSLLIB="openssl" OPENSSL_VERSION="1.1.0f" + os: linux + compiler: gcc - env: SSLLIB="openssl" os: linux compiler: clang + - env: SSLLIB="openssl" OPENSSL_VERSION="1.1.0f" + os: linux + compiler: clang - env: SSLLIB="mbedtls" os: linux compiler: gcc - env: SSLLIB="mbedtls" os: linux compiler: clang - - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto" + - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto" EXTRA_SCRIPT="make distcheck" os: linux compiler: clang - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-lzo" @@ -50,6 +59,12 @@ matrix: os: osx osx_image: xcode7.3 compiler: clang + - env: SSLLIB="openssl" CHOST=x86_64-w64-mingw32 + os: linux + compiler: ": Win64 build only" + - env: SSLLIB="openssl" CHOST=i686-w64-mingw32 + os: linux + compiler: ": Win32 build only" exclude: - compiler: gcc @@ -60,6 +75,7 @@ addons: - libpam0g-dev - liblz4-dev - linux-libc-dev + - man2html cache: ccache: true @@ -72,15 +88,8 @@ before_install: - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo; fi install: + - if [ ! -z "${CHOST}" ]; then unset CC; fi - .travis/build-deps.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1) script: - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"; fi - - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export DYLD_LIBRARY_PATH="${PREFIX}/lib:${DYLD_LIBRARY_PATH}"; fi - - autoreconf -vi - - ./configure --with-crypto-library="${SSLLIB}" ${EXTRA_CONFIG} || (cat config.log && exit 1) - - make -j$JOBS - - src/openvpn/openvpn --version || true - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ldd src/openvpn/openvpn; fi - - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then otool -L src/openvpn/openvpn; fi - - make check + - .travis/build-check.sh diff --git a/.travis/build-check.sh b/.travis/build-check.sh new file mode 100755 index 000000000..74f3ae10c --- /dev/null +++ b/.travis/build-check.sh @@ -0,0 +1,30 @@ +#!/bin/sh +set -eux + +if [ "${TRAVIS_OS_NAME}" = "linux" ]; then + export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH:-}" +fi + +if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + export DYLD_LIBRARY_PATH="${PREFIX}/lib:${DYLD_LIBRARY_PATH:-}" +fi + +autoreconf -vi + +if [ -z ${CHOST+x} ]; then + ./configure --with-crypto-library="${SSLLIB}" ${EXTRA_CONFIG:-} || (cat config.log && exit 1) + make -j$JOBS + src/openvpn/openvpn --version || true + if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ldd src/openvpn/openvpn; fi + if [ "${TRAVIS_OS_NAME}" = "osx" ]; then otool -L src/openvpn/openvpn; fi + make check + ${EXTRA_SCRIPT:-} +else + export TAP_CFLAGS="-I${PWD}/tap-windows-${TAP_WINDOWS_VERSION}/include" + export LZO_CFLAGS="-I${PREFIX}/include" + export LZO_LIBS="-L${PREFIX}/lib -llzo2" + export PKCS11_HELPER_LIBS="-L${PREFIX}/lib -lpkcs11-helper" + export PKCS11_HELPER_CFLAGS="-I${PREFIX}/include" + ./configure --with-crypto-library="${SSLLIB}" --host=${CHOST} --build=x86_64-pc-linux-gnu --enable-pkcs11 --disable-plugins || (cat config.log && exit 1) + make -j${JOBS} +fi diff --git a/.travis/build-deps.sh b/.travis/build-deps.sh index 3ffba0bc0..9cc18584f 100755 --- a/.travis/build-deps.sh +++ b/.travis/build-deps.sh @@ -4,6 +4,55 @@ set -eux # Set defaults PREFIX="${PREFIX:-${HOME}/opt}" +download_tap_windows () { + if [ ! -f "download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip" ]; then + wget -P download-cache/ \ + "http://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip" + fi +} + +download_lzo () { + if [ ! -f "download-cache/lzo-${LZO_VERSION}.tar.gz" ]; then + wget -P download-cache/ \ + "http://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz" + fi +} + +build_lzo () { + if [ "$(cat ${PREFIX}/.lzo-version)" != "${LZO_VERSION}" ]; then + tar zxf download-cache/lzo-${LZO_VERSION}.tar.gz + ( + cd "lzo-${LZO_VERSION}" + + ./configure --host=${CHOST} --program-prefix='' \ + --libdir=${PREFIX}/lib --prefix=${PREFIX} --build=x86_64-pc-linux-gnu + make all install + ) + echo "${LZO_VERSION}" > "${PREFIX}/.lzo-version" + fi +} + +download_pkcs11_helper () { + if [ ! -f "pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.bz2" ]; then + wget -P download-cache/ \ + "http://downloads.sourceforge.net/project/opensc/pkcs11-helper/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.bz2" + fi +} + +build_pkcs11_helper () { + if [ "$(cat ${PREFIX}/.pkcs11_helper-version)" != "${PKCS11_HELPER_VERSION}" ]; then + tar jxf download-cache/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.bz2 + ( + cd "pkcs11-helper-${PKCS11_HELPER_VERSION}" + + ./configure --host=${CHOST} --program-prefix='' --libdir=${PREFIX}/lib \ + --prefix=${PREFIX} --build=x86_64-pc-linux-gnu --disable-crypto-engine-gnutls --disable-crypto-engine-nss + make all install + ) + echo "${PKCS11_HELPER_VERSION}" > "${PREFIX}/.pkcs11_helper-version" + fi +} + download_mbedtls () { if [ ! -f "download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz" ]; then wget -P download-cache/ \ @@ -31,27 +80,44 @@ download_openssl () { } build_openssl_linux () { - tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ( cd "openssl-${OPENSSL_VERSION}/" - ./config shared --openssldir="${PREFIX}" -DPURIFY + ./config shared --prefix="${PREFIX}" --openssldir="${PREFIX}" -DPURIFY make all install_sw ) } build_openssl_osx () { - tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ( cd "openssl-${OPENSSL_VERSION}/" ./Configure darwin64-x86_64-cc shared \ - --openssldir="${PREFIX}" -DPURIFY + --prefix="${PREFIX}" --openssldir="${PREFIX}" -DPURIFY make depend all install_sw ) } +build_openssl_mingw () { + ( + cd "openssl-${OPENSSL_VERSION}/" + + if [ "${CHOST}" = "i686-w64-mingw32" ]; then + export TARGET=mingw + elif [ "${CHOST}" = "x86_64-w64-mingw32" ]; then + export TARGET=mingw64 + fi + + ./Configure --cross-compile-prefix=${CHOST}- shared \ + ${TARGET} no-multilib no-capieng --prefix="${PREFIX}" --openssldir="${PREFIX}" -static-libgcc + make install + ) +} + build_openssl () { if [ "$(cat ${PREFIX}/.openssl-version)" != "${OPENSSL_VERSION}" ]; then - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" + if [ ! -z ${CHOST+x} ]; then + build_openssl_mingw + elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then build_openssl_osx elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then build_openssl_linux @@ -61,16 +127,25 @@ build_openssl () { } # Enable ccache -if [ "${TRAVIS_OS_NAME}" != "osx" ]; then +if [ "${TRAVIS_OS_NAME}" != "osx" ] && [ -z ${CHOST+x} ]; then # ccache not available on osx, see: # https://github.com/travis-ci/travis-ci/issues/5567 + # also ccache not enabled for cross builds mkdir -p "${HOME}/bin" ln -s "$(which ccache)" "${HOME}/bin/${CC}" PATH="${HOME}/bin:${PATH}" fi +if [ ! -z ${CHOST+x} ]; then + # + # openvpn requires at least mingw-gcc-4.9, which is available at xenial repo + # + sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu xenial main universe" + sudo apt-get update + sudo apt-get -y install dpkg mingw-w64 +fi + # Download and build crypto lib -mkdir -p download-cache if [ "${SSLLIB}" = "openssl" ]; then download_openssl build_openssl @@ -81,3 +156,16 @@ else echo "Invalid crypto lib: ${SSLLIB}" exit 1 fi + +# Download and build dependencies for mingw cross build +# dependencies are the same as in regular windows installer build +if [ ! -z ${CHOST+x} ]; then + download_tap_windows + unzip download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip + + download_lzo + build_lzo + + download_pkcs11_helper + build_pkcs11_helper +fi