2019-01-21 17:02:58 +00:00
|
|
|
#!/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
|
2019-12-29 23:11:27 +00:00
|
|
|
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
|
|
|
|
|
2019-07-13 19:35:57 +00:00
|
|
|
STATIC_PACKAGES="libusb udev"
|
|
|
|
BUILD_PACKAGES="git cmake make patch wget sudo gcc g++ libusb-dev"
|
2019-01-21 17:44:35 +00:00
|
|
|
|
2019-01-22 14:52:53 +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)
|
2020-04-10 16:03:19 +00:00
|
|
|
BINARY=SDRplay_RSP_API-Linux-3.06.1.run
|
2019-01-22 11:52:03 +00:00
|
|
|
;;
|
|
|
|
armv*)
|
2020-04-10 16:03:19 +00:00
|
|
|
BINARY=SDRplay_RSP_API-ARM32-3.06.1.run
|
2019-01-22 11:52:03 +00:00
|
|
|
;;
|
2019-12-15 02:18:30 +00:00
|
|
|
aarch64)
|
2020-04-10 16:03:19 +00:00
|
|
|
BINARY=SDRplay_RSP_API-ARM64-3.06.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
|
|
|
|
2020-04-10 16:03:19 +00:00
|
|
|
git clone https://github.com/fventuri/SoapySDRPlay.git
|
|
|
|
cmakebuild SoapySDRPlay 9746de21d5a3778c444cc5e70da2a61c27cb614a
|
2019-01-21 17:44:35 +00:00
|
|
|
|
2019-01-22 14:52:53 +00:00
|
|
|
apk del .build-deps
|