#!/bin/bash
sudo apt-get install g++ git libsdl2-dev yasm
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-shared 
make
sudo make install
cd ../
sudo rm -r ffmpeg
wget http://www.hyperrealm.com/libconfig/libconfig-1.5.tar.gz
mv libconfig-1.5.tar.gz libconfig-1.5.tar.tar
tar xf libconfig-1.5.tar.tar
cd libconfig-1.5/
./configure
make 
sudo make install
cd ../
sudo rm -r libconfig-1.5* 

sudo cp maris_player /usr/bin/
sudo chmod 777 /usr/bin/maris_player
sudo cp libspeedlive.so /usr/lib/
sudo ldconfig -v
rm ./maris_player.desktop
echo '[Desktop Entry]' 	      	>> ./maris_player.desktop
echo 'Version=1.0'     	      	>> ./maris_player.desktop		
echo 'Type=Application'       	>> ./maris_player.desktop	
echo 'Terminal=false'	      	>> ./maris_player.desktop
echo 'Name[en_US]=neptune_player' >> ./maris_player.desktop
echo 'Exec=/usr/bin/maris_player' >> ./maris_player.desktop
echo 'Comment[en_US]=low latency player' >> ./maris_player.desktop
echo Icon=$(pwd)/maris_player.png >> ./maris_player.desktop
echo 'Categories=Network,GTK,GNOME' >> ./maris_player.desktop
cp maris_player.desktop ~/Desktop/
chmod 777 ~/Desktop/maris_player.desktop
echo "********* plase install qt  ***********"
./qt-opensource-linux-x64-5.7.0-beta.run
echo "********* maris player install finish ***********"


