-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (44 loc) · 3.15 KB
/
Dockerfile
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
ARG MANYLINUX=2010
FROM quay.io/pypa/manylinux${MANYLINUX}_x86_64
ARG PYTHON_VERSION=36
ENV PYBIN /opt/python/cp${PYTHON_VERSION}-cp${PYTHON_VERSION}*/bin
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-Linux-x86_64.tar.gz | tar xz -C /usr/ --strip-components=1 && \
${PYBIN}/pip3 install -U pip auditwheel==3.0.0 dqcsim && \
echo "214a215" > auditwheel.patch && \
echo "> remove_platforms = list(remove_platforms)" >> auditwheel.patch && \
echo "225a227,229" >> auditwheel.patch && \
echo "> mod_pyver = os.environ.get('AUDITWHEEL_MOD_PYVER', None)" >> auditwheel.patch && \
echo "> if mod_pyver:" >> auditwheel.patch && \
echo "> fparts['pyver'] = mod_pyver" >> auditwheel.patch && \
patch /opt/_internal/cpython-3.6.10/lib/python3.6/site-packages/auditwheel/wheeltools.py auditwheel.patch && \
echo '50c50,51' > auditwheel.patch && \
echo '< "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2"' >> auditwheel.patch && \
echo '---' >> auditwheel.patch && \
echo '> "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2",' >> auditwheel.patch && \
echo '> "libdqcsim.so"' >> auditwheel.patch && \
echo '76c77,78' >> auditwheel.patch && \
echo '< "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2"' >> auditwheel.patch && \
echo '---' >> auditwheel.patch && \
echo '> "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2",' >> auditwheel.patch && \
echo '> "libdqcsim.so"' >> auditwheel.patch && \
patch /opt/_internal/cpython-3.6.10/lib/python3.6/site-packages/auditwheel/policy/policy.json auditwheel.patch && \
echo '74a75,80' > auditwheel.patch && \
echo "> elif pkg_root.endswith('.data'):" >> auditwheel.patch && \
echo '> # If this is a file in the .data section of the wheel, using' >> auditwheel.patch && \
echo '> # .libs will not work. In order to not make assumptions about' >> auditwheel.patch && \
echo '> # the data dir we place the libs in a subdir of where the' >> auditwheel.patch && \
echo '> # binary resides, named `<binary>.libs`.' >> auditwheel.patch && \
echo "> dest_dir = pjoin(fn + '.libs')" >> auditwheel.patch && \
patch /opt/_internal/cpython-3.6.10/lib/python3.6/site-packages/auditwheel/repair.py auditwheel.patch
ENV DQCSIM_LIB /opt/python/cp36-cp36m/lib/libdqcsim.so
ENV DQCSIM_INC /opt/python/cp36-cp36m/include
ADD . .
ENTRYPOINT ["bash", "-c", "\
${PYBIN}/python3 setup.py bdist_wheel && \
LD_LIBRARY_PATH=/opt/python/cp36-cp36m/lib AUDITWHEEL_MOD_PYVER=py35 ${PYBIN}/python3 -m auditwheel repair -w /io/dist target/python/dist/*.whl && \
sleep 2 && \
LD_LIBRARY_PATH=/opt/python/cp36-cp36m/lib AUDITWHEEL_MOD_PYVER=py36 ${PYBIN}/python3 -m auditwheel repair -w /io/dist target/python/dist/*.whl && \
sleep 2 && \
LD_LIBRARY_PATH=/opt/python/cp36-cp36m/lib AUDITWHEEL_MOD_PYVER=py37 ${PYBIN}/python3 -m auditwheel repair -w /io/dist target/python/dist/*.whl && \
sleep 2 && \
LD_LIBRARY_PATH=/opt/python/cp36-cp36m/lib AUDITWHEEL_MOD_PYVER=py38 ${PYBIN}/python3 -m auditwheel repair -w /io/dist target/python/dist/*.whl"]