From 847902a05ce37b50f553dc13752471c6305e58c1 Mon Sep 17 00:00:00 2001 From: "Stanislav Lechev [0xAF]" Date: Mon, 5 Feb 2024 22:49:36 +0200 Subject: [PATCH] update for docker builds and buildall.sh script (#47) * upadte docker images * fix sdrplay api install on docker * update buildall.sh script to allow single package builds and multiarch --- buildall.sh | 270 ++++++++++++------ docker/deb_based/install-owrxp-extra.sh | 8 +- .../files/sdrplay/install-lib.aarch64.patch | 62 +++- docker/files/sdrplay/install-lib.x86_64.patch | 70 +++-- .../install-040-dependencies-sdrplay.sh | 6 +- 5 files changed, 291 insertions(+), 125 deletions(-) diff --git a/buildall.sh b/buildall.sh index e87753bf..c91adb81 100755 --- a/buildall.sh +++ b/buildall.sh @@ -6,101 +6,191 @@ # OUTPUT_DIR folder. # -BUILD_DIR=./owrx-build -OUTPUT_DIR=./owrx-output +set -euo pipefail -rm -rf ${BUILD_DIR} ${OUTPUT_DIR} -mkdir ${BUILD_DIR} ${OUTPUT_DIR} +GIT_CSDR=https://github.com/luarvique/csdr.git +GIT_PYCSDR=https://github.com/luarvique/pycsdr.git +GIT_OWRXCONNECTOR=https://github.com/luarvique/owrx_connector.git +GIT_CODECSERVER=https://github.com/jketterl/codecserver.git +GIT_DIGIHAM=https://github.com/jketterl/digiham.git +GIT_PYDIGIHAM=https://github.com/jketterl/pydigiham.git +GIT_JS8PY=https://github.com/jketterl/js8py.git +GIT_SOAPYSDRPLAY3=https://github.com/luarvique/SoapySDRPlay3.git +GIT_OPENWEBRX=https://github.com/luarvique/openwebrx.git + +BUILD_DIR=./owrx-build/`uname -m` +OUTPUT_DIR=./owrx-output/`uname -m` + +if [ "${1:-}" == "--ask" ]; then + echo;read -n1 -p "Build csdr? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_CSDR=y || BUILD_CSDR=n + echo;read -n1 -p "Build pycsdr? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_PYCSDR=y || BUILD_PYCSDR=n + echo;read -n1 -p "Build owrxconnector? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_OWRXCONNECTOR=y || BUILD_OWRXCONNECTOR=n + echo;read -n1 -p "Build codecserver? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_CODECSERVER=y || BUILD_CODECSERVER=n + echo;read -n1 -p "Build digiham? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_DIGIHAM=y || BUILD_DIGIHAM=n + echo;read -n1 -p "Build pydigiham? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_PYDIGIHAM=y || BUILD_PYDIGIHAM=n + echo;read -n1 -p "Build js8py? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_JS8PY=y || BUILD_JS8PY=n + echo;read -n1 -p "Build SoapySDRPlay3? [yN] " ret + [[ "$ret" == [Yy]* ]] && BUILD_SOAPYSDRPLAY3=y || BUILD_SOAPYSDRPLAY3=n + echo;read -n1 -p "Build OpenWebRX+? [Yn] " ret + [[ "$ret" == [Nn]* ]] && BUILD_OWRX=n || BUILD_OWRX=y + echo;read -n1 -p "Clean the Output folder? [yN] " ret + [[ "$ret" == [Yy]* ]] && CLEAN_OUTPUT=y || CLEAN_OUTPUT=n +else + # build all by default + BUILD_OWRX=y + BUILD_CSDR=y + BUILD_PYCSDR=y + BUILD_OWRXCONNECTOR=y + BUILD_SOAPYSDRPLAY3=y + BUILD_CODECSERVER=y + BUILD_DIGIHAM=y + BUILD_PYDIGIHAM=y + BUILD_JS8PY=y + CLEAN_OUTPUT=y +fi + +echo ====================================== +echo "Building:" +echo "csdr: $BUILD_CSDR" +echo "pycsdr: $BUILD_PYCSDR" +echo "owrx connector: $BUILD_OWRXCONNECTOR" +echo "codec server: $BUILD_CODECSERVER" +echo "digiham: $BUILD_DIGIHAM" +echo "pydigiham: $BUILD_PYDIGIHAM" +echo "js8py: $BUILD_JS8PY" +echo "Soapy SDRPlay3: $BUILD_SOAPYSDRPLAY3" +echo "OpenWebRx: $BUILD_OWRX" +echo "Clean OUTPUT folder: $CLEAN_OUTPUT" +echo ====================================== + +if [ "${1:-}" == "--ask" ]; then + read -p "Press [ENTER] to continue, or CTRL-C, to exit." +fi + +rm -rf ${BUILD_DIR} +if [ "${CLEAN_OUTPUT:-}" == "y" ]; then + rm -rf ${OUTPUT_DIR} +fi + +mkdir -p ${BUILD_DIR} ${OUTPUT_DIR} pushd ${BUILD_DIR} -echo "##### Cloning GIT repositories to ${BUILD_DIR} ... #####" -git clone -b master https://github.com/luarvique/csdr.git -git clone -b master https://github.com/luarvique/pycsdr.git -git clone -b master https://github.com/luarvique/owrx_connector.git -git clone -b master https://github.com/luarvique/openwebrx.git -git clone -b master https://github.com/luarvique/SoapySDRPlay3.git -git clone -b master https://github.com/jketterl/codecserver.git -git clone -b master https://github.com/jketterl/digiham.git -git clone -b master https://github.com/jketterl/pydigiham.git -git clone -b master https://github.com/jketterl/js8py.git - -echo "##### Building CSDR... #####" -pushd csdr -dpkg-buildpackage -us -uc -popd -# PyCSDR and OWRX-Connector builds depend on the latest CSDR -sudo dpkg -i csdr*.deb libcsdr*.deb nmux*.deb - -echo "##### Building PyCSDR... #####" -pushd pycsdr -dpkg-buildpackage -us -uc -popd -# OpenWebRX build depends on the latest PyCSDR -sudo dpkg -i python3-csdr*.deb - -echo "##### Building OWRX-Connector... #####" -pushd owrx_connector -dpkg-buildpackage -us -uc -popd -# Not installing OWRX-Connectors here since there are no -# further build steps depending on it -#sudo dpkg -i *connector*.deb - -echo "##### Building CodecServer... #####" -pushd codecserver -dpkg-buildpackage -us -uc -popd -# Not installing CodecServer here since there are no -# further build steps depending on it -#sudo dpkg -i *codecserver*.deb - -echo "##### Building DigiHAM... #####" -pushd digiham -dpkg-buildpackage -us -uc -popd -# PyDigiHAM build depends on the latest DigiHAM -sudo dpkg -i *digiham*.deb - -echo "##### Building PyDigiHAM... #####" -pushd pydigiham -dpkg-buildpackage -us -uc -popd -# Not installing PyDigiHAM here since there are no further -# build steps depending on it -#sudo dpkg -i python3-digiham*.deb - -echo "##### Building JS8Py... #####" -pushd js8py -dpkg-buildpackage -us -uc -popd -# Not installing JS8Py here since there are no further -# build steps depending on it -#sudo dpkg -i *js8py*.deb - -echo "##### Building OpenWebRX... #####" -pushd openwebrx -dpkg-buildpackage -us -uc -popd -# Not installing OpenWebRX here since there are no further -# build steps depending on it -#sudo dpkg -i openwebrx*.deb - -pushd SoapySDRPlay3 -# Debian Bullseye uses SoapySDR v0.7 -HAVE_SOAPY=`apt-cache search libsoapysdr0.7` -if [ ! -z "${HAVE_SOAPY}" ] ; then - echo "##### Building SoapySDRPlay3 v0.7 (Debian) ... #####" - cp debian/control.debian debian/control - dpkg-buildpackage -us -uc +if [ "${BUILD_CSDR:-}" == "y" ] || [ "${BUILD_PYCSDR:-}" == "y" ] || [ "${BUILD_OWRXCONNECTOR:-}" == "y" ]; then + echo "##### Building CSDR... #####" + git clone -b master "$GIT_CSDR" + pushd csdr + if [ `gcc -dumpversion` -gt 10 ]; then + # fix armhf builds on gcc>=11 (bookworm) + sed -i 's/-march=armv7-a /-march=armv7-a+fp /g' CMakeLists.txt + fi + dpkg-buildpackage -us -uc + popd + # PyCSDR and OWRX-Connector builds depend on the latest CSDR + sudo dpkg -i csdr*.deb libcsdr*.deb nmux*.deb fi -# Ubuntu Jammy uses SoapySDR v0.8 -HAVE_SOAPY=`apt-cache search libsoapysdr0.8` -if [ ! -z "${HAVE_SOAPY}" ] ; then - echo "##### Building SoapySDRPlay3 v0.8 (Ubuntu) ... #####" - cp debian/control.ubuntu debian/control - dpkg-buildpackage -us -uc + +if [ "${BUILD_PYCSDR:-}" == "y" ]; then + echo "##### Building PyCSDR... #####" + git clone -b master "$GIT_PYCSDR" + pushd pycsdr + dpkg-buildpackage -us -uc + popd + # OpenWebRX build depends on the latest PyCSDR + sudo dpkg -i python3-csdr*.deb fi -popd + +if [ "${BUILD_OWRXCONNECTOR:-}" == "y" ]; then + echo "##### Building OWRX-Connector... #####" + git clone -b master "$GIT_OWRXCONNECTOR" + pushd owrx_connector + dpkg-buildpackage -us -uc + popd + # Not installing OWRX-Connectors here since there are no + # further build steps depending on it + #sudo dpkg -i *connector*.deb +fi + +if [ "${BUILD_CODECSERVER:-}" == "y" ]; then + echo "##### Building CodecServer... #####" + git clone -b master "$GIT_CODECSERVER" + pushd codecserver + dpkg-buildpackage -us -uc + popd + # Digiham depends on libcodecserver-dev + sudo dpkg -i libcodecserver_*.deb codecserver_*.deb libcodecserver-dev_*.deb +fi + +if [ "${BUILD_DIGIHAM:-}" == "y" ] || [ "${BUILD_PYDIGIHAM:-}" == "y" ]; then + echo "##### Building DigiHAM... #####" + git clone -b master "$GIT_DIGIHAM" + pushd digiham + dpkg-buildpackage -us -uc + popd + # PyDigiHAM build depends on the latest DigiHAM + sudo dpkg -i *digiham*.deb +fi + +if [ "${BUILD_PYDIGIHAM:-}" == "y" ]; then + echo "##### Building PyDigiHAM... #####" + git clone -b master "$GIT_PYDIGIHAM" + pushd pydigiham + dpkg-buildpackage -us -uc + popd + # Not installing PyDigiHAM here since there are no further + # build steps depending on it + #sudo dpkg -i python3-digiham*.deb +fi + +if [ "${BUILD_JS8PY:-}" == "y" ]; then + echo "##### Building JS8Py... #####" + git clone -b master "$GIT_JS8PY" + pushd js8py + dpkg-buildpackage -us -uc + popd + # Not installing JS8Py here since there are no further + # build steps depending on it + #sudo dpkg -i *js8py*.deb +fi + +if [ "${BUILD_SOAPYSDRPLAY3:-}" == "y" ]; then + echo "##### Building SoapySDRPlay3 ... #####" + git clone -b master "$GIT_SOAPYSDRPLAY3" + pushd SoapySDRPlay3 + # Debian Bullseye uses SoapySDR v0.7 + HAVE_SOAPY=`apt-cache search libsoapysdr0.7` + if [ ! -z "${HAVE_SOAPY}" ] ; then + echo "##### Building SoapySDRPlay3 v0.7 (Debian) ... #####" + cp debian/control.debian debian/control + dpkg-buildpackage -us -uc + fi + # Ubuntu Jammy uses SoapySDR v0.8 + HAVE_SOAPY=`apt-cache search libsoapysdr0.8` + if [ ! -z "${HAVE_SOAPY}" ] ; then + echo "##### Building SoapySDRPlay3 v0.8 (Ubuntu) ... #####" + cp debian/control.ubuntu debian/control + dpkg-buildpackage -us -uc + fi + popd +fi + +if [ "${BUILD_OWRX:-}" == "y" ]; then + echo "##### Building OpenWebRX... #####" + git clone -b master "$GIT_OPENWEBRX" + pushd openwebrx + dpkg-buildpackage -us -uc + popd + # Not installing OpenWebRX here since there are no further + # build steps depending on it + #sudo dpkg -i openwebrx*.deb +fi + echo "##### Moving packages to ${OUTPUT_DIR} ... #####" popd diff --git a/docker/deb_based/install-owrxp-extra.sh b/docker/deb_based/install-owrxp-extra.sh index e3fed37c..15a6e26c 100755 --- a/docker/deb_based/install-owrxp-extra.sh +++ b/docker/deb_based/install-owrxp-extra.sh @@ -22,13 +22,15 @@ function cmakebuild() { export MARCH=native case `uname -m` in arm*) - SDRPLAY_BINARY=SDRplay_RSP_API-ARM32-3.07.2.run + #SDRPLAY_BINARY=SDRplay_RSP_API-ARM32-3.07.2.run + SDRPLAY_BINARY=SDRplay_RSP_API-Linux-3.14.0.run ;; aarch64*) - SDRPLAY_BINARY=SDRplay_RSP_API-ARM64-3.07.1.run + #SDRPLAY_BINARY=SDRplay_RSP_API-ARM64-3.07.1.run + SDRPLAY_BINARY=SDRplay_RSP_API-Linux-3.14.0.run ;; x86_64*) - SDRPLAY_BINARY=SDRplay_RSP_API-Linux-3.07.1.run + SDRPLAY_BINARY=SDRplay_RSP_API-Linux-3.07.2.run export MARCH=x86-64 ;; esac diff --git a/docker/files/sdrplay/install-lib.aarch64.patch b/docker/files/sdrplay/install-lib.aarch64.patch index 1f3dc57a..d4ce02b7 100644 --- a/docker/files/sdrplay/install-lib.aarch64.patch +++ b/docker/files/sdrplay/install-lib.aarch64.patch @@ -1,14 +1,12 @@ diff -ur sdrplay-orig/install_lib.sh sdrplay/install_lib.sh ---- sdrplay-orig/install_lib.sh 2020-05-24 14:30:06.022483867 +0000 -+++ sdrplay/install_lib.sh 2020-05-24 14:30:49.093435726 +0000 -@@ -4,19 +4,6 @@ - export MAJVERS="3" +--- sdrplay-orig/install_lib.sh 2024-02-05 00:33:32.563433411 +0200 ++++ sdrplay/install_lib.sh 2024-02-05 00:37:18.391679938 +0200 +@@ -17,18 +17,6 @@ + echo "the system files." + echo " " - echo "Installing SDRplay RSP API library ${VERS}..." -read -p "Press RETURN to view the license agreement" ret -- --more sdrplay_license.txt -- +-more -d sdrplay_license.txt -while true; do - echo "Press y and RETURN to accept the license agreement and continue with" - read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn @@ -18,6 +16,52 @@ diff -ur sdrplay-orig/install_lib.sh sdrplay/install_lib.sh - * ) echo "Please answer y or n";; - esac -done +- + echo " " + echo "A copy of the license agreement can be found here: ${HOME}/sdrplay_license.txt" + cp sdrplay_license.txt ${HOME}/. +@@ -255,43 +243,6 @@ + echo " " - export ARCH=`uname -m` + # 0--------1---------2---------3---------4---------5---------6---------7---------8 +-while true; do +- echo "To continue the installation with these defaults press y and RETURN" +- read -p "or press n and RETURN to change them [y/n] " yn +- case $yn in +- [Yy]* ) change="n";break;; +- [Nn]* ) change="y";break;; +- * ) echo "Please answer y or n";; +- esac +-done +- +-if [ "${change}" == "y" ]; then +- echo "Changing default locations..." +- read -p "API service location [${locservice}]: " newloc +- if [ "${newloc}" != "" ]; then +- locservice=${newloc} +- fi +- read -p "API header files location [${locheader}]: " newloc +- if [ "${newloc}" != "" ]; then +- locheader=${newloc} +- fi +- read -p "API shared library location [${loclib}]: " newloc +- if [ "${newloc}" != "" ]; then +- loclib=${newloc} +- fi +- +- echo "API service : ${locservice}" +- echo "API header files : ${locheader}" +- echo "API shared library : ${loclib}" +- while true; do +- read -p "Please confirm these are correct [y/n] " yn +- case $yn in +- [Yy]* ) break;; +- [Nn]* ) echo "paths not confirmed. Exiting...";exit 1;; +- * ) echo "Please answer y or n";; +- esac +- done +-fi + sudo mkdir -p -m 755 ${locservice} >> /dev/null 2>&1 + sudo mkdir -p -m 755 ${locheader} >> /dev/null 2>&1 +Only in sdrplay: install_lib.sh.org diff --git a/docker/files/sdrplay/install-lib.x86_64.patch b/docker/files/sdrplay/install-lib.x86_64.patch index d66023b0..d4ce02b7 100644 --- a/docker/files/sdrplay/install-lib.x86_64.patch +++ b/docker/files/sdrplay/install-lib.x86_64.patch @@ -1,14 +1,12 @@ diff -ur sdrplay-orig/install_lib.sh sdrplay/install_lib.sh ---- sdrplay-orig/install_lib.sh 2020-05-24 13:56:56.622000041 +0000 -+++ sdrplay/install_lib.sh 2020-05-24 13:58:51.837801559 +0000 -@@ -4,19 +4,6 @@ - MAJVERS="3" +--- sdrplay-orig/install_lib.sh 2024-02-05 00:33:32.563433411 +0200 ++++ sdrplay/install_lib.sh 2024-02-05 00:37:18.391679938 +0200 +@@ -17,18 +17,6 @@ + echo "the system files." + echo " " - echo "Installing SDRplay RSP API library ${VERS}..." -read -p "Press RETURN to view the license agreement" ret -- --more sdrplay_license.txt -- +-more -d sdrplay_license.txt -while true; do - echo "Press y and RETURN to accept the license agreement and continue with" - read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn @@ -18,22 +16,52 @@ diff -ur sdrplay-orig/install_lib.sh sdrplay/install_lib.sh - * ) echo "Please answer y or n";; - esac -done +- + echo " " + echo "A copy of the license agreement can be found here: ${HOME}/sdrplay_license.txt" + cp sdrplay_license.txt ${HOME}/. +@@ -255,43 +243,6 @@ + echo " " - ARCH=`uname -m` - OSDIST="Unknown" -@@ -157,15 +144,6 @@ - echo " " - echo "SDRplay API ${VERS} Installation Finished" - echo " " + # 0--------1---------2---------3---------4---------5---------6---------7---------8 -while true; do -- echo "Would you like to add SDRplay USB IDs to the local database for easier" -- read -p "identification in applications such as lsusb? [y/n] " yn +- echo "To continue the installation with these defaults press y and RETURN" +- read -p "or press n and RETURN to change them [y/n] " yn - case $yn in -- [Yy]* ) break;; -- [Nn]* ) exit;; +- [Yy]* ) change="n";break;; +- [Nn]* ) change="y";break;; - * ) echo "Please answer y or n";; - esac -done - sudo cp scripts/sdrplay_usbids.sh ${INSTALLBINDIR}/. - sudo chmod 755 ${INSTALLBINDIR}/sdrplay_usbids.sh - sudo cp scripts/sdrplay_ids.txt ${INSTALLBINDIR}/. +- +-if [ "${change}" == "y" ]; then +- echo "Changing default locations..." +- read -p "API service location [${locservice}]: " newloc +- if [ "${newloc}" != "" ]; then +- locservice=${newloc} +- fi +- read -p "API header files location [${locheader}]: " newloc +- if [ "${newloc}" != "" ]; then +- locheader=${newloc} +- fi +- read -p "API shared library location [${loclib}]: " newloc +- if [ "${newloc}" != "" ]; then +- loclib=${newloc} +- fi +- +- echo "API service : ${locservice}" +- echo "API header files : ${locheader}" +- echo "API shared library : ${loclib}" +- while true; do +- read -p "Please confirm these are correct [y/n] " yn +- case $yn in +- [Yy]* ) break;; +- [Nn]* ) echo "paths not confirmed. Exiting...";exit 1;; +- * ) echo "Please answer y or n";; +- esac +- done +-fi + + sudo mkdir -p -m 755 ${locservice} >> /dev/null 2>&1 + sudo mkdir -p -m 755 ${locheader} >> /dev/null 2>&1 +Only in sdrplay: install_lib.sh.org diff --git a/docker/scripts/install-040-dependencies-sdrplay.sh b/docker/scripts/install-040-dependencies-sdrplay.sh index 79da7f92..4886c179 100755 --- a/docker/scripts/install-040-dependencies-sdrplay.sh +++ b/docker/scripts/install-040-dependencies-sdrplay.sh @@ -28,13 +28,15 @@ if [[ -z ${1:-} ]]; then case $ARCH in x86_64) - BINARY=SDRplay_RSP_API-Linux-3.07.1.run + #BINARY=SDRplay_RSP_API-Linux-3.07.1.run + BINARY=SDRplay_RSP_API-Linux-3.14.0.run ;; armv*) BINARY=SDRplay_RSP_API-ARM32-3.07.2.run ;; aarch64) - BINARY=SDRplay_RSP_API-ARM64-3.07.1.run + #BINARY=SDRplay_RSP_API-ARM64-3.07.1.run + BINARY=SDRplay_RSP_API-Linux-3.14.0.run ;; esac