Skip to content

Commit

Permalink
ci: build libiio from sources using libiio-v0
Browse files Browse the repository at this point in the history
- build from sources on Linux and Darwwin
- upgrade Python bindings to use version 3.11

Signed-off-by: Adrian Stanea <[email protected]>
  • Loading branch information
Adrian-Stanea committed Oct 20, 2023
1 parent b37eabb commit ac4af6f
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 64 deletions.
26 changes: 0 additions & 26 deletions CI/travis/before_install_darwin

This file was deleted.

44 changes: 44 additions & 0 deletions CI/travis/install_deps_darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh -e

TOP_DIR=$(pwd)
LIBIIO_VERSION=libiio-v0

. CI/travis/lib.sh

# 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
# libiio deps
brew_install_if_not_exists doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config
pip3 install sphinx

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
for file in $PACKAGE_TO_INSTALL ; do
sudo installer -pkg "${file}" -target /
done
# elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
# wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.pkg
# sudo installer -pkg ${LIBIIO_BRANCH}_latest_libiio${LDIST}.pkg -target /
fi

pip3 install wheel twine build virtualenv

# Install glog
echo "Building glog"
cd ${TOP_DIR}
git clone --branch v0.4.0 --depth 1 https://github.com/google/glog
mkdir -p glog/build_0_4_0 && cd glog/build_0_4_0
cmake ..
make
sudo make install

# Install libiio
echo "Building libiio - version $LIBIIO_VERSION"
cd ${TOP_DIR}
git clone https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION libiio
mkdir ./libiio/build && cd ./libiio/build
cmake ../
make
sudo make install

37 changes: 23 additions & 14 deletions CI/travis/before_install_linux → CI/travis/install_deps_linux
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/sh -e

TOP_DIR=$(pwd)
LIBIIO_VERSION=libiio-v0

. CI/travis/lib.sh

get_libiio_release() {
git clone https://github.com/analogdevicesinc/libiio && cd libiio
IIO_TAG=`git describe --tags $(git rev-list --tags --max-count=1)`
git checkout ${IIO_TAG}
IIO_TAG_SHA=${IIO_TAG}.g`git rev-parse --short HEAD`
wget https://github.com/analogdevicesinc/libiio/releases/download/${IIO_TAG}/libiio-${IIO_TAG_SHA}${LDIST}.deb
}

handle_centos() {
# FIXME: see about adding `libserialport-dev` from EPEL ; maybe libusb-1.0.0-devel...
yum -y groupinstall 'Development Tools'
Expand All @@ -27,9 +20,9 @@ handle_centos() {

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
sudo yum localinstall -y $PACKAGE_TO_INSTALL
elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
wget https://swdownloads.analog.com/cse/azure_builds/${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
sudo dpkg -i ./${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
# elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
# wget https://swdownloads.analog.com/cse/azure_builds/${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
# sudo dpkg -i ./${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
fi
}

Expand All @@ -45,14 +38,21 @@ handle_default() {
python3-dev python3-setuptools python3-pip python3-all \
debhelper devscripts fakeroot libserialport-dev swig dh-python

# libiio dependencies
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
libxml2-dev bison flex libcdk5-dev cmake \
libaio-dev libusb-1.0-0-dev \
libserialport-dev libavahi-client-dev \

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
sudo dpkg -i $PACKAGE_TO_INSTALL
elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
wget https://swdownloads.analog.com/cse/azure_builds/${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
sudo dpkg -i ./${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
# elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
# wget https://swdownloads.analog.com/cse/azure_builds/${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
# sudo dpkg -i ./${artifactName}_latest_${LIBIIO_BRANCH}_libiio.deb
fi

#Install glog
echo "Building glog"
cd ${TOP_DIR}
git clone --branch v0.4.0 --depth 1 https://github.com/google/glog
mkdir -p glog/build_0_4_0 && cd glog/build_0_4_0
Expand All @@ -61,6 +61,15 @@ handle_default() {
sudo make install

sudo pip3 install --upgrade pip stdeb argparse

# Install libiio
echo "Building libiio - version $LIBIIO_VERSION"
cd ${TOP_DIR}
git clone https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION libiio
mkdir ./libiio/build && cd ./libiio/build
cmake ../
make
sudo make install
}

handle_doxygen() {
Expand Down
2 changes: 1 addition & 1 deletion 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
27 changes: 4 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ parameters:
- name: pythonVersions
type: object
default:
- '3.10'
- '3.11'
- 3.10
- 3.9
- 3.8
- 3.7
Expand Down Expand Up @@ -59,17 +60,7 @@ 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
- script: ./CI/travis/install_deps_linux
displayName: "Install Dependencies"
- script: ./CI/travis/make_linux
displayName: "Build"
Expand Down Expand Up @@ -121,17 +112,7 @@ 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
- script: ./CI/travis/install_deps_darwin
displayName: "Install Dependencies"
condition: ne(variables['agentName'],'macOS_arm64')
- script: ./CI/travis/make_darwin
Expand Down

0 comments on commit ac4af6f

Please sign in to comment.