From bf8d1700f0b412241b9464e5bc689686ebe8be22 Mon Sep 17 00:00:00 2001 From: Adrian Stanea Date: Tue, 6 Aug 2024 15:35:16 +0300 Subject: [PATCH] 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 --- CI/macOS/install_deps | 117 ++++++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 39 deletions(-) diff --git a/CI/macOS/install_deps b/CI/macOS/install_deps index def74c07..d506fd46 100755 --- a/CI/macOS/install_deps +++ b/CI/macOS/install_deps @@ -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 .. \ No newline at end of file +install_packages +build_glog +build_libiio \ No newline at end of file