-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/macOS: refactor dependecies installation file
- This commit added setuptools pip package that was missing in newer versions. This caused the installation process of libiio to fail. Signed-off-by: Adrian Stanea <[email protected]>
- Loading branch information
1 parent
8daaf2e
commit bf8d170
Showing
1 changed file
with
78 additions
and
39 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 |
---|---|---|
@@ -1,44 +1,83 @@ | ||
#!/bin/sh -e | ||
|
||
TOP_DIR=$(pwd) | ||
set -ex | ||
|
||
LIBIIO_VERSION=libiio-v0 | ||
GLOG_VERSION=v0.4.0 | ||
|
||
set -ex | ||
WORKDIR=$(pwd) | ||
|
||
install_packages() { | ||
echo "### Installing packages" | ||
|
||
echo "#### Installing brew packages" | ||
BREW_LIBIIO="doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config" | ||
BREW_LIBM2K="cmake doxygen libusb libxml2 swig curl python" | ||
PACKAGES="$BREW_LIBIIO $BREW_LIBM2K" | ||
brew update | ||
brew upgrade || true # ignore upgrade errors | ||
brew install --display-times $PACKAGES | ||
|
||
echo "#### Installing pip packages" | ||
PIP_LIBIIO="sphinx setuptools" | ||
PIP_LIBM2K="wheel twine build virtualenv" | ||
PACKAGES="$PIP_LIBIIO $PIP_LIBM2K" | ||
pip3 install $PACKAGES | ||
} | ||
|
||
build_glog() { | ||
echo "### Building glog - version $GLOG_VERSION" | ||
git clone https://github.com/google/glog -b $GLOG_VERSION "${WORKDIR}"/glog | ||
|
||
cd "${WORKDIR}"/glog | ||
mkdir -p build_"${GLOG_VERSION}" && cd build_"${GLOG_VERSION}" | ||
cmake "${WORKDIR}"/glog | ||
make | ||
sudo make install | ||
cd "${WORKDIR}" | ||
} | ||
|
||
build_libiio() { | ||
echo "### Building libiio - version $LIBIIO_VERSION" | ||
git clone https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION "${WORKDIR}"/libiio | ||
|
||
echo "#### Building: .pkg" | ||
cd "${WORKDIR}"/libiio | ||
mkdir -p build && cd build | ||
cmake "${WORKDIR}"/libiio \ | ||
-Werror=dev \ | ||
-DCOMPILE_WARNING_AS_ERROR=ON \ | ||
-DOSX_PACKAGE=ON \ | ||
-DCPP_BINDINGS=ON \ | ||
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") \ | ||
-DPYTHON_BINDINGS=ON \ | ||
-DWITH_EXAMPLES=ON \ | ||
-DWITH_SERIAL_BACKEND=ON \ | ||
-DWITH_ZSTD=OFF | ||
make | ||
sudo make install | ||
|
||
echo "#### Building: .tar" | ||
cd "${WORKDIR}"/libiio | ||
mkdir -p build_tar && cd build_tar | ||
cmake "${WORKDIR}"/libiio \ | ||
-Werror=dev \ | ||
-DCOMPILE_WARNING_AS_ERROR=ON \ | ||
-DOSX_PACKAGE=OFF \ | ||
-DENABLE_PACKAGING=ON \ | ||
-DCPP_BINDINGS=ON \ | ||
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") \ | ||
-DPYTHON_BINDINGS=ON \ | ||
-DWITH_SERIAL_BACKEND=ON \ | ||
-DWITH_ZSTD=OFF \ | ||
-DCPACK_SYSTEM_NAME=${ARTIFACTNAME} | ||
make package | ||
mv ../CI/azure/macos_tar_fixup.sh . | ||
chmod +x macos_tar_fixup.sh | ||
./macos_tar_fixup.sh | ||
cd "${WORKDIR}" | ||
} | ||
|
||
# libiio deps | ||
brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config | ||
# libm2k deps | ||
brew install cmake doxygen libusb libxml2 swig curl | ||
|
||
pip3 install sphinx | ||
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 | ||
cd libiio | ||
## build .pkg | ||
mkdir 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 | ||
make | ||
sudo make install | ||
cd .. | ||
## built tar | ||
mkdir build_tar && cd build_tar | ||
cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -DWITH_ZSTD=OFF -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} | ||
make | ||
make package | ||
mv ../CI/azure/macos_tar_fixup.sh . | ||
chmod +x macos_tar_fixup.sh | ||
./macos_tar_fixup.sh | ||
cd .. | ||
install_packages | ||
build_glog | ||
build_libiio |