-
Notifications
You must be signed in to change notification settings - Fork 0
/
acs_blender.sh
executable file
·363 lines (275 loc) · 13.3 KB
/
acs_blender.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
#!/bin/bash
#Lee los argumentos para recompilar blender
if [ "$1" == "recompilar" ] || [ "$1" == "recompile" ] ; then
if [ "$1" == "recompilar" ] ; then
echo "Recompilando"
fi
if [ "$1" == "recompile" ] ; then
echo "Recompiling"
fi
cd
cd blender-scr
cd blender
git pull --rebase
git submodule foreach git pull --rebase origin master
#cambia el -j3 por el numero de nucleos de tu procesador +1
#por ejemplo tu procesador tiene 4 nucleos seria asi -j5
sudo make -j 2 BUILD_CMAKE_ARGS="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost* -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES* -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.6 -D PYTHON_ROOT_DIR=/opt/lib/python-3.6 -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/opt/lib/ocio -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/opt/lib/oiio -D WITH_CYCLES_OSL=ON -D WITH_LLVM=ON -D LLVM_VERSION=3.4 -D OSL_ROOT_DIR=/opt/lib/osl -D LLVM_ROOT_DIR=/opt/lib/llvm -D LLVM_STATIC=ON -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/opt/lib/osd -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_OPENCOLLADA=ON -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_INSTALL_PORTABLE=OFF -D WITH_GAMEENGINE=ON -D WITH_PLAYER=ON -D WITH_FFTW3=ON -D WITH_MOD_OCEANSIM=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/opt/lib/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theoradec;theora;theoraenc;vorbisenc;vorbisfile;vorbis;ogg;xvidcore;vpx;mp3lame;x264;openjpeg;openjpeg_JPWL'"
cd ../build_linux
sudo make install
echo "Done / Finalizado"
exit
fi
spa_da1="Derechos de Autor"
spa_da2="(c) 2016 Wilson Omar Romero Baños (wilsoftBL)"
spa_da3="ACS-BLENDER está licenciada bajo la Licencia Creative Commons"
spa_da4="Atribución-CompartirIgual 4.0 Internacional. Para ver una copia"
spa_da5="de esta licencia, visita http://creativecommons.org/licenses/by-sa/4.0/."
spa_da6="para mas informacion y actualizaciones visite https://wilsoftbl.blogspot.com/"
eng_cp1="Copyright"
eng_cp2="(c) 2016 Wilson Omar Romero Baños (wilsoftBL)"
eng_cp3="This work is licensed under the Creative Commons"
eng_cp4="Attribution-ShareAlike 4.0 International License. To view a copy"
eng_cp5="of this license, visit http://creativecommons.org/licenses/by-sa/4.0/."
eng_cp6="For more info and updates go to https://wilsoftbl.blogspot.com/"
#center a text in terminal
#printf "%*s\n" $(((${#}+$COLUMNS)/2)) "$"
#printf "%*s\n" $(((${#variable}+$COLUMNS)/2)) "$variable"
#bucle para los espacios
#for ((espacio=0; espacio<;espacio++)) do echo ""
#done
clear
COLUMNS=$(tput cols)
banner="###########################################################################"
acs_blender_txt="################### ACS-BLENDER 1.3 ######################"
#variables generales
#variables del menu principal eng/spa/other
inicio_languaje_txt="Idioma/Language"
inicio_languaje_eng="1) English"
inicio_languaje_spa=" 2) Español"
inicio_languaje_oth="3) Otro"
inicio_languaje_null="Elija una opcion del menu"
inicio_languaje_sel="Elija una opcion / Choose an option"
select_os_ub="1)Ubuntu"
select_os_fe="2)Fedora"
#eng menu
eng_txt_select_os="Please select your Operating System"
eng_txt_dl_envu="Preparing environment for ubuntu, please wait."
eng_txt_dl_envf="Preparing environment for fedora, please wait."
eng_txt_dl_sc="Downloading the source code"
eng_txt_dl_pe="Please take a sit and wait for the next step."
eng_txt_dl_cancel="If you want to cancel the script press CTRL+C."
eng_txt_dl_dep="Downloading dependencies (without OSL, because some compatibity issues)"
eng_txt_compile="Compiling, it will take a moment"
eng_txt_susccess="The compilation has been successfully"
eng_txt_thaks="Thanks for use this script, enjoy Blender :)"
#spa menu
spa_txt_seleccionar_so="Seleccione su Sistema Operativo"
spa_txt_dl_entu="Preparando entorno para ubuntu, porfavor espere."
spa_txt_dl_entf="Preparando entorno para fedora, porfavor espere."
spa_txt_dl_cf="Descargando el codigo fuente,"
spa_txt_dl_pa="porfavor tome asiento y espere para el siguiente paso."
spa_txt_dl_cancelar="Si quiere cancelar el script presione CTRL+C"
spa_txt_dl_dep="Descargando dependencias (excluyendo OSL por compatibilidad)"
spa_txt_compilar="Compilando, esto tomara algun tiempo"
spa_txt_exito="La compilacion ha finalizado exitosamente"
spa_txt_gracias="Gracias por utilizar este script, disfruta Blender :)"
#other menu
oth_txt_dl_oo="This is otro idioma, in caso que somebody helps traduciendo"
oth_txt_dl_cccc="If you quiere cancelar the script solo press CTRL+C"
oth_txt_dl_dep="ñalskfd dependencies"
#opcion invalida
inv_option_txt="Opcion invalida/Invalid Option"
###########################################################################
###########################################################################
for ((espacio=0; espacio<4;espacio++)) do echo ""
done
printf "%*s\n" $(((${#banner}+$COLUMNS)/2)) "$banner"
printf "%*s\n" $(((${#acs_blender_txt}+$COLUMNS)/2)) "$acs_blender_txt"
printf "%*s\n" $(((${#banner}+$COLUMNS)/2)) "$banner"
echo ""
echo ""
printf "%*s\n" $(((${#inicio_languaje_txt}+$COLUMNS)/2)) "$inicio_languaje_txt"
echo ""
echo ""
printf "%*s\n" $(((${#inicio_languaje_eng}+$COLUMNS)/2)) "$inicio_languaje_eng"
printf "%*s\n" $(((${#inicio_languaje_spa}+$COLUMNS)/2)) "$inicio_languaje_spa"
#printf "%*s\n" $(((${#inicio_languaje_oth}+$COLUMNS)/2)) "$inicio_languaje_oth"
echo ""
printf "%*s\n" $(((${#inicio_languaje_sel}+$COLUMNS)/2)) "$inicio_languaje_sel"
read inicio_menu_opt
clear
case $inicio_menu_opt in
###########################################################################
###########################################################################
#menu eng
1)
#Select OS
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_select_os}+$COLUMNS)/2)) "$eng_txt_select_os"
printf "%*s\n" $(((${#select_os_ub}+$COLUMNS)/2)) "$select_os_ub"
printf "%*s\n" $(((${#select_os_fe}+$COLUMNS)/2)) "$select_os_fe"
read select_os
case $select_os in
1)
#preparing environment text ubuntu
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_dl_envu}+$COLUMNS)/2)) "$eng_txt_dl_envu"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git build-essential
cd
mkdir blender-scr
cd blender-scr
#commands to set up environment ubuntu
;;
#Preparing environment text Fedora
2)
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_dl_envf}+$COLUMNS)/2)) "$eng_txt_dl_envf"
sudo yum update
sudo yum upgrade
sudo yum install git
sudo yum groupinstall "Development Tools" "Development Libraries"
cd
mkdir blender-scr
cd blender-scr
;;
esac
#download source code text
clear
for ((espacio=0; espacio<10;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_dl_sc}+$COLUMNS)/2)) "$eng_txt_dl_sc"
printf "%*s\n" $(((${#eng_txt_dl_pe}+$COLUMNS)/2)) "$eng_txt_dl_pe"
printf "%*s\n" $(((${#eng_txt_dl_cancel}+$COLUMNS)/2)) "$eng_txt_dl_cancel"
git clone http://git.blender.org/blender.git
#commands download source code
#Instaling dependencies
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_dl_dep}+$COLUMNS)/2)) "$eng_txt_dl_dep"
./blender/build_files/build_environment/install_deps.sh --with-all
#command install dependencies
#Compiling source code text
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_compile}+$COLUMNS)/2)) "$eng_txt_compile"
cd blender
sudo make -j 2 BUILD_CMAKE_ARGS="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost* -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES* -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.6 -D PYTHON_ROOT_DIR=/opt/lib/python-3.6 -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/opt/lib/ocio -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/opt/lib/oiio -D WITH_CYCLES_OSL=ON -D WITH_LLVM=ON -D LLVM_VERSION=3.4 -D OSL_ROOT_DIR=/opt/lib/osl -D LLVM_ROOT_DIR=/opt/lib/llvm -D LLVM_STATIC=ON -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/opt/lib/osd -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_OPENCOLLADA=ON -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_INSTALL_PORTABLE=OFF -D WITH_GAMEENGINE=ON -D WITH_PLAYER=ON -D WITH_FFTW3=ON -D WITH_MOD_OCEANSIM=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/opt/lib/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theoradec;theora;theoraenc;vorbisenc;vorbisfile;vorbis;ogg;xvidcore;vpx;mp3lame;x264;openjpeg;openjpeg_JPWL'"
cd ../build_linux
sudo make install
for ((espacio=0; espacio<3;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_txt_susccess}+$COLUMNS)/2)) "$eng_txt_susccess"
#Compiling source code commands
#finishing and copyright
clear
for ((espacio=0; espacio<7;espacio++)) do echo ""
done
printf "%*s\n" $(((${#eng_cp1}+$COLUMNS)/2)) "$eng_cp1"
printf "%*s\n" $(((${#eng_cp2}+$COLUMNS)/2)) "$eng_cp2"
printf "%*s\n" $(((${#eng_cp3}+$COLUMNS)/2)) "$eng_cp3"
printf "%*s\n" $(((${#eng_cp4}+$COLUMNS)/2)) "$eng_cp4"
printf "%*s\n" $(((${#eng_cp5}+$COLUMNS)/2)) "$eng_cp5"
printf "%*s\n" $(((${#eng_cp6}+$COLUMNS)/2)) "$eng_cp6"
printf "%*s\n" $(((${#eng_txt_thaks}+$COLUMNS)/2)) "$eng_txt_thaks"
;;
###########################################################################
###########################################################################
#menu spa
2)
#preparar el sistema
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_seleccionar_so}+$COLUMNS)/2)) "$spa_txt_seleccionar_so"
printf "%*s\n" $(((${#select_os_ub}+$COLUMNS)/2)) "$select_os_ub"
printf "%*s\n" $(((${#select_os_fe}+$COLUMNS)/2)) "$select_os_fe"
read select_os
case $select_os in
1)
#preparando entorno para ubuntu
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_dl_entu}+$COLUMNS)/2)) "$spa_txt_dl_entu"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git build-essential
cd
mkdir blender-scr
cd blender-scr
#comandos para preparar el entorno ubuntu
;;
#Preparando el entorno para Fedora
2)
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_dl_entf}+$COLUMNS)/2)) "$spa_txt_dl_entf"
sudo yum update
sudo yum upgrade
sudo yum install git
sudo yum groupinstall "Development Tools" "Development Libraries"
cd
mkdir blender-scr
cd blender-scr
;;
esac
#descargar codigo fuente
clear
for ((espacio=0; espacio<10;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_dl_cf}+$COLUMNS)/2)) "$spa_txt_dl_cf"
printf "%*s\n" $(((${#spa_txt_dl_pa}+$COLUMNS)/2)) "$spa_txt_dl_pa"
printf "%*s\n" $(((${#spa_txt_dl_cancelar}+$COLUMNS)/2)) "$spa_txt_dl_cancelar"
git clone http://git.blender.org/blender.git
#comandos para descargar codigo fuente
#Descargando dependencias
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_dl_dep}+$COLUMNS)/2)) "$spa_txt_dl_dep"
./blender/build_files/build_environment/install_deps.sh --with-all
#comandos para descargar dependencias
#compilando el codigo texto
clear
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_compilar}+$COLUMNS)/2)) "$spa_txt_compilar"
cd blender
sudo make -j 2 BUILD_CMAKE_ARGS="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost* -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES* -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.6 -D PYTHON_ROOT_DIR=/opt/lib/python-3.6 -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/opt/lib/ocio -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/opt/lib/oiio -D WITH_CYCLES_OSL=ON -D WITH_LLVM=ON -D LLVM_VERSION=3.4 -D OSL_ROOT_DIR=/opt/lib/osl -D LLVM_ROOT_DIR=/opt/lib/llvm -D LLVM_STATIC=ON -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/opt/lib/osd -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_OPENCOLLADA=ON -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_INSTALL_PORTABLE=OFF -D WITH_GAMEENGINE=ON -D WITH_PLAYER=ON -D WITH_FFTW3=ON -D WITH_MOD_OCEANSIM=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/opt/lib/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theoradec;theora;theoraenc;vorbisenc;vorbisfile;vorbis;ogg;xvidcore;vpx;mp3lame;x264;openjpeg;openjpeg_JPWL'"
cd ../build_linux
sudo make install
#compilando el codigo comandos
for ((espacio=0; espacio<3;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_txt_exito}+$COLUMNS)/2)) "$spa_txt_exito"
#Compiling source code commands
#finishing and copyright
clear
for ((espacio=0; espacio<7;espacio++)) do echo ""
done
printf "%*s\n" $(((${#spa_da1}+$COLUMNS)/2)) "$spa_da1"
printf "%*s\n" $(((${#spa_da2}+$COLUMNS)/2)) "$spa_da2"
printf "%*s\n" $(((${#spa_da3}+$COLUMNS)/2)) "$spa_da3"
printf "%*s\n" $(((${#spa_da4}+$COLUMNS)/2)) "$spa_da4"
printf "%*s\n" $(((${#spa_da5}+$COLUMNS)/2)) "$spa_da5"
printf "%*s\n" $(((${#spa_da6}+$COLUMNS)/2)) "$spa_da6"
printf "%*s\n" $(((${#spa_txt_gracias}+$COLUMNS)/2)) "$spa_txt_gracias"
;;
#menu null
*)
for ((espacio=0; espacio<11;espacio++)) do echo ""
done
printf "%*s\n" $(((${#inv_option_txt}+$COLUMNS)/2)) "$inv_option_txt"
sleep 4
;;
esac