add sdrplay support

This commit is contained in:
Jakob Ketterl 2019-01-13 21:04:29 +00:00
parent 51b9d1289a
commit 4f6a9249e8
4 changed files with 105 additions and 28 deletions

View File

@ -7,5 +7,7 @@ ADD . /openwebrx
WORKDIR /openwebrx WORKDIR /openwebrx
CMD python2.7 openwebrx.py VOLUME /config
ENTRYPOINT [ "/openwebrx/docker/run.sh" ]
EXPOSE 8073 EXPOSE 8073

View File

@ -1,14 +1,65 @@
#!/bin/bash #!/bin/bash
set -euxo pipefail set -euxo pipefail
function cmakebuild() {
cd $1
mkdir build
cd build
cmake ..
make
sudo make install
cd ../..
rm -rf $1
}
cd /tmp cd /tmp
STATIC_PACKAGES="sox libfftw3-dev python2.7 rtl-sdr netcat libitpp-dev libsndfile1-dev" STATIC_PACKAGES="sox libfftw3-dev python2.7 rtl-sdr netcat libitpp-dev libsndfile1-dev libusb-dev"
BUILD_PACKAGES="git build-essential cmake" BUILD_PACKAGES="git build-essential cmake patch"
apt-get update apt-get update
apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES
wget http://www.sdrplay.com/software/SDRplay_RSP_API-RPi-2.13.1.run
sh SDRplay_RSP_API-RPi-2.13.1.run --noexec --target sdrplay
patch -Np0 <<'EOF'
--- sdrplay/install_lib.sh 2018-06-20 23:57:02.000000000 +0000
+++ sdrplay/install_lib_patched.sh 2019-01-13 17:52:56.723838354 +0000
@@ -2,18 +2,6 @@
echo "Installing SDRplay RSP API library 2.13..."
-more sdrplay_license.txt
-
-while true; do
- echo "Press y and RETURN to accept the license agreement and continue with"
- read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer y or n";;
- esac
-done
-
export ARCH=`arch`
export VERS="2.13"
EOF
cd sdrplay
./install_lib.sh
cd ..
rm -rf sdrplay
rm SDRplay_RSP_API-RPi-2.13.1.run
git clone https://github.com/pothosware/SoapySDR
cmakebuild SoapySDR
git clone https://github.com/pothosware/SoapySDRPlay.git
cmakebuild SoapySDRPlay
git clone https://github.com/rxseger/rx_tools
cmakebuild rx_tools
git clone https://github.com/simonyiszk/csdr.git git clone https://github.com/simonyiszk/csdr.git
cd csdr cd csdr
make make
@ -17,34 +68,13 @@ cd ..
rm -rf csdr rm -rf csdr
git clone https://github.com/szechyjs/mbelib.git git clone https://github.com/szechyjs/mbelib.git
cd mbelib cmakebuild mbelib
mkdir build
cd build
cmake ..
make
make install
cd ../..
rm -rf mbelib
git clone https://github.com/jketterl/digiham.git git clone https://github.com/jketterl/digiham.git
cd digiham cmakebuild digiham
mkdir build
cd build
cmake ..
make
make install
cd ../..
rm -rf digiham
git clone https://github.com/szechyjs/dsd.git git clone https://github.com/szechyjs/dsd.git
cd dsd cmakebuild dsd
mkdir build
cd build
cmake ..
make
make install
cd ../..
rm -rf dsd
apt-get remove --purge --autoremove -y $BUILD_PACKAGES apt-get remove --purge --autoremove -y $BUILD_PACKAGES
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

22
docker/install-lib.patch Normal file
View File

@ -0,0 +1,22 @@
--- sdrplay/install_lib.sh 2018-06-20 23:57:02.000000000 +0000
+++ sdrplay/install_lib_patched.sh 2019-01-13 17:52:56.723838354 +0000
@@ -2,18 +2,6 @@
echo "Installing SDRplay RSP API library 2.13..."
-more sdrplay_license.txt
-
-while true; do
- echo "Press y and RETURN to accept the license agreement and continue with"
- read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer y or n";;
- esac
-done
-
export ARCH=`arch`
export VERS="2.13"

23
docker/run.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
set -euo pipefail
if [[ ! -f /config/config_webrx.py ]] ; then
cp config_webrx.py /config
fi
rm config_webrx.py
ln -s /config/config_webrx.py .
_term() {
echo "Caught signal!"
kill -TERM "$child" 2>/dev/null
}
trap _term SIGTERM SIGINT
python2.7 openwebrx.py $@ &
child=$!
wait "$child"