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

48 lines
800 B
Bash
Raw Normal View History

#!/bin/bash
2019-01-21 17:44:35 +00:00
set -euxo pipefail
function cmakebuild() {
cd $1
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 udev"
BUILD_PACKAGES="git cmake make patch wget sudo gcc g++ libusb-dev"
2019-01-21 17:44:35 +00:00
apk add --no-cache $STATIC_PACKAGES
apk add --no-cache --virtual .build-deps $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-2.13.1.run
;;
armv*)
BINARY=SDRplay_RSP_API-RPi-2.13.1.run
;;
esac
wget http://www.sdrplay.com/software/$BINARY
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
git clone https://github.com/pothosware/SoapySDRPlay.git
cmakebuild SoapySDRPlay
apk del .build-deps