SSB_HighSpeed_Modem/hsmodem/hsmodem.sh

58 lines
2.0 KiB
Bash
Raw Normal View History

2020-11-27 13:31:22 -05:00
#!/bin/bash
echo
echo
echo
echo
echo "this script installs HSmodem on your Linux system"
echo "================================================="
echo
echo "1. Downloads the sources from github"
echo "2. compiles the sources for your local machine and architecture"
echo "3. copy the shared libraries to it's final location"
echo
echo "Install required packages and libraries. Press ENTER ..."
read
sudo apt-get update
sudo apt-get -y install libopus-dev libfftw3-dev libcodec2-dev libsndfile-dev libasound-dev mono-complete pavucontrol git g++ build-essential
echo
echo "Download hsmodem sources from github. Press ENTER ... "
read
git clone https://github.com/dj0abr/SSB_HighSpeed_Modem
echo
echo "Compile the sources and build the executable program. Press ENTER ..."
read
2020-12-10 13:14:40 -05:00
pwd
cd SSB_HighSpeed_Modem/hsmodem
pwd
2020-11-27 13:31:22 -05:00
make -j 4
echo
echo "copy the shared libraries to it's final location. Press ENTER ..."
read
2020-12-10 13:14:40 -05:00
echo copy oscardata.exe
pwd
cp ../oscardata/oscardata/bin/Release/oscardata.exe ../hsmodemLinux
2020-11-27 13:31:22 -05:00
# now find the shared library directory
# this is the directory where libopus.so is installed
LIBNAME=$(find /usr -name libopus.so | head -1)
LIBFOLDER=$(dirname $LIBNAME)
ARCHITECTURE=$(uname -m)
echo copy shared libraries for $ARCHITECTURE to $LIBFOLDER
echo
if [ ${ARCHITECTURE} == 'x86_64' ];
then
sudo cp ./SharedLibs/$ARCHITECTURE/*.so $LIBFOLDER
2020-12-10 13:14:40 -05:00
echo "finished. Your project is in folder: ./SSB_HighSpeed_Modem/hsmodemLinux"
echo "you can copy this folder to any location"
echo "to run hsmodem: mono oscardata.exe"
2020-11-27 13:31:22 -05:00
elif [ ${ARCHITECTURE} == 'aarch64' ];
then
sudo cp ./SharedLibs/$ARCHITECTURE/*.so $LIBFOLDER
2020-12-10 13:14:40 -05:00
echo "finished. Your project is in folder: ./SSB_HighSpeed_Modem/hsmodemLinux"
echo "you can copy this folder to any location"
echo "to run hsmodem: mono oscardata.exe"
2020-11-27 13:31:22 -05:00
else
echo ================================================================
echo error: no shared libs for $ARCHITECTURE . Install them manually.
echo ================================================================
fi