-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Raluca Groza <raluca.groza@analog.com>
- Loading branch information
Showing
2 changed files
with
158 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
uname -a | ||
|
||
install_sphinx() { | ||
python --version | ||
|
||
sudo python3 -m pip install sphinx | ||
sudo python3 -m pip install sphinx-rtd-theme furo | ||
} | ||
|
||
handle_centos() { | ||
# FIXME: see about adding `libserialport-dev` from EPEL ; maybe libusb-1.0.0-devel... | ||
yum -y groupinstall 'Development Tools' | ||
|
||
if is_centos_at_least_ver "8" ; then | ||
# On CentOS 8, avahi-devel & doxygen are in this repo; enable it | ||
yum -y install yum-utils | ||
yum config-manager --set-enabled powertools | ||
yum -y install python3 | ||
install_sphinx | ||
else | ||
yum -y install python3 | ||
install_sphinx | ||
fi | ||
|
||
# CMake has a bug when installed from repos. Must grab from kitware | ||
yum -y install wget | ||
wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz | ||
tar -zxvf cmake-3.15.2.tar.gz | ||
cd cmake-3.15.2 | ||
./bootstrap | ||
make | ||
make install | ||
cd .. | ||
|
||
# Need libzstd from EPEL | ||
yum -y install epel-release | ||
yum -y install libzstd | ||
|
||
yum -y install libxml2-devel libusb1-devel doxygen libaio-devel \ | ||
avahi-devel bzip2 gzip rpm rpm-build | ||
|
||
yum localinstall -y $PACKAGE_TO_INSTALL | ||
|
||
python3 -m pip install pylibiio --no-binary :all: | ||
|
||
# Build project | ||
mkdir -p build | ||
cd build | ||
sudo cmake -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON .. | ||
sudo make && make package && make test | ||
sudo make install | ||
ldconfig | ||
cd .. | ||
cd bindings/python | ||
sudo pip3 install -r requirements_dev.txt | ||
export LD_LIBRARY_PATH=/usr/local/lib/ | ||
sudo python3 -m pytest -vs --skip-scan | ||
} | ||
|
||
handle_default() { | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake doxygen graphviz \ | ||
libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev \ | ||
libxml2-dev rpm tar bzip2 gzip flex bison libserialport-dev \ | ||
python3 python3-pip python3-setuptools | ||
|
||
sudo dpkg -i $PACKAGE_TO_INSTALL | ||
|
||
sudo python3 -m pip install pylibiio --no-binary :all: | ||
install_sphinx | ||
|
||
# Build project | ||
mkdir -p build | ||
cd build | ||
sudo cmake -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON .. | ||
sudo make && make package && make test | ||
sudo make install | ||
ldconfig | ||
cd .. | ||
cd bindings/python | ||
sudo pip3 install -r requirements_dev.txt | ||
sudo python3 -m pytest -vs --skip-scan | ||
} | ||
|
||
handle_ubuntu() { | ||
handle_default | ||
} | ||
|
||
handle_debian() { | ||
handle_default | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters