-
Notifications
You must be signed in to change notification settings - Fork 252
/
Dockerfile.vfxplatform2018
807 lines (729 loc) · 31 KB
/
Dockerfile.vfxplatform2018
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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
FROM centos:7.3.1611
RUN yum install deltarpm -y && \
yum install -y \
# Devtools requirements
centos-release-scl \
# cmake3 requirements
epel-release && \
yum install -y \
# gcc 5.3.1 (via Devtools which is equivalent of RedHat DTS)
devtoolset-4-gcc*-5.3.1 \
# glibc 2.17
glibc-*-2.17 \
# Qt5 requirements
# http://doc.qt.io/qt-5/linux-requirements.html
libXrender* libxcb* xcb* fontconfig* freetype* libXi* libXext* libX11* libSM* libICE* libglib* libpthread* gstreamer* \
# https://wiki.qt.io/Building_Qt_5_from_Git
# Build essentials
perl-version \
# Libxcb
libxcb libxcb-devel xcb-util xcb-util-devel xcb-util-*-devel libX11-devel libXrender-devel libXi-devel \
# Accessibility
at-spi2-core-devel \
libdbus* \
# QtWebkit
flex bison gperf libicu-devel libxslt-devel ruby \
# QtMultimedia
alsa-lib alsa-lib-devel gstreamer gstreamer-devel gstreamer-plugins-base gstreamer-plugins-base-devel \
# libICU
libicu-devel \
# QtQuick requirements; OpenGL
# https://access.redhat.com/solutions/56301
mesa-libGL mesa-libGL-devel \
# QtWebEngine requirements (disabled because of error during make)
# http://doc.qt.io/qt-5/qtwebengine-platform-notes.html
# bison* flex* gperf* \
# python2-pkgconfig \
# dbus dbus-devel \
# fontconfig-devel \
# libxcb* \
# libdrm* \
# libXcomposite-devel \
# libXcursor-devel \
# libXi libXi-devel \
# libXrandr-devel \
# libXScrnSaver-devel \
# libXtst-devel \
# Note: khr package ???
# libcap* \
# https://wiki.qt.io/How_to_Try_QtWebEngine
# gyp ninja-build \
# mesa-libEGL-devel libgcrypt-devel libgcrypt pciutils-devel nss-devel libXtst-devel gperf \
# cups-devel pulseaudio-libs-devel libgudev1-devel systemd-devel libcap-devel alsa-lib-devel flex bison ruby \
# ninja requirements (used by QtWebEngine)
# re2c \
# https://wiki.qt.io/Building_Qt_5_from_Git
# libgcrypt-devel libgcrypt pciutils-devel nss-devel libXtst-devel gperf cups-devel pulseaudio-libs-devel libgudev1-devel systemd-devel libcap-devel alsa-lib-devel flex bison ruby gcc-c++ dbus libXrandr-devel libXcomposite-devel libXcursor-devel dbus-devel fontconfig-devel \
# Python requirements
zlib-devel openssl-devel sqlite-devel bzip2-devel readline-devel tk-devel \
valgrind-devel \
# PySide2 requirements
# https://wiki.qt.io/PySide2_GettingStarted
libxslt libxml2 libxml2-devel libxslt-devel cmake3 openssl* \
# PySide
# cmake gcc gcc-c++ make python-devel python-pip \
libxml2-devel libxslt-devel rpmdevtools \
# Xvfb etc
Xvfb \
xorg-x11-server-Xvfb \
mesa-dri-drivers \
libxkbcommon \
libxkbcommon-devel \
libxkbcommon-x11 \
libxkbcommon-x11-devel \
# Git
# gcc \
curl-devel expat-devel gettext-devel openssl-devel zlib-devel \
perl-ExtUtils-MakeMaker \
# dbus
dbus \
# general
xz wget \
&& \
yum clean all
# Parallel build processes (set to cores +1)
ENV BUILD_THREADS=17
WORKDIR /workdir
# Activate devtoolset-4 gcc 5.3.1
# RUN scl enable devtoolset-4 bash
ENV PATH="/opt/rh/devtoolset-4/root/usr/bin:${PATH}"
ENV CC=/opt/rh/devtoolset-4/root/usr/bin/gcc
ENV CXX=/opt/rh/devtoolset-4/root/usr/bin/g++
# # Check gcc version
# RUN gcc --version
# # Check glibc
# RUN ldd --version
# Cmake3
# https://cmake.org/install/
# https://cmake.org/files/
ENV CMAKE_VER=3.9.0
RUN \
wget https://cmake.org/files/v3.9/cmake-${CMAKE_VER}.tar.gz && \
tar xzf cmake-${CMAKE_VER}.tar.gz && \
cd cmake-${CMAKE_VER} && \
./bootstrap && \
make && \
make install && \
rm -rf /workdir/*
# Check cmake version
#RUN cmake --version
# Git 2.14 with "git clone --jobs" functionality and "git checkout --recurse-submodules"
# https://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/
# https://stackoverflow.com/a/44249558/2448495
ENV GIT_VER=2.14.1
RUN \
wget https://www.kernel.org/pub/software/scm/git/git-${GIT_VER}.tar.gz && \
tar xzf git-${GIT_VER}.tar.gz && \
cd git-${GIT_VER} && \
make -j${BUILD_THREADS} prefix=/usr/local/git all && \
make prefix=/usr/local/git install && \
rm -rf /workdir/*
ENV PATH="/usr/local/git/bin:${PATH}"
# Qt 4.8
# http://doc.qt.io/qt-4.8/requirements-x11.html
# Commits: http://code.qt.io/cgit/qt/qt.git/log/
# Commit: http://code.qt.io/cgit/qt/qt.git/commit/?id=0a2f2382541424726168804be2c90b91381608c6
ENV QT4_VER=4.8
ENV QT4_GIT_COMMIT=0a2f2382541424726168804be2c90b91381608c6
RUN \
git clone --recursive --jobs ${BUILD_THREADS} --branch ${QT4_VER} https://code.qt.io/qt/qt.git && \
cd qt && \
git checkout ${QT4_GIT_COMMIT} && \
git submodule update --init --recursive && \
./configure \
-opensource \
-confirm-license \
-nomake examples \
-nomake tests && \
make -j${BUILD_THREADS} && \
# Install
make install && \
# Clean up
rm -rf /workdir/*
# Qt 5.6.1, Autodesk-modified (cannot be newer than PySide2 commit SHA)
# Qt5 5.6 git commits: http://code.qt.io/cgit/qt/qt5.git/log/?h=5.6
# Autodesk qtbase git commits: https://github.com/autodesk-forks/qtbase/commits/adsk-contrib/vfx/5.6.1
# Autodesk qtx11extras git commits: https://github.com/autodesk-forks/qtx11extras/commits/adsk-contrib/vfx/5.6.1
# ---
# Hand-picked commits:
# Qt5: http://code.qt.io/cgit/qt/qt5.git/commit/?h=5.6&id=4566f0ac50e5ea143943c1251028fb01c70289ce
# Adsk qtbase: https://github.com/autodesk-forks/qtbase/commit/c4e51d0162f7619c83e25e623ecd3bc549932040
# Adsk qtx11extras: https://github.com/autodesk-forks/qtx11extras/commit/c6c59d5d902db8be3661cab929be85a38fda0faa
ENV QT5_GIT_BRANCH=5.6.1
ENV QT5_GIT_COMMIT=4566f0ac50e5ea143943c1251028fb01c70289ce
ENV ADSK_QTBASE_GIT_COMMIT=c4e51d0162f7619c83e25e623ecd3bc549932040
ENV ADSK_QTX11EXTRAS_GIT_COMMIT=c6c59d5d902db8be3661cab929be85a38fda0faa
RUN \
git clone --recursive --jobs ${BUILD_THREADS} --branch ${QT5_GIT_BRANCH} https://code.qt.io/qt/qt5.git && \
# Revert to commit SHA
cd /workdir/qt5 && \
git checkout ${QT5_GIT_COMMIT} && \
git submodule update --init --recursive && \
# Remove qtbase, qtx11extras
cd /workdir && \
rm -rf /workdir/qt5/qtbase && \
rm -rf /workdir/qt5/qtx11extras && \
# Clone Autodesk's qtbase, qtx11extras
cd /workdir && \
mkdir -p /workdir/adsk && \
git clone --recursive --branch adsk-contrib/vfx/${QT5_GIT_BRANCH} https://github.com/autodesk-forks/qtbase.git /workdir/adsk/qtbase && \
git clone --recursive --branch adsk-contrib/vfx/${QT5_GIT_BRANCH} https://github.com/autodesk-forks/qtx11extras.git /workdir/adsk/qtx11extras && \
# Revert to commit SHA for qtbase
cd /workdir/adsk/qtbase && \
git checkout ${ADSK_QTBASE_GIT_COMMIT} && \
# Revert to commit SHA for qtx11extras
cd /workdir/adsk/qtx11extras && \
git checkout ${ADSK_QTX11EXTRAS_GIT_COMMIT} && \
# Move Autodesk sources into qt5
mv /workdir/adsk/qtbase /workdir/qt5 && \
mv /workdir/adsk/qtx11extras /workdir/qt5 && \
# Build
cd /workdir/qt5 && \
# ./configure -help && \
./configure \
-opensource \
-confirm-license \
-nomake examples \
-nomake tests && \
make -j${BUILD_THREADS} && \
# Install
make install && \
# Clean up
rm -rf /workdir/*
# Qt5 Creator (cannot be newer than PySide2 commit SHA)
# https://wiki.qt.io/Building_Qt_Creator_from_Git
# Required for PySide2.QtUiTools
# qt-creator git commits: http://code.qt.io/cgit/qt-creator/qt-creator.git/log/?h=4.0
# Commit: http://code.qt.io/cgit/qt-creator/qt-creator.git/commit/?h=4.3&id=a094841bdda5461ebeaeab4620dde8222fa8312d
ENV QT5CREATOR_VER=4.3
ENV QT5CREATOR_GIT_COMMIT=a094841bdda5461ebeaeab4620dde8222fa8312d
RUN \
git clone --recursive --branch ${QT5CREATOR_VER} --jobs ${BUILD_THREADS} https://code.qt.io/qt-creator/qt-creator.git && \
cd /workdir/qt-creator && \
git checkout ${QT5CREATOR_GIT_COMMIT} && \
git submodule update --init --recursive && \
mkdir /workdir/qt-creator-build && \
cd /workdir/qt-creator-build && \
/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake -r /workdir/qt-creator/qtcreator.pro && \
make -j${BUILD_THREADS} && \
make install INSTALL_ROOT=/usr/local/qtcreator && \
rm -rf /workdir/*
# Python
# Notes:
# https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/
# http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html
# https://stackoverflow.com/questions/37345044/issue-with-installing-python-2-7-8-alongside-2-7-5-on-rhel-7-2
#
ENV PYTHON27_VER_FULL=2.7.11
ENV PYTHON27_VER=2.7
ENV PYTHON34_VER_FULL=3.4.7
ENV PYTHON34_VER=3.4
ENV PYTHON35_VER_FULL=3.5.4
ENV PYTHON35_VER=3.5
ENV PYTHON36_VER_FULL=3.6.2
ENV PYTHON36_VER=3.6
RUN \
# Python 2
mkdir -p /usr/local/python${PYTHON27_VER}/lib && \
wget https://www.python.org/ftp/python/${PYTHON27_VER_FULL}/Python-${PYTHON27_VER_FULL}.tgz && \
tar xzf Python-${PYTHON27_VER_FULL}.tgz && \
cd Python-${PYTHON27_VER_FULL} && \
# Get the configure arguments from an already existing CentOS 7-installation:
# $ python
# >>> from distutils.sysconfig import get_config_var
# >>> print get_config_var('CONFIG_ARGS')
./configure \
--prefix=/usr/local/python${PYTHON27_VER} \
--enable-shared \
--enable-unicode=ucs4 \
LDFLAGS="-Wl,-rpath /usr/local/python${PYTHON27_VER}/lib" \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--enable-ipv6 \
--with-dbmliborder=gdbm:ndbm:bdb \
--with-system-expat \
--with-system-ffi \
--with-valgrind \
build_alias=x86_64-redhat-linux-gnu \
host_alias=x86_64-redhat-linux-gnu \
CC=gcc \
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv" \
CPPFLAGS="-I/usr/lib64/libffi-3.0.5/include" && \
make -j${BUILD_THREADS} && \
make altinstall && \
cd /workdir && \
wget https://bootstrap.pypa.io/get-pip.py && \
/usr/local/python${PYTHON27_VER}/bin/python${PYTHON27_VER} get-pip.py && \
/usr/local/python${PYTHON27_VER}/bin/pip${PYTHON27_VER} install -U pip && \
rm -rf /workdir/* && \
# Python 3.4
cd /workdir && \
mkdir -p /usr/local/python${PYTHON34_VER}/lib && \
wget https://www.python.org/ftp/python/${PYTHON34_VER_FULL}/Python-${PYTHON34_VER_FULL}.tgz && \
tar xzf Python-${PYTHON34_VER_FULL}.tgz && \
cd Python-${PYTHON34_VER_FULL} && \
# Get the configure arguments from an already existing CentOS 7-installation:
# $ python
# >>> from distutils.sysconfig import get_config_var
# >>> print(get_config_var('CONFIG_ARGS'))
./configure \
--prefix=/usr/local/python${PYTHON34_VER} \
--enable-shared \
LDFLAGS="-Wl,-rpath /usr/local/python${PYTHON34_VER}/lib" \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--enable-ipv6 \
--with-computed-gotos=yes \
--with-dbmliborder=gdbm:ndbm:bdb \
--with-system-expat \
--with-system-ffi \
--with-valgrind \
--without-ensurepip \
build_alias=x86_64-redhat-linux-gnu \
host_alias=x86_64-redhat-linux-gnu \
CC=gcc \
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv" \
CPPFLAGS="-I/usr/lib64/libffi-3.0.5/include" \
PKG_CONFIG_PATH=":/usr/lib64/pkgconfig:/usr/share/pkgconfig" && \
make -j${BUILD_THREADS} && \
make altinstall && \
cd /workdir && \
wget https://bootstrap.pypa.io/get-pip.py && \
/usr/local/python${PYTHON34_VER}/bin/python${PYTHON34_VER} get-pip.py && \
/usr/local/python${PYTHON34_VER}/bin/pip${PYTHON34_VER} install -U pip && \
rm -rf /workdir/* && \
# Python 3.5
cd /workdir && \
mkdir -p /usr/local/python${PYTHON35_VER}/lib && \
wget https://www.python.org/ftp/python/${PYTHON35_VER_FULL}/Python-${PYTHON35_VER_FULL}.tgz && \
tar xzf Python-${PYTHON35_VER_FULL}.tgz && \
cd Python-${PYTHON35_VER_FULL} && \
# Get the configure arguments from an already existing CentOS 7-installation:
# $ python
# >>> from distutils.sysconfig import get_config_var
# >>> print(get_config_var('CONFIG_ARGS'))
./configure \
--prefix=/usr/local/python${PYTHON35_VER} \
--enable-shared \
LDFLAGS="-Wl,-rpath /usr/local/python${PYTHON35_VER}/lib" \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--enable-ipv6 \
--with-computed-gotos=yes \
--with-dbmliborder=gdbm:ndbm:bdb \
--with-system-expat \
--with-system-ffi \
--with-valgrind \
--without-ensurepip \
build_alias=x86_64-redhat-linux-gnu \
host_alias=x86_64-redhat-linux-gnu \
CC=gcc \
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv" \
CPPFLAGS="-I/usr/lib64/libffi-3.0.5/include" \
PKG_CONFIG_PATH=":/usr/lib64/pkgconfig:/usr/share/pkgconfig" && \
make -j${BUILD_THREADS} && \
make altinstall && \
cd /workdir && \
wget https://bootstrap.pypa.io/get-pip.py && \
/usr/local/python${PYTHON35_VER}/bin/python${PYTHON35_VER} get-pip.py && \
/usr/local/python${PYTHON35_VER}/bin/pip${PYTHON35_VER} install -U pip && \
rm -rf /workdir/* && \
# Python 3.6
cd /workdir && \
mkdir -p /usr/local/python${PYTHON36_VER}/lib && \
wget https://www.python.org/ftp/python/${PYTHON36_VER_FULL}/Python-${PYTHON36_VER_FULL}.tgz && \
tar xzf Python-${PYTHON36_VER_FULL}.tgz && \
cd Python-${PYTHON36_VER_FULL} && \
# Get the configure arguments from an already existing CentOS 7-installation:
# $ python
# >>> from distutils.sysconfig import get_config_var
# >>> print(get_config_var('CONFIG_ARGS'))
./configure \
--prefix=/usr/local/python${PYTHON36_VER} \
--enable-shared \
LDFLAGS="-Wl,-rpath /usr/local/python${PYTHON36_VER}/lib" \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--enable-ipv6 \
--with-computed-gotos=yes \
--with-dbmliborder=gdbm:ndbm:bdb \
--with-system-expat \
--with-system-ffi \
--with-valgrind \
--without-ensurepip \
build_alias=x86_64-redhat-linux-gnu \
host_alias=x86_64-redhat-linux-gnu \
CC=gcc \
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv" \
CPPFLAGS="-I/usr/lib64/libffi-3.0.5/include" \
PKG_CONFIG_PATH=":/usr/lib64/pkgconfig:/usr/share/pkgconfig" && \
make -j${BUILD_THREADS} && \
make altinstall && \
cd /workdir && \
wget https://bootstrap.pypa.io/get-pip.py && \
/usr/local/python${PYTHON36_VER}/bin/python${PYTHON36_VER} get-pip.py && \
/usr/local/python${PYTHON36_VER}/bin/pip${PYTHON36_VER} install -U pip && \
rm -rf /workdir/*
# Register Python as default (without replacing system-python and without breaking e.g. yum)
RUN \
# Python 2.7
ln -s /usr/local/python${PYTHON27_VER}/bin/python${PYTHON27_VER} /usr/local/bin/python && \
ln -s /usr/local/python${PYTHON27_VER}/bin/python${PYTHON27_VER} /usr/local/bin/python${PYTHON27_VER} && \
ln -s /usr/local/python${PYTHON27_VER}/bin/pip${PYTHON27_VER} /usr/local/bin/pip && \
ln -s /usr/local/python${PYTHON27_VER}/bin/pip${PYTHON27_VER} /usr/local/bin/pip${PYTHON27_VER} && \
# Python 3.4
ln -s /usr/local/python${PYTHON34_VER}/bin/python${PYTHON34_VER} /usr/local/bin/python${PYTHON34_VER} && \
ln -s /usr/local/python${PYTHON34_VER}/bin/pip${PYTHON34_VER} /usr/local/bin/pip${PYTHON34_VER} && \
# Python 3.5
ln -s /usr/local/python${PYTHON35_VER}/bin/python${PYTHON35_VER} /usr/local/bin/python${PYTHON35_VER} && \
ln -s /usr/local/python${PYTHON35_VER}/bin/pip${PYTHON35_VER} /usr/local/bin/pip${PYTHON35_VER} && \
# Python 3.6
ln -s /usr/local/python${PYTHON36_VER}/bin/python${PYTHON36_VER} /usr/local/bin/python${PYTHON36_VER} && \
ln -s /usr/local/python${PYTHON36_VER}/bin/pip${PYTHON36_VER} /usr/local/bin/pip${PYTHON36_VER}
ENV PATH="/usr/local/bin:${PATH}"
# Pip packages
RUN \
# Python 2.7
pip${PYTHON27_VER} install -U \
# Qt.py testing (nosepipe etc)
nose \
nosepipe \
six \
packaging \
# General build
setuptools \
wheel && \
ln -s /usr/local/python${PYTHON27_VER}/bin/nosetests /usr/local/bin/nosetests${PYTHON27_VER} && \
# Python 3.4
pip${PYTHON34_VER} install -U \
# Qt.py testing (nosepipe etc)
nose \
nosepipe \
six \
packaging \
# General build
setuptools \
wheel && \
ln -s /usr/local/python${PYTHON34_VER}/bin/nosetests /usr/local/bin/nosetests${PYTHON34_VER} && \
# Python 3.5
pip${PYTHON35_VER} install -U \
# Qt.py testing (nosepipe etc)
nose \
nosepipe \
six \
packaging \
# General build
setuptools \
wheel && \
ln -s /usr/local/python${PYTHON35_VER}/bin/nosetests /usr/local/bin/nosetests${PYTHON35_VER} && \
# Python 3.6
pip${PYTHON36_VER} install -U \
# Qt.py testing (nosepipe etc)
nose \
nosepipe \
six \
packaging \
# General build
setuptools \
wheel && \
ln -s /usr/local/python${PYTHON36_VER}/bin/nosetests /usr/local/bin/nosetests${PYTHON36_VER}
# Sip (for PyQt4 and PyQt5)
# http://pyqt.sourceforge.net/Docs/sip4/
ENV SIP_VER=4.18.1
RUN \
# Python 2.7
wget http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VER}/sip-${SIP_VER}.tar.gz && \
tar -xvf sip-${SIP_VER}.tar.gz && \
cd sip-${SIP_VER} && \
python${PYTHON27_VER} configure.py && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# Python 3.4
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VER}/sip-${SIP_VER}.tar.gz && \
tar -xvf sip-${SIP_VER}.tar.gz && \
cd sip-${SIP_VER} && \
python${PYTHON34_VER} configure.py && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# Python 3.5
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VER}/sip-${SIP_VER}.tar.gz && \
tar -xvf sip-${SIP_VER}.tar.gz && \
cd sip-${SIP_VER} && \
python${PYTHON35_VER} configure.py && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# Python 3.6
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VER}/sip-${SIP_VER}.tar.gz && \
tar -xvf sip-${SIP_VER}.tar.gz && \
cd sip-${SIP_VER} && \
python${PYTHON36_VER} configure.py && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/*
# PyQt4
# The version of PyQt4 must be compatible with the SIP version used to build PyQt5
# http://pyqt.sourceforge.net/Docs/PyQt4/installation.html
ENV PYQT4_VER=4.11.4
RUN \
# PyQt4 for Python 2
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-${PYQT4_VER}/PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
tar -xvf PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
cd PyQt-x11-gpl-${PYQT4_VER} && \
# python${PYTHON27_VER} configure-ng.py \
python${PYTHON27_VER} configure.py \
# --verbose \
--confirm-license \
# --qmake=/usr/bin/qmake-qt4 \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake && \
# --sip=/usr/local/python${PYTHON27_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt4 for Python 3.4
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-${PYQT4_VER}/PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
tar -xvf PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
cd PyQt-x11-gpl-${PYQT4_VER} && \
# python${PYTHON34_VER} configure-ng.py \
python${PYTHON34_VER} configure.py \
# --verbose \
--confirm-license \
# --qmake=/usr/bin/qmake-qt4 \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake && \
# --sip=/usr/local/python${PYTHON27_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt4 for Python 3.5
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-${PYQT4_VER}/PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
tar -xvf PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
cd PyQt-x11-gpl-${PYQT4_VER} && \
# python${PYTHON35_VER} configure-ng.py \
python${PYTHON35_VER} configure.py \
# --verbose \
--confirm-license \
# --qmake=/usr/bin/qmake-qt4 \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake && \
# --sip=/usr/local/python${PYTHON27_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt4 for Python 3.6
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-${PYQT4_VER}/PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
tar -xvf PyQt-x11-gpl-${PYQT4_VER}.tar.gz && \
cd PyQt-x11-gpl-${PYQT4_VER} && \
# python${PYTHON36_VER} configure-ng.py \
python${PYTHON36_VER} configure.py \
# --verbose \
--confirm-license \
# --qmake=/usr/bin/qmake-qt4 \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake && \
# --sip=/usr/local/python${PYTHON27_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/*
# PySide
# Note: requires cmake3
# http://pyside.readthedocs.io/en/latest/building/options.html
# PySide commits: https://github.com/pyside/pyside-setup/commits/master
# Commit: https://github.com/pyside/pyside-setup/commit/7860bda363438e96fa9e810def0858635a9766cc
ENV PYSIDE_GIT_COMMIT=7860bda363438e96fa9e810def0858635a9766cc
RUN \
# PySide for Python 2
git clone --recursive --jobs ${BUILD_THREADS} https://github.com/fredrikaverpil/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE_GIT_COMMIT} && \
git submodule update --init --recursive && \
python${PYTHON27_VER} setup.py \
install \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
rm -rf /workdir/* && \
# PySide for Python 3.4
cd /workdir && \
git clone --recursive --jobs ${BUILD_THREADS} https://github.com/fredrikaverpil/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE_GIT_COMMIT} && \
git submodule update --init --recursive && \
python${PYTHON34_VER} setup.py \
install \
--qmake=/usr/local/Trolltech/Qt-4.8.7/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
rm -rf /workdir/*
# Ugly fix to make PySide find the Qt4 libs
ENV LD_LIBRARY_PATH="/usr/local/Trolltech/Qt-4.8.7/lib:${LD_LIBRARY_PATH}"
# PyQt5
# http://pyqt.sourceforge.net/Docs/PyQt5/installation.html#building-and-installing-from-source
ENV PYQT5_VER=5.6
RUN \
# PyQt5 for Python 2
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VER}/PyQt5_gpl-${PYQT5_VER}.tar.gz && \
tar -xvf PyQt5_gpl-${PYQT5_VER}.tar.gz && \
cd PyQt5_gpl-${PYQT5_VER} && \
python${PYTHON27_VER} configure.py \
# --verbose \
--confirm-license \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--sip=/usr/local/python${PYTHON27_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt5 for Python 3.4
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VER}/PyQt5_gpl-${PYQT5_VER}.tar.gz && \
tar -xvf PyQt5_gpl-${PYQT5_VER}.tar.gz && \
cd PyQt5_gpl-${PYQT5_VER} && \
python${PYTHON34_VER} configure.py \
# --verbose \
--confirm-license \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--sip=/usr/local/python${PYTHON34_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt5 for Python 3.5
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VER}/PyQt5_gpl-${PYQT5_VER}.tar.gz && \
tar -xvf PyQt5_gpl-${PYQT5_VER}.tar.gz && \
cd PyQt5_gpl-${PYQT5_VER} && \
python${PYTHON35_VER} configure.py \
# --verbose \
--confirm-license \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--sip=/usr/local/python${PYTHON35_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/* && \
# PyQt5 for Python 3.6
cd /workdir && \
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VER}/PyQt5_gpl-${PYQT5_VER}.tar.gz && \
tar -xvf PyQt5_gpl-${PYQT5_VER}.tar.gz && \
cd PyQt5_gpl-${PYQT5_VER} && \
python${PYTHON36_VER} configure.py \
# --verbose \
--confirm-license \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--sip=/usr/local/python${PYTHON36_VER}/bin/sip && \
make -j${BUILD_THREADS} && \
make install && \
rm -rf /workdir/*
# PySide2 (has no maintained semantic versioning)
# PySide2 5.6 git commits: http://code.qt.io/cgit/pyside/pyside.git/log/?h=5.6
# PySide2 commit: http://code.qt.io/cgit/pyside/pyside-setup.git/commit/?h=5.6&id=117e0ff91275b4bc06dd5383f19e7028c5ef6ff8
ENV PYSIDE2_GIT_BRANCH=5.6
ENV PYSIDE2_GIT_COMMIT=117e0ff91275b4bc06dd5383f19e7028c5ef6ff8
RUN \
# PySide2 for Python 2
git clone --recursive --jobs ${BUILD_THREADS} --branch ${PYSIDE2_GIT_BRANCH} https://code.qt.io/pyside/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE2_GIT_COMMIT} && \
git submodule update --init --recursive && \
# Fix bug https://bugreports.qt.io/browse/PYSIDE-357
sed -i -e "s~\b\(packages\b.*\)],~\1, 'pyside2uic.Compiler', 'pyside2uic.port_v' + str(sys.version_info[0])],~" setup.py && \
# cat setup.py && \
python${PYTHON27_VER} setup.py \
# bdist_wheel \
install \
--ignore-git \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
# pip install /workdir/pyside-setup/dist/*.whl
rm -rf /workdir/* && \
# PySide2 for Python 3.4
cd /workdir && \
git clone --recursive --jobs ${BUILD_THREADS} --branch ${PYSIDE2_GIT_BRANCH} https://code.qt.io/pyside/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE2_GIT_COMMIT} && \
git submodule update --init --recursive && \
# Fix bug https://bugreports.qt.io/browse/PYSIDE-357
sed -i -e "s~\b\(packages\b.*\)],~\1, 'pyside2uic.Compiler', 'pyside2uic.port_v' + str(sys.version_info[0])],~" setup.py && \
# cat setup.py && \
python${PYTHON34_VER} setup.py \
# bdist_wheel \
install \
--ignore-git \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
# pip install /workdir/pyside-setup/dist/*.whl
rm -rf /workdir/* && \
# PySide2 for Python 3.5
cd /workdir && \
git clone --recursive --jobs ${BUILD_THREADS} --branch ${PYSIDE2_GIT_BRANCH} https://code.qt.io/pyside/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE2_GIT_COMMIT} && \
git submodule update --init --recursive && \
# Fix bug https://bugreports.qt.io/browse/PYSIDE-357
sed -i -e "s~\b\(packages\b.*\)],~\1, 'pyside2uic.Compiler', 'pyside2uic.port_v' + str(sys.version_info[0])],~" setup.py && \
# cat setup.py && \
python${PYTHON35_VER} setup.py \
# bdist_wheel \
install \
--ignore-git \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
# pip install /workdir/pyside-setup/dist/*.whl
rm -rf /workdir/* && \
# PySide2 for Python 3.6
cd /workdir && \
git clone --recursive --jobs ${BUILD_THREADS} --branch ${PYSIDE2_GIT_BRANCH} https://code.qt.io/pyside/pyside-setup.git && \
cd pyside-setup && \
git checkout ${PYSIDE2_GIT_COMMIT} && \
git submodule update --init --recursive && \
# Fix bug https://bugreports.qt.io/browse/PYSIDE-357
sed -i -e "s~\b\(packages\b.*\)],~\1, 'pyside2uic.Compiler', 'pyside2uic.port_v' + str(sys.version_info[0])],~" setup.py && \
# cat setup.py && \
python${PYTHON36_VER} setup.py \
# bdist_wheel \
install \
--ignore-git \
--qmake=/usr/local/Qt-${QT5_GIT_BRANCH}/bin/qmake \
--cmake=/usr/local/bin/cmake \
--openssl=/usr/bin/openssl \
--jobs=${BUILD_THREADS} && \
# pip install /workdir/pyside-setup/dist/*.whl
rm -rf /workdir/*
# Ugly fix to make PySide2 find the Qt5 libs
ENV LD_LIBRARY_PATH="/usr/local/Qt-${QT5_GIT_BRANCH}/lib:${LD_LIBRARY_PATH}"
# https://github.com/GoogleCloudPlatform/gsutil/issues/221#issuecomment-165353957
ENV LANG=en_US.UTF-8
# CentOS 7 issue: Default locale is set to en_US.UTF-8 but it's missing
# https://github.com/CentOS/sig-cloud-instance-images/issues/71#issuecomment-266959225
# RUN yum reinstall -y glibc-common
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
# Fix dbus error
# http://www.torkwrench.com/2011/12/16/d-bus-library-appears-to-be-incorrectly-set-up-failed-to-read-machine-uuid-failed-to-open-varlibdbusmachine-id/
RUN dbus-uuidgen > /var/lib/dbus/machine-id
# VFX Platform
ENV VFXPLATFORM 2018
# Enable additional output from Qt.py
ENV QT_VERBOSE true
ENV QT_TESTING true
# Xvfb
ENV DISPLAY :99
# Prevent error: "Qt: Failed to create XKB context!"
# https://lists.debian.org/debian-backports/2014/10/msg00061.html
ENV QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
# Warnings are exceptions
ENV PYTHONWARNINGS="ignore"
WORKDIR /workdir/Qt.py
# Put chmod command in here, in case we change the entrypoint in the future using
# docker run --entrypoint=...
ENTRYPOINT cp -r /Qt.py /workdir && chmod +x entrypoint.sh && ./entrypoint.sh