-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinstall-cygwin.sh
More file actions
130 lines (93 loc) · 3.22 KB
/
install-cygwin.sh
File metadata and controls
130 lines (93 loc) · 3.22 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
#!/bin/bash
#
# install-cygwin.sh is the installation script for TSGL on Cygwin.
# Last updated: 07/14/2020
#
# -SUBJECT TO CHANGE-
################################################################
if [[ $1 ]]
then
PREFIX=$1
echo Install location $PREFIX
else
echo Install location /usr
PREFIX=/usr
fi
#install apt-cyg using lynx to download packages
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin
rm -rf apt-cyg*
#install apt-cyg using curl
#curl https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg > /cygdrive/c/cygwin64/bin/apt-cyg
#cd /cygdrive/c/cygwin64/bin
#chmod +x apt-cyg
#install necessary packages
echo "*******************************************************************************"
echo "Installing necessary packages..."
echo
echo
apt-cyg install make cmake gcc-g++ libXinerama-devel libXcursor-devel libXi-devel libfreetype-devel libfreetype-doc libfreetype6 libGL-devel libGL1 xorg-server xinit xeyes glm-devel libglut-devel libglut3 openmpi glew libGLEW-devel libXrandr-devel mingw64-i686-freetype2 mingw64-x86_64-freetype2 libopenmpi-devel libopenmpi12 libopenmpicxx1 doxygen-doxywizard dos2unix
echo
echo
echo "All necessary packages installed"
echo "*******************************************************************************"
echo "Checking for dependencies..."
glfwFile=/usr/lib/libglfw.dll.a
if [ -f "$glfwFile" ]
then
echo "glfw dependency found"
else
#clone the repository and install glfw
git clone https://github.com/glfw/glfw.git
cd glfw
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DBUILD_SHARED_LIBS=ON
make
make install
cd ..
rm -rf glfw
cd /usr/lib
cd -
ln -s /usr/lib/libglfw.dll.a
echo "glfw dependecy resolved"
fi
cxxoptsFile=/usr/include/cxxopts.hpp
if [ -f "$cxxoptsFile" ]
then
echo "cxxopts dependency found"
else
echo "Resolving missing cxxopts dependency..."
git clone https://github.com/jarro2783/cxxopts.git || exit 1
cd cxxopts/include
cp cxxopts.hpp /usr/include
cd ../..
rm -rf cxxopts*
fi
echo "All necessary dependencies resolved"
###################################################################################
tsglFile=/usr/lib/libtsgl.dll
if [ -f "$tsglFile" ]
then
echo ""
source ~/.bashrc
else
echo "export TSGL_HOME=/usr" >> ~/.bashrc
echo "export DISPLAY=:0.0" >> ~/.bashrc
echo "export TSGL_DEFAULT_FONT=/include/TSGL/assets/freefont/FreeSansBold.ttf" >> ~/.bashrc
source ~/.bashrc
fi
###################################################################################
echo "Installing TSGL..."
echo
#Clean install = remove the TSGL folder and lib files if they already exist
rm -rf /usr/include/TSGL
rm -rf /usr/lib/libtsgl.*
#Create the following directories (Since they aren't included in github but are needed)
mkdir -p lib bin
#Make the library
make prefix=$PREFIX
#Install it
make install prefix=$PREFIX
#Take out the .cpp files from the TSGL library package folder
rm -rf /usr/include/TSGL/*.cpp
#Done
echo "Installation complete! Execute the runtests bash script to verify that everything works!"