From 1710fcede159c3f90b565ae827c158a3bedfe001 Mon Sep 17 00:00:00 2001 From: Adrian Stanea Date: Mon, 9 Oct 2023 18:35:55 +0300 Subject: [PATCH] CI: fix builds for libiio-v0 dependencies - build libiio from sources based on old API for libiio-v0 Signed-off-by: Adrian Stanea --- CI/travis/before_install_darwin | 4 ++-- CI/travis/build_libiio_linux | 21 +++++++++++++++++++++ CI/travis/build_libiio_macOS | 24 ++++++++++++++++++++++++ CI/travis/lib.sh | 4 ++-- azure-pipelines.yml | 24 ++++-------------------- 5 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 CI/travis/build_libiio_linux create mode 100644 CI/travis/build_libiio_macOS diff --git a/CI/travis/before_install_darwin b/CI/travis/before_install_darwin index 8244b43e..e1880637 100755 --- a/CI/travis/before_install_darwin +++ b/CI/travis/before_install_darwin @@ -5,7 +5,7 @@ # Note: not installing 'mono', it comes with Azure images, # but it doesn't look it's installed with Homebrew -brew_install_if_not_exists cmake doxygen libusb libxml2 swig curl python +brew_install_if_not_exists cmake doxygen libusb libxml2 swig curl python ncurses cdk libserialport sphinx-doc pkg-config if [ -n "$PACKAGE_TO_INSTALL" ] ; then for file in $PACKAGE_TO_INSTALL ; do @@ -23,4 +23,4 @@ cmake .. make sudo make install -pip3 install wheel twine build virtualenv +pip3 install wheel twine build virtualenv sphinx diff --git a/CI/travis/build_libiio_linux b/CI/travis/build_libiio_linux new file mode 100644 index 00000000..c6227ffe --- /dev/null +++ b/CI/travis/build_libiio_linux @@ -0,0 +1,21 @@ +#!/bin/sh -e + +TOP_DIR=$(pwd) + +handle_default() { + echo $BUILD_TYPE + + cd ${TOP_DIR} + echo $LIBIIO_BRANCH + git clone --branch $LIBIIO_BRANCH https://github.com/analogdevicesinc/libiio + cd libiio + set -e + mkdir -p build && cd build + + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON -DWITH_MAN=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} + + make +} + +setup_build_type_env_vars +handle_default diff --git a/CI/travis/build_libiio_macOS b/CI/travis/build_libiio_macOS new file mode 100644 index 00000000..85a438a3 --- /dev/null +++ b/CI/travis/build_libiio_macOS @@ -0,0 +1,24 @@ +#!/bin/sh -e + +TOP_DIR=$(pwd) + +handle_default() { + brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config + pip3 install sphinx + + echo $BUILD_TYPE + + cd ${TOP_DIR} + echo $LIBIIO_BRANCH + git clone --branch $LIBIIO_BRANCH https://github.com/analogdevicesinc/libiio + cd libiio + set -e + mkdir -p build && cd build + + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON -DWITH_ZSTD=OFF + sudo make install + cd .. +} + +setup_build_type_env_vars +handle_default diff --git a/CI/travis/lib.sh b/CI/travis/lib.sh index 7fea98d6..da2a6db1 100644 --- a/CI/travis/lib.sh +++ b/CI/travis/lib.sh @@ -2,7 +2,7 @@ TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-'./'} -LIBIIO_BRANCH=master +LIBIIO_BRANCH=libiio-v0 command_exists() { local cmd=$1 @@ -35,7 +35,7 @@ ensure_command_exists sudo # Get the common stuff from libiio [ -f ${TRAVIS_BUILD_DIR}/build/lib.sh ] || { mkdir -p ${TRAVIS_BUILD_DIR}/build - wget https://raw.githubusercontent.com/analogdevicesinc/libiio/master/CI/travis/lib.sh \ + wget https://raw.githubusercontent.com/analogdevicesinc/libiio/$LIBIIO_BRANCH/CI/travis/lib.sh \ -O ${TRAVIS_BUILD_DIR}/build/lib.sh } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1980ebed..3caea32d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,18 +59,10 @@ jobs: fetchDepth: 1 clean: true persistCredentials: true - - task: DownloadPipelineArtifact@2 - displayName: 'Get libiio artifacts' - inputs: - source: 'specific' - project: '$(AnalogDevices_OpenSource_GUID)' - pipeline: $(libiioPipelineId) - artifact: '$(artifactName)' - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' - path: '$(Agent.BuildDirectory)/s/build/' - script: ./CI/travis/before_install_linux displayName: "Install Dependencies" + - script: ./CI/travis/build_libiio_linux + displayName: 'Build libiio sources' - script: ./CI/travis/make_linux displayName: "Build" - task: CopyFiles@2 @@ -121,19 +113,11 @@ jobs: - checkout: self fetchDepth: 1 clean: true - - task: DownloadPipelineArtifact@2 - displayName: 'Get libiio artifacts' - inputs: - source: 'specific' - project: '$(AnalogDevices_OpenSource_GUID)' - pipeline: $(libiioPipelineId) - artifact: '$(artifactName)' - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' - path: '$(Agent.BuildDirectory)/s/build/' - script: ./CI/travis/before_install_darwin displayName: "Install Dependencies" condition: ne(variables['agentName'],'macOS_arm64') + - script: ./CI/travis/build_libiio_darwin + displayName: 'Build libiio sources' - script: ./CI/travis/make_darwin displayName: "Build" - ${{ each pyVersion in parameters.pythonVersions }}: