Merge pull request #1357 from p12tic/2.3-build-fixes

[2.3.x] Backport build fixes
This commit is contained in:
Povilas Kanapickas 2021-11-01 21:31:30 +02:00 committed by GitHub
commit a3a354e664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 27 deletions

View File

@ -63,9 +63,15 @@ jobs:
artifactName: Windows Release Installer artifactName: Windows Release Installer
- job: LinuxBuild - job: LinuxBuild
strategy:
matrix:
ubuntu-18.04:
imageName: 'ubuntu-18.04'
ubuntu-20.04:
imageName: 'ubuntu-20.04'
displayName: Linux Build displayName: Linux Build
pool: pool:
vmImage: 'ubuntu-16.04' vmImage: $(imageName)
steps: steps:
- script: sudo apt-get update -y - script: sudo apt-get update -y
- script: sudo apt-get install -y libxtst-dev qtdeclarative5-dev libavahi-compat-libdnssd-dev libcurl4-openssl-dev - script: sudo apt-get install -y libxtst-dev qtdeclarative5-dev libavahi-compat-libdnssd-dev libcurl4-openssl-dev
@ -75,13 +81,22 @@ jobs:
- job: MacBuild - job: MacBuild
displayName: Mac Build displayName: Mac Build
pool:
vmImage: 'macOS-10.14'
strategy: strategy:
matrix: matrix:
Release: big-sur-Release:
B_BUILD_TYPE: Release imageName: "macOS-11"
BARRIER_VERSION_STAGE: Release B_BUILD_TYPE: Release
BARRIER_VERSION_STAGE: Release
catalina-Release:
imageName: "macOS-10.15"
B_BUILD_TYPE: Release
BARRIER_VERSION_STAGE: Release
mojave-Release:
imageName: "macOS-10.14"
B_BUILD_TYPE: Release
BARRIER_VERSION_STAGE: Release
pool:
vmImage: $(imageName)
variables: variables:
VERBOSE: 1 VERBOSE: 1
TERM: xterm-256color TERM: xterm-256color

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Use the same verbose variable as CMake # Use the same verbose variable as CMake
[ "$VERBOSE" == "1" ] && set -x [ "$VERBOSE" = "1" ] && set -x
# Exit on unset variables or pipe errors # Exit on unset variables or pipe errors
set -uo pipefail set -uo pipefail
@ -14,10 +14,10 @@ B_BARRIERC="Barrier.app/Contents/MacOS/barrierc"
B_BARRIERS="Barrier.app/Contents/MacOS/barriers" B_BARRIERS="Barrier.app/Contents/MacOS/barriers"
# Colorized output # Colorized output
function info() { tput bold; echo "$@" ; tput sgr0 ;} info() { tput bold; echo "$@"; tput sgr0 ; }
function error() { tput bold; tput setaf 1; echo "$@"; tput sgr0 ; } error() { tput bold; tput setaf 1; echo "$@"; tput sgr0 ; }
function success() { tput bold; tput setaf 2; echo "$@"; tput sgr0 ; } success() { tput bold; tput setaf 2; echo "$@"; tput sgr0 ; }
function warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; } warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; }
info "Checking for bundle contents" info "Checking for bundle contents"
if [ ! -d "Barrier.app/Contents" ]; then if [ ! -d "Barrier.app/Contents" ]; then
@ -40,7 +40,7 @@ if which -s port ; then
info "MacPorts found, searching for macdeployqt" info "MacPorts found, searching for macdeployqt"
DEPLOYQT="$(port contents qt5-qttools | grep --only --max-count 1 '/.*macdeployqt')" DEPLOYQT="$(port contents qt5-qttools | grep --only --max-count 1 '/.*macdeployqt')"
if [ ! -x "$DEPLOYQT" ]; then if [ ! -x "$DEPLOYQT" ]; then
error Please install package qt5-qttools error "Please install package qt5-qttools"
exit 1 exit 1
fi fi
fi fi
@ -48,15 +48,15 @@ fi
# Check for macdeployqt on Homebrew # Check for macdeployqt on Homebrew
if which -s brew ; then if which -s brew ; then
info "Homebrew found, searching for macdeployqt" info "Homebrew found, searching for macdeployqt"
DEPLOYQT="$(brew list qt | grep --only '/.*macdeployqt' | head -1)" DEPLOYQT="$(brew list qt@5 | grep --only '/.*macdeployqt' | head -1)"
if [ ! -x "$DEPLOYQT" ]; then if [ ! -x "$DEPLOYQT" ]; then
error Please install package qt error "Please install package qt"
exit 1 exit 1
fi fi
fi fi
# Use macdeployqt to include libraries and create dmg # Use macdeployqt to include libraries and create dmg
if [ "$B_BUILDTYPE" == "Release" ]; then if [ "$B_BUILDTYPE" = "Release" ]; then
info "Building Release disk image (dmg)" info "Building Release disk image (dmg)"
"$DEPLOYQT" Barrier.app -dmg \ "$DEPLOYQT" Barrier.app -dmg \
-executable="$B_BARRIERC" \ -executable="$B_BARRIERC" \
@ -70,4 +70,4 @@ else
-executable="$B_BARRIERC" \ -executable="$B_BARRIERC" \
-executable="$B_BARRIERS" || exit 1 -executable="$B_BARRIERS" || exit 1
success "Bundle created successfully" success "Bundle created successfully"
fi fi

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Checks if directory exists, otherwise asks to install package. # Checks if directory exists, otherwise asks to install package.
function check_dir_exists() { check_dir_exists() {
local path=$1 local path=$1
local package=$2 local package=$2
@ -11,7 +11,7 @@ function check_dir_exists() {
fi fi
} }
if [ ! $BARRIER_BUILD_ENV ]; then if [ -z "$BARRIER_BUILD_ENV" ]; then
check_dir_exists '/Applications/Xcode.app' 'Xcode' check_dir_exists '/Applications/Xcode.app' 'Xcode'
printf "Modifying environment for Barrier build...\n" printf "Modifying environment for Barrier build...\n"
@ -29,18 +29,15 @@ if [ ! $BARRIER_BUILD_ENV ]; then
elif command -v brew; then elif command -v brew; then
printf "Detected Homebrew\n" printf "Detected Homebrew\n"
QT_PATH=$(brew --prefix qt) QT_PATH=$(brew --prefix qt@5)
OPENSSL_PATH=$(brew --prefix openssl)
check_dir_exists "$QT_PATH" 'qt' check_dir_exists "$QT_PATH" 'qt5'
check_dir_exists "$OPENSSL_PATH" 'openssl'
export BARRIER_BUILD_BREW=1 export BARRIER_BUILD_BREW=1
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH" export CMAKE_PREFIX_PATH="/opt/procursus:$QT_PATH:$CMAKE_PREFIX_PATH"
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="/opt/procursus/lib:$LD_LIBRARY_PATH"
export CPATH="$OPENSSL_PATH/include:$CPATH" export CPATH="/opt/procursus/include:$CPATH"
export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="/opt/procursus/lib/pkgconfig:$PKG_CONFIG_PATH"
else else
printf "Neither Homebrew nor Macports is installed. Can't get dependency paths\n" printf "Neither Homebrew nor Macports is installed. Can't get dependency paths\n"
exit 1 exit 1