From 0a9ffd4c58e2f00939cc686d259fc02d82f644d9 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Sat, 10 Apr 2021 01:52:34 +0300 Subject: [PATCH] Compile Linux with vcpkg --- .github/workflows/linux.yml | 30 +++++++++++++++++++++--------- deploy/prepare_deployment.sh | 6 ++++++ linux/ci_configure_apps.sh | 9 ++++++++- linux/ci_configure_client.sh | 18 ++++++++++++++++++ linux/ci_configure_libs.sh | 18 ++++++++++++++++++ linux/update_vcpkg.sh | 22 +++++++++++----------- m4/libcurl.m4 | 3 +++ 7 files changed, 85 insertions(+), 21 deletions(-) create mode 100755 linux/ci_configure_client.sh create mode 100755 linux/ci_configure_libs.sh diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5409168123..d950de39b3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - type: [libs, server, client, apps, manager-with-webview, manager-without-webview, unit-test, integration-test] + type: [libs, client, apps, libs-vcpkg, client-vcpkg, apps-vcpkg, server, manager-with-webview, manager-without-webview, unit-test, integration-test] fail-fast: false steps: - uses: actions/checkout@v2 @@ -41,25 +41,37 @@ jobs: restore-keys: linux-${{ matrix.type }}- - name: Automake - if: ${{ success() }} + if: success() run: ./_autosetup - name: Configure libs - if: ${{ success() && matrix.type == 'libs' }} + if: success() && matrix.type == 'libs' run: ./configure --disable-server --disable-client --disable-manager - - name: Configure server - if: ${{ success() && matrix.type == 'server' }} - run: ./configure --enable-server --disable-client --disable-manager - - name: Configure client - if: ${{ success() && matrix.type == 'client' }} + if: success() && matrix.type == 'client' run: ./configure --disable-server --enable-client --disable-manager - name: Configure apps if: success() && matrix.type == 'apps' + run: ./configure --enable-apps --disable-server --disable-client --disable-manager + + - name: Configure vcpkg libs + if: success() && matrix.type == 'libs-vcpkg' + run: linux/ci_configure_libs.sh + + - name: Configure vcpkg client + if: success() && matrix.type == 'client-vcpkg' + run: linux/ci_configure_client.sh + + - name: Configure vcpkg apps + if: success() && matrix.type == 'apps-vcpkg' run: linux/ci_configure_apps.sh + - name: Configure server + if: success() && matrix.type == 'server' + run: ./configure --enable-server --disable-client --disable-manager + - name: Configure manager with webview if: success() && matrix.type == 'manager-with-webview' run: ./3rdParty/buildLinuxDependencies.sh && ./configure --disable-server --disable-client --with-wx-prefix=${GITHUB_WORKSPACE}/3rdParty/buildCache/linux @@ -85,7 +97,7 @@ jobs: run: ./integration_test/executeTestSuite.sh - name: Deploy to BinTray - if: ${{ success() && ! contains(matrix.type, 'libs') && ! contains(matrix.type, 'server') && ! contains(matrix.type, 'test') }} + if: success() && ! contains(matrix.type, 'libs') && ! contains(matrix.type, 'server') && ! contains(matrix.type, 'test') env: BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} PULL_REQUEST: ${{ github.event.number }} diff --git a/deploy/prepare_deployment.sh b/deploy/prepare_deployment.sh index fd618b5976..caaf58f6fc 100755 --- a/deploy/prepare_deployment.sh +++ b/deploy/prepare_deployment.sh @@ -192,6 +192,12 @@ case $TYPE in linux_apps) prepare_apps ;; + linux_client-vcpkg) + prepare_client + ;; + linux_apps-vcpkg) + prepare_apps + ;; linux_manager-with-webview) prepare_manager ;; diff --git a/linux/ci_configure_apps.sh b/linux/ci_configure_apps.sh index be8637d816..e943f97019 100755 --- a/linux/ci_configure_apps.sh +++ b/linux/ci_configure_apps.sh @@ -6,6 +6,13 @@ if [ ! -d "linux" ]; then exit 1 fi +CACHE_DIR="$PWD/3rdParty/buildCache/linux" +BUILD_DIR="$PWD/3rdParty/linux" +VCPKG_ROOT="$BUILD_DIR/vcpkg" +export VCPKG_DIR="$VCPKG_ROOT/installed/x64-linux" + linux/update_vcpkg.sh -./configure --enable-apps --enable-vcpkg --disable-server --disable-client --disable-manager +chmod +x "$VCPKG_DIR/share/curl/curl-config" +export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" +./configure --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --enable-apps --disable-server --disable-client --disable-manager diff --git a/linux/ci_configure_client.sh b/linux/ci_configure_client.sh new file mode 100755 index 0000000000..4f16550a3d --- /dev/null +++ b/linux/ci_configure_client.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +if [ ! -d "linux" ]; then + echo "start this script in the source root directory" + exit 1 +fi + +CACHE_DIR="$PWD/3rdParty/buildCache/linux" +BUILD_DIR="$PWD/3rdParty/linux" +VCPKG_ROOT="$BUILD_DIR/vcpkg" +export VCPKG_DIR="$VCPKG_ROOT/installed/x64-linux" + +linux/update_vcpkg.sh + +chmod +x "$VCPKG_DIR/share/curl/curl-config" +export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" +./configure --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --disable-server --enable-client --disable-manager diff --git a/linux/ci_configure_libs.sh b/linux/ci_configure_libs.sh new file mode 100755 index 0000000000..7570739370 --- /dev/null +++ b/linux/ci_configure_libs.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +if [ ! -d "linux" ]; then + echo "start this script in the source root directory" + exit 1 +fi + +CACHE_DIR="$PWD/3rdParty/buildCache/linux" +BUILD_DIR="$PWD/3rdParty/linux" +VCPKG_ROOT="$BUILD_DIR/vcpkg" +export VCPKG_DIR="$VCPKG_ROOT/installed/x64-linux" + +linux/update_vcpkg.sh + +chmod +x "$VCPKG_DIR/share/curl/curl-config" +export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" +./configure --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --disable-server --disable-client --disable-manager diff --git a/linux/update_vcpkg.sh b/linux/update_vcpkg.sh index d842db60e8..70d308af60 100755 --- a/linux/update_vcpkg.sh +++ b/linux/update_vcpkg.sh @@ -6,18 +6,18 @@ if [ ! -d "linux" ]; then exit 1 fi -cache_dir="$PWD/3rdParty/buildCache/linux" -build_dir="$PWD/3rdParty/linux" -vcpkg_root="$build_dir/vcpkg" +CACHE_DIR="$PWD/3rdParty/buildCache/linux" +BUILD_DIR="$PWD/3rdParty/linux" +VCPKG_ROOT="$BUILD_DIR/vcpkg" -export XDG_CACHE_HOME=$cache_dir/vcpkgcache +export XDG_CACHE_HOME=$CACHE_DIR/vcpkgcache -if [ ! -d $vcpkg_root ]; then - mkdir -p $build_dir - git -C $build_dir clone https://github.com/microsoft/vcpkg +if [ ! -d $VCPKG_ROOT ]; then + mkdir -p $BUILD_DIR + git -C $BUILD_DIR clone https://github.com/microsoft/vcpkg fi -git -C $vcpkg_root pull -$vcpkg_root/bootstrap-vcpkg.sh -$vcpkg_root/vcpkg install rappture --clean-after-build -$vcpkg_root/vcpkg upgrade --no-dry-run +git -C $VCPKG_ROOT pull +$VCPKG_ROOT/bootstrap-vcpkg.sh +$VCPKG_ROOT/vcpkg install rappture curl[core,openssl] --clean-after-build +$VCPKG_ROOT/vcpkg upgrade --no-dry-run diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index 45dd9b6b43..1b036fd10d 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -123,6 +123,9 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], powerpc-apple-darwin7*) LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` ;; + x86_64-pc-linux-gnu) + LIBCURL=`echo $LIBCURL -ldl` + ;; armv6-*) LIBCURL="-lcurl -lssl -lcrypto -lz -latomic" ;;