-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadditional_tools_install.sh
More file actions
executable file
·201 lines (152 loc) · 6.62 KB
/
Copy pathadditional_tools_install.sh
File metadata and controls
executable file
·201 lines (152 loc) · 6.62 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
TMPDIRECTORY=/tmp
INSTALLDIRECTORYNAME='Jaguar'
INSTALLPATH="/home/$USER/$INSTALLDIRECTORYNAME"
echo "\n"
echo "${RED}Installer script for BigPEmu, Seb's Jaguar Image Converter, ray's lz77 Packer, and the latest version of Tursi's JCP.${NC}\nScript last updated January 1st, 2023\n"
echo "${RED}Installation requires access to the ubuntu repositories and an internet connection.${NC}\n"
echo "${RED}Sources are pulled from the following locations on the web:\n"
echo "${RED}BigPEmu${NC} - https://www.richwhitehouse.com/jaguar/index.php?content=download\n"
echo "${RED}open_jaggd${NC} - https://github.com/cubanismo/open_jaggd\n"
echo "${RED}JCP${NC} - http://www.harmlesslion.com/zips/SKUNKBOARD_FULL_RELEASE.zip\n"
echo "${RED}Seb's Jaguar Image Converter${NC} - http://removers.free.fr/softs/archives/converter-0.1.9.tar.gz\n"
echo "${RED}Ray's lz77 Packer${NC} - http://s390174849.online.de/ray.tscc.de/files/lz77_v13.zip\n${NC}"
echo "Consider supporting these developers and their effors with donations and feeback.\n"
#prerequisites
echo "\n"
echo "${RED}Adding necessary packages for binary building.${NC}\n"
echo "\n"
sudo apt-get install -y make
sudo apt-get install -y git
sudo apt-get install -y libusb-dev
sudo apt-get install -y libusb-1.0-0-dev
sudo apt-get install -y libusb-0.1-4
sudo apt-get install -y python3
#setup python3 to be the version of python with highest priority. jconverter/jag-image-converter requires python3 or higher to execute.
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 99
echo "\n"
echo "${RED}Making directory structure for building and final binaries.${NC}\n"
echo "\n"
mkdir -v $TMPDIRECTORY/tmp_additional_jaguar_dev_binaries
cd $TMPDIRECTORY/tmp_additional_jaguar_dev_binaries
mkdir -v ./bin
mkdir -v ./src
mkdir -v ./src/other_binaries
#Download and unpack sources from web, and then remove archived files
echo "\n"
echo "${RED}Download and unpack sources from web, and then move archived source files.${NC}\n"
echo "\n"
#bigPEmu
wget https://www.richwhitehouse.com/jaguar/builds/BigPEmu_Linux64_v119.tar.gz
tar -xvf ./BigPEmu_Linux64_v119.tar.gz
mv -v ./BigPEmu_Linux64_v119.tar.gz ./src/other_binaries
#jaggd
git clone https://github.com/cubanismo/open_jaggd.git
#jcp
wget http://www.harmlesslion.com/zips/SKUNKBOARD_FULL_RELEASE.zip
unzip ./SKUNKBOARD_FULL_RELEASE.zip
cp -r ./FULL_RELEASE/sources/jcp2/jcp ./
sudo rm -r ./SKUNKBOARD_FULL_RELEASE.zip
sudo rm -r ./FULL_RELEASE
tar -cvf jcp.tar ./jcp
mv -v ./jcp.tar ./src/other_binaries
#lz77
wget http://s390174849.online.de/ray.tscc.de/files/lz77_v13.zip
unzip lz77_v13.zip
mv -v ./lz77_v13.zip ./src/other_binaries
#jag-image-converter
git clone https://github.com/theRemovers/jconverter.git
#Build Binaries
echo "\n"
echo "${RED}Begin building binaries.${NC}\n"
#jaggd
echo "\n"
echo "${RED}Building jaggd.${NC}\n"
echo "\n"
sleep 1
cd ./open_jaggd
make
sudo bash -c 'echo "SUBSYSTEM==\"usb\", ATTRS{idProduct}==\"800e\", ATTRS{idVendor}==\"03eb\", MODE=\"0666\"" >> /etc/udev/rules.d/65-jaggd.rules' #allows jaggd to run without sudo
sudo udevadm control --reload-rules #alows jaggd to run without restart
cd ..
#jcp
echo "\n"
echo "${RED}Building jcp.${NC}\n"
echo "\n"
sleep 1
cd ./jcp
make
sudo bash -c 'echo "SUBSYSTEM==\"usb\", ATTRS{idProduct}==\"7200\", ATTRS{idVendor}==\"04b4\", MODE=\"0666\"" >> /etc/udev/rules.d/64-skunk.rules' #allows jcp to run without sudo
sudo udevadm control --reload-rules #alows jcp to run without restart
cd ..
#lz77
echo "\n"
echo "${RED}Building lz77.${NC}\n"
echo "\n"
sleep 1
cd lz77/
gcc lz77.c -o lz77 -O2
cd ..
#copy built binaries to bin folder
echo "\n"
echo "${RED}Copy built binaries to bin folder.${NC}\n"
echo "\n"
mkdir ./bin/
mv -v ./bigpemu/ ./bin/
cp -v ./open_jaggd/jaggd ./bin/
cp -v ./jcp/jcp ./bin/
cp -v ./lz77/lz77 ./bin/
cp -v ./jconverter/converter.py ./bin/
cp -v ./jconverter/rgb2cry.py ./bin/
#make binary linking/unlinking scripts
echo "\n"
echo "${RED}Making linking/unlinking scripts. Placing in bin folder.${NC}\n"
echo "\n"
touch ./bin/link_binaries.sh
touch ./bin/unlink_binaries.sh
echo "#!/bin/bash" >> ./bin/link_binaries.sh
echo "sudo ln -s $INSTALLPATH/bin/bigpemu/bigpemu /usr/bin/bigpemu" >> ./bin/link_binaries.sh
echo "sudo ln -s $INSTALLPATH/bin/jaggd /usr/bin/jaggd" >> ./bin/link_binaries.sh
echo "sudo ln -s $INSTALLPATH/bin/jcp /usr/bin/jcp" >> ./bin/link_binaries.sh
echo "sudo ln -s $INSTALLPATH/bin/lz77 /usr/bin/lz77" >> ./bin/link_binaries.sh
echo "sudo ln -s $INSTALLPATH/bin/converter.py /usr/bin/jag-image-converter" >> ./bin/link_binaries.sh
echo "sudo chmod +x /usr/bin/bigpemu/bigpemu" >> ./bin/link_binaries.sh
echo "sudo chmod +x /usr/bin/jaggd" >> ./bin/link_binaries.sh
echo "sudo chmod +x /usr/bin/jcp" >> ./bin/link_binaries.sh
#add rules file that allows the user to invoke jcp without sudo/root permissions. Confirmed to work with v2 skunkboards and SillyVenture skunkboards
echo "sudo chmod +x /usr/bin/lz77" >> ./bin/link_binaries.sh
echo "sudo chmod +x /usr/bin/jag-image-converter" >> ./bin/link_binaries.sh
echo "#!/bin/bash" >> ./bin/unlink_binaries.sh
echo "sudo rm -v /usr/bin/bigpemu" >> ./bin/unlink_binaries.sh
echo "sudo rm -v /usr/bin/jaggd" >> ./bin/unlink_binaries.sh
echo "sudo rm -v /usr/bin/jcp" >> ./bin/unlink_binaries.sh
echo "sudo rm -v /usr/bin/lz77" >> ./bin/unlink_binaries.sh
echo "sudo rm -v /usr/bin/jag-image-converter" >> ./bin/unlink_binaries.sh
#remove build directores
echo "\n"
echo "${RED}Remove build directores.${NC}\n"
echo "\n"
sudo rm -r ./lz77/
sudo rm -r ./open_jaggd/
sudo rm -r ./jcp/
sudo rm -r ./jconverter/
#copy binaries and sources to rmac/rln/jlibc/rmvlib toolchain Jaguar directory in the users home directory
echo "\n"
echo "${RED}Copy bin folder with included binaries to toolchain directory $INSTALLPATH${NC}\n"
echo "\n"
cp -ur ./bin/ $INSTALLPATH/
cp -ur ./src/ $INSTALLPATH/
#run linking script to add binaries to path so they can be invoked directly from the command line
echo "\n"
echo "${RED}run linking script to add binarys to path so they can be envoked directly from the command line\n"
echo "\n"
sh "${HOME}/Jaguar/bin/link_binaries.sh"
#backout and delete temp directory
echo "\n"
echo "${RED}Remove temporary directory.${NC}\n"
echo "\n"
sudo rm -r $TMPDIRECTORY/tmp_additional_jaguar_dev_binaries/
echo "\n"
echo "${RED}Finished!${NC} \n\nBinaries are located in your home directory at ${RED}$INSTALLPATH/bin${NC} directory. \nThese binaries are currently not setup to be envoked by name from a terminal. Navigate to $INSTALLPATH/bin to run a script to enable the user to envoke each binary from a terminal without the need of a filepath to the binary.${NC}\n"