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

58 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
2019-01-21 17:44:35 +00:00
set -euxo pipefail
2020-02-16 12:19:49 +01: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 11:35:48 +01: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 19:59:31 +02:00
apt-get update
2020-05-23 22:53:12 +02:00
apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES
2019-01-21 17:44:35 +00:00
2019-01-22 17:44:58 +01:00
ARCH=$(uname -m)
case $ARCH in
2019-01-22 12:52:03 +01:00
x86_64)
BINARY=SDRplay_RSP_API-Linux-3.07.1.run
2019-01-22 12:52:03 +01:00
;;
armv*)
BINARY=SDRplay_RSP_API-ARM32-3.07.2.run
2019-01-22 12:52:03 +01: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 12:52:03 +01:00
esac
2019-12-15 02:18:30 +00:00
wget https://www.sdrplay.com/software/$BINARY
2019-01-22 12:52:03 +01:00
sh $BINARY --noexec --target sdrplay
2019-01-22 17:44:58 +01:00
patch --verbose -Np0 < /install-lib.$ARCH.patch
2019-01-22 17:25:46 +01:00
2019-01-21 17:44:35 +00:00
cd sdrplay
./install_lib.sh
cd ..
rm -rf sdrplay
2019-01-22 12:52:03 +01:00
rm $BINARY
2019-01-21 17:44:35 +00:00
2020-05-24 14:46:17 +02:00
git clone https://github.com/SDRplay/SoapySDRPlay.git
2020-10-04 21:02:46 +02:00
# latest from master as of 2020-09-04
cmakebuild SoapySDRPlay 105f8a6b3d449982d7ef860790c201aa066b8fa9
2019-01-21 17:44:35 +00:00
2020-05-23 19:59:31 +02:00
SUDO_FORCE_REMOVE=yes apt-get -y purge --autoremove $BUILD_PACKAGES
apt-get clean
rm -rf /var/lib/apt/lists/*