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

55 lines
983 B
Bash
Raw 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 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
;;
2019-12-15 02:18:30 +00:00
aarch64)
BINARY=SDRplay_RSP_API-ARM64-2.13.1.run
;;
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
git clone https://github.com/pothosware/SoapySDRPlay.git
cmakebuild SoapySDRPlay 14ec39e4ff0dab7ae7fdf1afbbd2d28b49b0ffae
2019-01-21 17:44:35 +00:00
apk del .build-deps