-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpihpsdr_install.sh
113 lines (91 loc) · 2.73 KB
/
pihpsdr_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
echo "Installation wdsp or pihpsdr"
echo ""
echo "What do you like to install [wdsp/pihpsdr/reboot] ?"
read input
if [[ $input == "wdsp" ]]; then
echo ""
echo "Installing WDSP library..."
function install_dependency {
echo "--- Installing dependency: $1"
sudo apt-get -y install $1
}
install_dependency git
install_dependency libfftw3-dev
cd /tmp
git clone --depth=1 https://github.com/g0orx/wdsp
cd wdsp
make -j 4
sudo make install
cd ..
rm -rf wdsp
cd ~
echo ""
echo "WDSP installed."
elif [[ $input == "pihpsdr" ]]; then
echo ""
echo "Installing pihpsdr..."
echo ""
echo ""
localcw=0;
while true; do
read -p "Do you wish to install the local CW option: yes or no?" yn
case $yn in
[Yy]* ) localcw=1; break;;
[Nn]* ) break;;
* ) echo "Please answer yes (Y or y) or no (N or n).";;
esac
done
function install_dependency {
echo "--- Installing dependency: $1"
sudo apt-get -y install $1
}
install_dependency git
install_dependency libpulse-dev
install_dependency libgtk-3-dev
install_dependency libasound2-dev
install_dependency libcurl4-openssl-dev
install_dependency libusb-1.0-0-dev
install_dependency libgpiod-dev
install_dependency gpiod
install_dependency libi2c-dev
cd /tmp
git clone https://github.com/g0orx/pihpsdr.git
cd pihpsdr
#makefile modification; when 'on' switch it 'off' (adding '#').
sed -i '/^PURESIGNAL_INCLUDE=PURESIGNAL/c\#PURESIGNAL_INCLUDE=PURESIGNAL' ./Makefile;
sed -i '/^#MIDI_INCLUDE=MIDI/c\MIDI_INCLUDE=MIDI' ./Makefile;
sed -i '/^GPIO_INCLUDE=GPIO/c\#GPIO_INCLUDE=GPIO' ./Makefile;
sed -i '/^LOCALCW_INCLUDE=LOCALCW/c\#LOCALCW_INCLUDE=LOCALCW' ./Makefile;
#main.c modification to change screen size to 1366 x 768
sed -i '/^#define MAX_DISPLAY_WIDTH 800/c\#define MAX_DISPLAY_WIDTH 1366' ./main.c;
sed -i '/^#define MAX_DISPLAY_HEIGHT 480/c\#define MAX_DISPLAY_HEIGHT 768' ./main.c;
if [ "$localcw" -eq "1" ]; then
sed -i '/^#GPIO_INCLUDE=GPIO/c\GPIO_INCLUDE=GPIO' ./Makefile;
sed -i '/^#LOCALCW_INCLUDE=LOCALCW/c\LOCALCW_INCLUDE=LOCALCW' ./Makefile;
fi
make -j 4
sudo make install
if [ ! -d "/home/pi/.pihpsdr" ]; then
mkdir /home/pi/.pihpsdr
fi
cp release/pihpsdr/hpsdr.png /home/pi/.pihpsdr
cd ..
#rm -rf pihpsdr
rm /home/pi/Desktop/pihpsdr.desktop
file="/home/pi/Desktop/pihpsdr.desktop"
echo "[Desktop Entry]" >> $file
echo "Icon=/home/pi/.pihpsdr/hpsdr.png" >> $file
echo "Exec=/usr/local/bin/pihpsdr" >> $file
echo "Type=Application" >> $file
echo "Terminal=false" >> $file
echo "Path=/home/pi/.pihpsdr" >> $file
cat $file
echo ""
echo "pihpsdr installed"
elif [[ $input == "reboot" ]]; then
sudo reboot
else
echo "You did not make a selection; Nothing installed!"
echo "73!"
fi