Skip to content

Commit

Permalink
CI: fix builds for libiio-v0 dependencies
Browse files Browse the repository at this point in the history
- build libiio from sources based on old API for libiio-v0

Signed-off-by: Adrian Stanea <Adrian.Stanea@analog.com>
  • Loading branch information
Adrian-Stanea committed Oct 9, 2023
1 parent b37eabb commit 59ec8a7
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 24 deletions.
4 changes: 2 additions & 2 deletions CI/travis/before_install_darwin
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,4 +23,4 @@ cmake ..
make
sudo make install

pip3 install wheel twine build virtualenv
pip3 install wheel twine build virtualenv sphinx
21 changes: 21 additions & 0 deletions CI/travis/build_libiio_linux
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions CI/travis/build_libiio_macOS
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions CI/travis/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-'./'}

LIBIIO_BRANCH=master
LIBIIO_BRANCH=libiio-v0

command_exists() {
local cmd=$1
Expand Down Expand Up @@ -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
}

Expand Down
47 changes: 27 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ 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: |
TOP_DIR=$(pwd)
LIBIIO_BRANCH=libiio-v0
cd ${TOP_DIR}
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
make
displayName: 'Build libiio sources'
- script: ./CI/travis/make_linux
displayName: "Build"
- task: CopyFiles@2
Expand Down Expand Up @@ -121,19 +122,25 @@ 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: |
brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config
pip3 install sphinx
TOP_DIR=$(pwd)
LIBIIO_BRANCH=libiio-v0
cd ${TOP_DIR}
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 ..
displayName: 'Build libiio sources'
- script: ./CI/travis/make_darwin
displayName: "Build"
- ${{ each pyVersion in parameters.pythonVersions }}:
Expand Down

0 comments on commit 59ec8a7

Please sign in to comment.