forked from synfig/synfig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-setup-linux-native.sh
executable file
·280 lines (263 loc) · 9.17 KB
/
1-setup-linux-native.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
#!/bin/bash
# There are 3 types of dependencies:
# 1. Build tools:
# a) autoconf, automake, make, libtool (if you use autotools build system)
# b) cmake, ninja/make (if you use CMake build system)
# gcc/clang as primary compiler
# intltool, gettext (for internationalization)
# pkg-config (used for library search)
# shared-mime-info (used to register .sif file extension in system)
#
# 2. Libraries:
# glibmm (platform depended functions)
# mlt++ imagemagick openexr libmng libpng libjpeg (various formats reading functions)
# libxml++ libxml2 libxslt (.sif XML reading)
# boost cairo fftw pango (image transformation and rendering functions)
# gtkmm3 (Synfig Studio GUI)
# libsig++ (GUI signals and events)
# sdl2 sdl2_mixer jack (audio output and synchronization)
#
# 3. Runtime dependencies:
# adwaita-icon-theme (used to render GUI icons and styles)
# python3-lxml (lottie exporter plugin)
set -e
# 1 - Detect which Linux OS is in use
echo "Detecting Linux OS..."
# Check if /etc/os-release file is available
if [ -f /etc/os-release ]; then
source /etc/os-release
if [ -z "$ID_LIKE" ] && [ ! -z $ID ]; then
ID_LIKE=$ID
fi
echo "ID_LIKE=$ID_LIKE"
echo "VERSION_ID=$VERSION_ID"
fi
# Fallback whether /etc/os-release is not available, or if ID_LIKE is not set
if [ -z "$ID_LIKE" ]; then
if command -v dnf >/dev/null; then
# Fedora DNF package manager
export ID_LIKE="fedora"
export VERSION_ID=23
elif command -v yum >/dev/null; then
# Fedora YUM package manager
export ID_LIKE="fedora"
export VERSION_ID=22
elif which zypper >/dev/null; then
# openSUSE package manager
export ID_LIKE="suse opensuse"
elif command -v pacman >/dev/null; then
# Arch Linux package manager
export ID_LIKE="arch"
elif command -v apt-get >/dev/null; then
# Debian / Ubuntu package manager
export ID_LIKE="debian"
fi
fi
# 2 - Install the required packages
echo "Checking dependencies..."
if ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID > 22 ]); then
PKG_LIST="git \
intltool \
libpng-devel \
libjpeg-devel \
fftw-devel \
freetype-devel \
fontconfig-devel \
atk-devel \
pango-devel \
cairo-devel \
gtk3-devel \
gettext-devel \
libxml2-devel \
libxml++-devel \
gcc-c++ \
autoconf \
automake \
libtool \
libtool-ltdl-devel \
boost-devel \
shared-mime-info \
OpenEXR-devel \
libmng-devel \
ImageMagick-c++-devel \
jack-audio-connection-kit-devel \
mlt-devel \
ocl-icd-devel \
opencl-headers \
gtkmm30-devel \
glibmm24-devel \
SDL2-devel \
SDL2_mixer-devel \
libxslt-devel python-devel python3-lxml"
if ! ( rpm -qv $PKG_LIST ); then
echo "Running dnf (root privileges are needed)..."
sudo dnf install $PKG_LIST || true
fi
elif ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID <= 22]); then
PKG_LIST="git \
intltool \
libpng-devel \
libjpeg-devel \
fftw-devel \
freetype-devel \
fontconfig-devel \
atk-devel \
pango-devel \
cairo-devel \
gtk3-devel \
gettext-devel \
libxml2-devel \
libxml++-devel \
gcc-c++ \
autoconf \
automake \
libtool \
libtool-ltdl-devel \
boost-devel \
shared-mime-info \
OpenEXR-devel \
libmng-devel \
ImageMagick-c++-devel \
jack-audio-connection-kit-devel \
mlt-devel \
ocl-icd-devel \
opencl-headers \
gtkmm30-devel \
glibmm24-devel \
SDL2-devel \
SDL2_mixer-devel \
libxslt-devel python-devel python3-lxml"
if ! ( rpm -qv $PKG_LIST ); then
echo "Running yum (root privileges are needed)..."
su -c "yum install $PKG_LIST" || true
fi
elif [ "$ID_LIKE" == "suse opensuse" ]; then
PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel boost-devel shared-mime-info"
PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm3-devel glibmm2-devel"
if ! ( rpm -qv $PKG_LIST ); then
echo "Running zypper (root privileges are needed)..."
su -c "zypper install $PKG_LIST" || true
# Add python-lxml repository -> 3rd party
echo "Adding third party repository for python-lxml..."
su -c "zypper addrepo https://download.opensuse.org/repositories/devel:languages:python/openSUSE_Tumbleweed/devel:languages:python.repo"
su -c "zypper refresh"
su -c "zypper install python-lxml"
fi
elif [ "$ID_LIKE" == "arch" ]; then
PKG_LIST="git \
automake autoconf \
boost \
cairo \
freetype2 \
fftw \
gtk3 \
gettext \
gtkmm3 \
glibmm \
gcc \
imagemagick \
pkg-config \
intltool \
jack \
libxml2 \
libxml++2.6 \
libtool \
libpng \
libsigc++ \
libjpeg \
libmng \
mlt \
openexr \
shared-mime-info \
cmake make \
python-lxml"
echo "Running pacman (root privileges are needed)..."
echo
sudo pacman -S --needed --noconfirm $PKG_LIST || true
elif [ "$ID_LIKE" == "debian" ] || [ "$ID_LIKE" == "ubuntu" ] || [ "$ID_LIKE" == "ubuntu debian" ]; then
if [ ! -f /etc/altlinux-release ]; then
# Debian / Ubuntu
PKG_LIST=" \
build-essential \
autoconf automake autopoint \
shared-mime-info \
libltdl3-dev \
libtool \
intltool \
gettext \
libpng-dev \
libfftw3-dev \
fontconfig \
libfreetype6-dev \
libfontconfig1-dev \
libxml2-dev \
libtiff5-dev \
libmlt-dev libmlt++-dev libmlt-data \
x11proto-xext-dev libdirectfb-dev libxfixes-dev libxinerama-dev libxdamage-dev libxcomposite-dev libxcursor-dev libxft-dev libxrender-dev libxt-dev libxrandr-dev libxi-dev libxext-dev libx11-dev \
libatk1.0-dev \
libgl1-mesa-dev \
imagemagick \
libsdl2-dev \
libsdl2-mixer-dev \
bzip2 \
git-core \
libmng-dev \
libjack-jackd2-dev \
libgtkmm-3.0-dev \
libglibmm-2.4-dev \
libsigc++-2.0-dev \
libxml++2.6-dev \
libboost-system-dev \
libmagick++-dev \
libxslt-dev python-dev python3-lxml"
else
# ALT Linux case
PKG_LIST=" \
rpm-build \
git-core \
shared-mime-info \
libltdl3-devel \
intltool \
gettext \
libpng12-devel \
libjpeg-devel \
fontconfig \
libfreetype-devel \
fontconfig-devel \
libxml2-devel \
libtiff-devel \
libjasper-devel \
libdirectfb-devel \
libfftw3-dev \
libXfixes-devel \
libXinerama-devel \
libXdamage-devel \
libXcomposite-devel \
libXcursor-devel \
libXft-devel \
libXrender-devel \
libXt-devel \
libXrandr-devel \
libXi-devel \
libXext-devel \
libX11-devel \
libatk-devel \
bzip2 \
libmng-devel \
libgtkmm3-devel \
libglibmm-devel \
libsigc++2-devel \
libxml++2-devel \
libxslt-devel python-devel python3-lxml"
fi
echo "Running apt-get (root privileges are needed)..."
echo
sudo apt-get update -qq || true
sudo apt-get install -y -q $PKG_LIST
else
echo "WARNING: This build script does not work with package management systems other than yum, zypper, apt or pacman! You should install dependent packages manually."
echo "REQUIRED PACKAGES: "
echo "libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel shared-mime-info OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm30-devel glibmm24-devel"
echo ""
fi
echo "Done."