Skip to content

Commit 60921cf

Browse files
author
Ezequiel Torres
committed
First changes
1 parent de97a96 commit 60921cf

File tree

4 files changed

+194
-4
lines changed

4 files changed

+194
-4
lines changed
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Set the base image
2+
FROM debian:8
3+
4+
WORKDIR /tmp
5+
6+
RUN mkdir -p /opt/mlc-python-2.7.11/bin /tmp/MLC /tmp/Scripts
7+
8+
# Create project structure
9+
ADD mlc_python_scripts/* /opt/mlc-python-2.7.11/bin/
10+
11+
# Update the current system
12+
RUN apt-get update && apt-get upgrade -y
13+
14+
# Install packages
15+
RUN apt-get install cmake \
16+
liblapack-dev \
17+
gfortran \
18+
libxml2-dev \
19+
libxslt1-dev \
20+
libshiboken-dev \
21+
ruby-dev \
22+
tcl-dev \
23+
tcl \
24+
tk \
25+
tk-dev \
26+
ssh \
27+
gcc \
28+
g++ \
29+
wget \
30+
xz-utils \
31+
make \
32+
vim \
33+
libssl-dev \
34+
libsqlite3-dev \
35+
git \
36+
freeglut3 \
37+
freeglut3-dev \
38+
binutils-gold \
39+
libglew-dev \
40+
mesa-common-dev \
41+
build-essential \
42+
'^libxcb.*-dev' \
43+
libx11-xcb-dev \
44+
libglu1-mesa-dev \
45+
libxrender-dev \
46+
libxi-dev \
47+
libxkbcommon-dev \
48+
libreadline5 \
49+
libreadline6 \
50+
libreadline6-dev \
51+
libreadline-dev \
52+
rubygems \
53+
-y
54+
55+
# Download python 2.7.11
56+
# For more information about the compilation of the Python: http://www.mathworks.com/help/matlab/matlab_external/system-requirements-for-matlab-engine-for-python.html?requestedDomain=www.mathworks.com
57+
RUN wget -q https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz && \
58+
tar xJvf Python-2.7.11.tar.xz && \
59+
cd Python-2.7.11 && ./configure --enable-shared --enable-unicode=ucs4 --prefix=/opt/mlc-python-2.7.11 && make && make install && \
60+
rm -rf /tmp/Python-2.7.11*
61+
62+
# Install Python Setuptools
63+
RUN wget -q https://pypi.python.org/packages/source/s/setuptools/setuptools-20.1.1.tar.gz#md5=10a0f4feb9f2ea99acf634c8d7136d6d && \
64+
tar xzvf setuptools-20.1.1.tar.gz && \
65+
cd setuptools-20.1.1 && /opt/mlc-python-2.7.11/bin/mlc_python setup.py build && /opt/mlc-python-2.7.11/bin/mlc_python setup.py install && \
66+
rm -rf /tmp/setuptools-20.1.1*
67+
68+
69+
# Idem with pip
70+
RUN wget -q https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb && \
71+
tar xzvf pip-8.0.2.tar.gz && \
72+
cd pip-8.0.2 && /opt/mlc-python-2.7.11/bin/mlc_python setup.py build && /opt/mlc-python-2.7.11/bin/mlc_python setup.py install && \
73+
rm -rf /tmp/pip-8.0.2*
74+
75+
# Install Qt5.7
76+
RUN git clone git://code.qt.io/qt/qtbase.git && \
77+
cd qtbase && \
78+
git checkout 5.7 && \
79+
./configure --prefix=/opt/mlc-python-2.7.11/Qt-5.7.1 -xkb-config-root /usr/share/X11/xkb -no-gtk -nomake tests -nomake examples -qt-xcb --opensource --confirm-license && \
80+
make -j4 && make install && \
81+
rm -rf /tmp/qtbase
82+
83+
RUN git clone git://code.qt.io/qt/qttools.git && \
84+
cd qttools && \
85+
git checkout 5.7 && \
86+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \
87+
rm -rf /tmp/qttools
88+
89+
RUN git clone git://code.qt.io/qt/qtcharts.git && \
90+
cd qtcharts && \
91+
git checkout 5.7 && \
92+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \
93+
rm -rf /tmp/qtcharts
94+
95+
RUN git clone git://code.qt.io/qt/qtdatavis3d.git && \
96+
cd qtdatavis3d && \
97+
git checkout 5.7 && \
98+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \
99+
rm -rf /tmp/qtdatavis3d
100+
101+
RUN git clone git://code.qt.io/qt/qtdeclarative.git && \
102+
cd qtdeclarative && \
103+
git checkout 5.7 && \
104+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \
105+
rm -rf /tmp/qtdeclarative
106+
107+
RUN git clone git://code.qt.io/qt/qtx11extras.git && \
108+
cd qtx11extras && \
109+
git checkout 5.7 && \
110+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \
111+
rm -rf /tmp/qtx11extras
112+
113+
RUN git clone https://github.com/mati75/qt5ct.git && \
114+
cd qt5ct && \
115+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake PREFIX=/opt/mlc-python-2.7.11/qt5ct && make -j4 && make install && \
116+
rm -rf /tmp/qt5ct
117+
118+
RUN git clone git://code.qt.io/qt/qtstyleplugins.git && \
119+
cd qtstyleplugins && \
120+
/opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake && make && \
121+
mkdir -p /opt/mlc-python-2.7.11/Qt-5.7.1/plugins/styles && \
122+
cp -r ./plugins/styles/* /opt/mlc-python-2.7.11/Qt-5.7.1/plugins/styles && \
123+
rm -rf /tmp/qtstyleplugins
124+
125+
# Add PyQt5 Support
126+
RUN wget https://sourceforge.net/projects/pyqt/files/sip/sip-4.19/sip-4.19.tar.gz && \
127+
tar xzvf sip-4.19.tar.gz && \
128+
cd sip-4.19 && \
129+
/opt/mlc-python-2.7.11/bin/mlc_python configure.py && \
130+
make -j4 && make install && \
131+
rm -rf /tmp/sip-4.19*
132+
133+
RUN wget https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.7.1/PyQt5_gpl-5.7.1.tar.gz && \
134+
tar xzvf PyQt5_gpl-5.7.1.tar.gz && \
135+
cd PyQt5_gpl-5.7.1 && \
136+
/opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --confirm-license --sip /opt/mlc-python-2.7.11/bin/sip && \
137+
make -j4 && make install && \
138+
rm -rf /tmp/PyQt5_gpl-5.7.1*
139+
140+
# Add PyQt5 Charts
141+
RUN wget https://sourceforge.net/projects/pyqt/files/PyQtChart/PyQtChart-5.7.1/PyQtChart_gpl-5.7.1.tar.gz && \
142+
tar xzvf PyQtChart_gpl-5.7.1.tar.gz && \
143+
cd PyQtChart_gpl-5.7.1 && \
144+
/opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --sip /opt/mlc-python-2.7.11/bin/sip && \
145+
make -j4 && make install && \
146+
rm -rf /tmp/PyQtChart_gpl-5.7.1*
147+
148+
RUN wget https://sourceforge.net/projects/pyqt/files/PyQtDataVisualization/PyQtDataVisualization-5.7.1/PyQtDataVisualization_gpl-5.7.1.tar.gz/download -O PyQtDataVisualization_gpl-5.7.1.tar.gz && \
149+
tar xzvf PyQtDataVisualization_gpl-5.7.1.tar.gz && \
150+
cd PyQtDataVisualization_gpl-5.7.1 && \
151+
/opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --sip /opt/mlc-python-2.7.11/bin/sip && \
152+
make -j4 && make install && \
153+
rm -rf /tmp/PyQtDataVisualization_gpl-5.7.1*
154+
155+
# Install mlc dependencies
156+
# Create .sh who will load the desired enviroment to run nosetests within it
157+
RUN export LD_LIBRARY_PATH=/usr/local/Qt-5.7.1/lib:$LD_LIBRARY_PATH && \
158+
export PATH=/usr/local/Qt-5.7.1/bin:$PATH && \
159+
/opt/mlc-python-2.7.11/bin/mlc_pip install ipython numpy flask requests pyserial nose pyyaml coverage matplotlib scipy pyusb
160+
161+
RUN gem install fpm
162+
163+
ARG RELEASE
164+
ENV RELEASE ${RELEASE}
165+
ENV OS_VERSION debian-8
166+
ENV PACKAGE_TYPE deb
167+
ADD deploy_scripts/* /tmp/deploy_scripts/
168+
ENTRYPOINT ["/tmp/deploy_scripts/create_MLC_folder.sh"]

tools/installer/Dockerfiles/deploy_scripts/create_MLC_folder.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
MLC_PATH="/tmp/MLC-$RELEASE"
33
# Create the containing folder
44
mkdir -p $MLC_PATH/tools
5-
ENTRYPOINT ["/tmp/deploy_scripts/create_MLC_folder.sh"]
65

76
# Download the MLC code from Github
87
wget "https://github.com/Ezetowers/MLC/archive/v$RELEASE.tar.gz"
@@ -11,28 +10,39 @@ rm -rf /tmp/v$RELEASE.tar.gz
1110

1211
# Add the mlc_python
1312
cp -r /opt/mlc-python-2.7.11 $MLC_PATH/mlc_python
13+
chmod a+x $MLC_PATH/mlc_python/bin/*
1414

1515
# Add project scripts
1616
cp -r /tmp/deploy_scripts/mlc.sh.in $MLC_PATH/mlc.sh
1717
sed -i "s/^\([^@]*\)@\([^@]*\)@$/\1$RELEASE/" $MLC_PATH/mlc.sh
18-
cp -r /tmp/deploy_scripts/install_matlab_engine.sh $MLC_PATH/tools
1918

20-
# Create symbolic links to mlc_python and mlc_ipython
2119
cd $MLC_PATH
2220
ln -s mlc_python/bin/mlc_python mlc_python.sh
2321
ln -s mlc_python/bin/mlc_ipython mlc_ipython.sh
2422
ln -s mlc_python/bin/mlc_pip mlc_pip.sh
2523

24+
# Add tools scripts
25+
cp -r /tmp/deploy_scripts/install_matlab_engine.sh $MLC_PATH/tools
26+
cp -r /tmp/deploy_scripts/qt5ct.qt.conf $MLC_PATH/mlc_python/qt5ct/bin/qt.conf
27+
cp -r /tmp/deploy_scripts/qt5ct.sh $MLC_PATH/tools
28+
chmod a+x $MLC_PATH/tools/*
29+
2630
# Clean unnecesary files in the MLC package
2731
find $MLC_PATH/mlc_python -name "*.pyc" | xargs rm -rf
2832
find $MLC_PATH/mlc_python -name "*.pyo" | xargs rm -rf
2933
find $MLC_PATH/mlc_python -name "*.pyd" | xargs rm -rf
3034
find $MLC_PATH/mlc_python -name "test" | xargs rm -rf
35+
rm -rf $MLC_PATH/MLC-$RELEASE/tools/Kicad_Projects
36+
rm -rf $MLC_PATH/MLC-$RELEASE/tools/installer
37+
rm -rf $MLC_PATH/MLC-$RELEASE/tests
38+
rm -rf $MLC_PATH/MLC-$RELEASE/doc
39+
rm -rf $MLC_PATH/MLC-$RELEASE/bugs
40+
rm -rf $MLC_PATH/MLC-$RELEASE/matlab_code
3141
rm -rf $MLC_PATH/Qt-5.7.1/docs
3242
rm -rf $MLC_PATH/Qt-5.7.1/include
3343
rm -rf $MLC_PATH/Qt-5.7.1/mkspecs
3444

3545
# Create the MLC Package
3646
tar cJvpf /tmp/MLC-$RELEASE-$OS_VERSION.tar.xz -C /tmp MLC-$RELEASE
3747
fpm -s dir -t $PACKAGE_TYPE -v $RELEASE -n mlc-python-$OS_VERSION /opt/mlc-python-2.7.11
38-
bash
48+
bash
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Paths]
2+
Prefix=../../Qt-5.7.1
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
export ROOTPATH="$(dirname "$(readlink -f "$0")")/.."
3+
4+
# Execute the qt5ct
5+
unset QT_STYLE_OVERRIDE
6+
export QT_QPA_PLATFORMTHEME=qt5ct
7+
export LD_LIBRARY_PATH=$ROOTPATH/mlc_python/lib:$LD_LIBRARY_PATH
8+
export LD_LIBRARY_PATH=$ROOTPATH/mlc_python/custom_libs:$LD_LIBRARY_PATH
9+
export LD_LIBRARY_PATH=$ROOTPATH/mlc_python/Qt-5.7.1/lib:$LD_LIBRARY_PATH
10+
$ROOTPATH/mlc_python/qt5ct/bin/qt5ct

0 commit comments

Comments
 (0)