openwebrx-clone/docker/scripts/install-dependencies-sdrplay.sh

58 lines
1.1 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
2019-01-21 17:44:35 +00:00
set -euxo pipefail
2020-02-16 11:19:49 +00:00
export MAKEFLAGS="-j4"
2019-01-21 17:44:35 +00:00
function cmakebuild() {
cd $1
if [[ ! -z "${2:-}" ]]; then
git checkout $2
fi
2019-01-21 17:44:35 +00:00
mkdir build
cd build
cmake ..
2019-01-22 10:35:48 +00:00
make
make install
2019-01-21 17:44:35 +00:00
cd ../..
rm -rf $1
}
cd /tmp
STATIC_PACKAGES="libusb-1.0.0 udev"
BUILD_PACKAGES="git cmake make patch wget sudo gcc g++ libusb-1.0-0-dev"
2019-01-21 17:44:35 +00:00
2020-05-23 17:59:31 +00:00
apt-get update
2020-05-23 20:53:12 +00:00
apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES
2019-01-21 17:44:35 +00:00
2019-01-22 16:44:58 +00:00
ARCH=$(uname -m)
case $ARCH in
2019-01-22 11:52:03 +00:00
x86_64)
BINARY=SDRplay_RSP_API-Linux-3.07.1.run
2019-01-22 11:52:03 +00:00
;;
armv*)
BINARY=SDRplay_RSP_API-ARM32-3.07.2.run
2019-01-22 11:52:03 +00:00
;;
2019-12-15 02:18:30 +00:00
aarch64)
BINARY=SDRplay_RSP_API-ARM64-3.07.1.run
2019-12-15 02:18:30 +00:00
;;
2019-01-22 11:52:03 +00:00
esac
2019-12-15 02:18:30 +00:00
wget https://www.sdrplay.com/software/$BINARY
2019-01-22 11:52:03 +00:00
sh $BINARY --noexec --target sdrplay
2019-01-22 16:44:58 +00:00
patch --verbose -Np0 < /install-lib.$ARCH.patch
2019-01-22 16:25:46 +00:00
2019-01-21 17:44:35 +00:00
cd sdrplay
./install_lib.sh
cd ..
rm -rf sdrplay
2019-01-22 11:52:03 +00:00
rm $BINARY
2019-01-21 17:44:35 +00:00
2021-06-19 18:16:21 +00:00
git clone https://github.com/pothosware/SoapySDRPlay3.git
# latest from master as of 2021-06-19 (reliability fixes)
2021-06-19 18:23:26 +00:00
cmakebuild SoapySDRPlay3 a869f25364a1f0d5b16169ff908aa21a2ace475d
2019-01-21 17:44:35 +00:00
2020-05-23 17:59:31 +00:00
SUDO_FORCE_REMOVE=yes apt-get -y purge --autoremove $BUILD_PACKAGES
apt-get clean
rm -rf /var/lib/apt/lists/*