forked from openscad/openscad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuni-get-dependencies.sh
executable file
·262 lines (241 loc) · 7.71 KB
/
uni-get-dependencies.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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# auto-install dependency packages using the systems package manager.
# after running this, run ./script/check-dependencies.sh. see README.md
#
# this assumes you have sudo installed and running, or are running as root.
#
get_fedora_deps_yum()
{
yum -y install qt5-qtbase-devel bison flex eigen3-devel harfbuzz-devel \
fontconfig-devel freetype-devel \
boost-devel mpfr-devel gmp-devel glew-devel CGAL-devel gcc gcc-c++ pkgconfig \
opencsg-devel git libXmu-devel curl imagemagick ImageMagick glib2-devel make \
xorg-x11-server-Xvfb gettext qscintilla-devel qscintilla-qt5-devel \
mesa-dri-drivers
}
get_fedora_deps_dnf()
{
dnf -y install qt5-qtbase-devel bison flex eigen3-devel harfbuzz-devel \
fontconfig-devel freetype-devel \
boost-devel mpfr-devel gmp-devel glew-devel CGAL-devel gcc gcc-c++ pkgconfig \
opencsg-devel git libXmu-devel curl ImageMagick glib2-devel make \
xorg-x11-server-Xvfb gettext qscintilla-devel qscintilla-qt5-devel \
mesa-dri-drivers libzip-devel ccache
dnf -y install libxml2-devel
dnf -y install libffi-devel
dnf -y install redhat-rpm-config
}
get_qomo_deps()
{
get_fedora_deps
}
get_altlinux_deps()
{
for i in boost-devel boost-filesystem-devel gcc4.5 gcc4.5-c++ boost-program_options-devel \
boost-thread-devel boost-system-devel boost-regex-devel eigen3 libmpfr libgmp libgmp_cxx-devel qt4-devel libcgal-devel git-core \
libglew-devel flex bison curl imagemagick gettext glib2-devel; do apt-get install $i; done
}
get_freebsd_deps()
{
pkg_add -r bison boost-libs cmake git bash eigen3 flex gmake gmp mpfr \
xorg libGLU libXmu libXi xorg-vfbserver glew \
qt4-corelib qt4-gui qt4-moc qt4-opengl qt4-qmake qt4-rcc qt4-uic \
opencsg cgal curl imagemagick glib2-devel gettext
}
get_netbsd_deps()
{
pkgin install bison boost cmake git bash eigen3 flex gmake gmp mpfr \
qt4 glew cgal opencsg python27 curl \
ImageMagick glib2 gettext
}
get_opensuse_deps()
{
zypper install mpfr-devel gmp-devel boost-devel \
glew-devel cmake git bison flex cgal-devel curl \
glib2-devel gettext freetype-devel harfbuzz-devel \
libqscintilla-qt5-devel libqt5-qtbase-devel libQt5OpenGL-devel \
xvfb-run libzip-devel
zypper install libeigen3-devel
if [ $? -ne 0 ]; then
zypper install libeigen3
fi
zypper install ImageMagick
if [ $? -ne 0 ]; then
zypper install imagemagick
fi
zypper install opencsg-devel
if [ $? -ne 0 ]; then
pver=`cat /etc/os-release | grep -i pretty_name | sed s/PRETTY_NAME=//g`
pver=`echo $pver | sed s/\"//g | sed s/\ /_/g `
echo attempting to add graphics repository for opencsg...
set +x
zypper ar -f http://download.opensuse.org/repositories/graphics/$pver graphics
zypper install opencsg-devel
set -x
fi
}
get_mageia_deps()
{
urpmi ctags
urpmi task-c-devel task-c++-devel libqt4-devel libgmp-devel \
libmpfr-devel libboost-devel eigen3-devel libglew-devel bison flex \
cmake imagemagick glib2-devel python curl git x11-server-xvfb gettext
}
get_debian_deps()
{
apt-get -y install \
build-essential curl libffi-dev \
libxmu-dev cmake bison flex git-core libboost-all-dev \
libmpfr-dev libboost-dev libglew-dev \
libeigen3-dev libcgal-dev libopencsg-dev libgmp3-dev libgmp-dev \
imagemagick libfreetype6-dev \
gtk-doc-tools libglib2.0-dev gettext xvfb pkg-config ragel
apt-get -y install libxi-dev libfontconfig-dev libzip-dev
}
get_debian_7_deps()
{
get_debian_deps
apt-get -y install libqt4-dev libqscintilla2-dev
echo "debian 7 detected"
echo "please build harfbuzz & see the README on building dependencies"
echo ". ./scripts/setenv-unibuild.sh"
echo "./scripts/uni-build-dependencies.sh harfbuzz"
}
get_qt4or5_deps_debian()
{
# debian 8 can have both qt4 and qt5 installed... or neither. figure out which
# and cater to it.
useqt=5
if [ "`dpkg --list | grep qt5-default`" ]; then
useqt=5
elif [ "`dpkg --list | grep qt4-default`" ]; then
useqt=4
elif [ "`echo QT_SELECT | grep ^4`" ]; then
useqt=4
elif [ "`echo QT_SELECT | grep qt4`" ]; then
useqt=4
elif [ "`echo QT_SELECT | grep ^5`" ]; then
useqt=5
elif [ "`echo QT_SELECT | grep qt5`" ]; then
useqt=5
elif [ ! "`command -v qtchooser`" ]; then
useqt=5
elif [ "`qtchooser -l | grep qt5`" ]; then
useqt=5
elif [ ! "`qtchooser -l | grep qt4`" ]; then
useqt=5
elif [ ! "`command -v qmake`" ]; then
useqt=5
elif [ "`qmake --version | grep -i qt.version.4`" ]; then
useqt=4
fi
if [ $useqt = 5 ]; then
apt-get -y install qtbase5-dev libqt5scintilla2-dev libqt5opengl5-dev qt5-qmake
else
apt-get -y install libqt4-dev libqscintilla2-dev libqt4-opengl-dev
fi
if [ ! "`command -v qmake`" ]; then
apt-get -y install qt$useqt-default
echo "installed qt$useqt-default to enable qmake"
elif [ ! "`qmake --version | grep qmake.version`" ]; then
apt-get -y install qt$useqt-default
echo "installed qt$useqt-default to enable qmake"
fi
}
get_debian_8_deps()
{
apt-get -y install libharfbuzz-dev libxml2-dev
get_debian_deps
get_qt4or5_deps_debian
}
get_ubuntu_14_deps()
{
get_debian_8_deps
}
get_arch_deps()
{
pacman -S --noconfirm qt5 qscintilla-qt5 cgal gmp mpfr boost \
opencsg glew eigen glib2 fontconfig freetype2 harfbuzz bison flex make
}
get_ubuntu_16_deps()
{
apt-get -y install libxi-dev libxml2-dev libfontconfig1-dev
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804539
apt-get -y install libcgal-qt5-dev
get_debian_8_deps
}
get_neon_deps()
{
get_debian_deps
apt-get -y install libxi-dev libxml2-dev libfontconfig1-dev
apt-get -y install libharfbuzz-dev libxml2-dev
# qt5 scintilla is broken on kde neon. use qt4 # issue 1790
apt-get -y install libcgal-dev
apt-get -y install libqt4-dev libqscintilla2-dev libqt4-opengl-dev
echo on KDE Neon please use qmake-qt4 to build
}
unknown()
{
echo "Unknown system type. Please install the dependency packages listed"
echo "in README.md using your system's package manager."
}
if [ -e /etc/issue ]; then
if [ "`grep -i ubuntu.1[4-5] /etc/issue`" ]; then
get_ubuntu_14_deps
elif [ "`grep -i ubuntu.1[6-9] /etc/issue`" ]; then
get_ubuntu_16_deps
elif [ "`grep -i KDE.neon /etc/issue`" ]; then
get_neon_deps
elif [ "`grep -i ubuntu /etc/issue`" ]; then
get_debian_deps
elif [ "`grep -i elementary.*freya /etc/issue`" ]; then
get_ubuntu_14_deps
elif [ "`grep -i debian.GNU.Linux.7 /etc/issue`" ]; then
get_debian_7_deps
elif [ "`grep -i debian /etc/issue`" ]; then
get_debian_8_deps
elif [ "`grep -i raspbian /etc/issue`" ]; then
get_debian_deps
elif [ "`grep -i linux.mint.2 /etc/issue`" ]; then
get_ubuntu_14_deps
elif [ "`grep -i linux.mint.17 /etc/issue`" ]; then
get_ubuntu_14_deps
elif [ "`grep -i linux.mint.1[89] /etc/issue`" ]; then
get_ubuntu_16_deps
elif [ "`grep -i mint /etc/issue`" ]; then
get_debian_7_deps
elif [ "`grep -i suse /etc/issue`" ]; then
get_opensuse_deps
elif [ "`grep -i fedora.release.2[2-9] /etc/issue`" ]; then
get_fedora_deps_dnf
elif [ "`grep -i fedora.release.[3-9][0-9] /etc/issue`" ]; then
get_fedora_deps_dnf
elif [ "`grep -i fedora.release.2[0-1] /etc/issue`" ]; then
get_fedora_deps_yum
elif [ "`grep -i fedora /etc/issue`" ]; then
get_fedora_deps_yum
elif [ "`grep -i red.hat /etc/issue`" ]; then
get_fedora_deps
elif [ "`grep -i mageia /etc/issue`" ]; then
get_mageia_deps
elif [ "`grep -i qomo /etc/issue`" ]; then
get_qomo_deps
elif [ "`grep -i arch /etc/issue`" ]; then
get_arch_deps
elif [ -e /etc/fedora-release ]; then
if [ "`grep -i fedora.release /etc/fedora-release`" ]; then
get_fedora_deps_dnf
fi
elif [ "`command -v rpm`" ]; then
if [ "`rpm -qa | grep altlinux`" ]; then
get_altlinux_deps
fi
else
unknown
fi
elif [ "`uname | grep -i freebsd `" ]; then
get_freebsd_deps
elif [ "`uname | grep -i netbsd`" ]; then
get_netbsd_deps
else
unknown
fi