SSB_HighSpeed_Modem/hsmodem/hsmodem.sh

56 lines
1.9 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
2020-12-12 09:01:23 -05:00
sudo apt-get -y install libopus-dev libfftw3-dev libcodec2-dev libsndfile-dev libasound-dev mono-complete pavucontrol git g++ build-essential
2020-11-27 13:31:22 -05:00
echo
echo "Download hsmodem sources from github. Press ENTER ... "
read
git clone https://github.com/dj0abr/SSB_HighSpeed_Modem
echo
2020-12-10 13:14:40 -05:00
pwd
cd SSB_HighSpeed_Modem/hsmodem
2020-11-27 13:31:22 -05:00
echo
2020-12-12 09:01:23 -05:00
echo "copy GUI and the shared libraries to it's final location. Press ENTER ..."
2020-11-27 13:31:22 -05:00
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
2020-12-12 09:01:23 -05:00
# the program searches the shared libs in this directory
2020-11-27 13:31:22 -05:00
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
2020-12-12 09:01:23 -05:00
sudo cp ./SharedLibs/$ARCHITECTURE/* $LIBFOLDER
2020-11-27 13:31:22 -05:00
elif [ ${ARCHITECTURE} == 'aarch64' ];
then
2020-12-12 09:01:23 -05:00
sudo cp ./SharedLibs/$ARCHITECTURE/* $LIBFOLDER
2020-11-27 13:31:22 -05:00
else
echo ================================================================
echo error: no shared libs for $ARCHITECTURE . Install them manually.
echo ================================================================
fi
2020-12-12 09:01:23 -05:00
echo "Compile the sources and build the executable program. Press ENTER ..."
read
pwd
make -j 4
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"