Skip to content

Commit e6c8458

Browse files
BryceBeaglestlehmann
authored andcommitted
Dockerfile to build PyQt stubs
1 parent c770082 commit e6c8458

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Careful, the version and build date are both dates, but different formats
2+
ARG ARCH_VERSION="20200407"
3+
ARG BUILD_DATE="2020/04/22"
4+
ARG PYQT_VERSION="5.14.2"
5+
6+
FROM archlinux:${ARCH_VERSION}
7+
8+
# Reuse arguments from previous build scope
9+
ARG BUILD_DATE
10+
ARG PYQT_VERSION
11+
12+
# Use Arch archive to freeze packages to a certain date
13+
RUN echo "Server=https://archive.archlinux.org/repos/${BUILD_DATE}/\$repo/os/\$arch" \
14+
| tee /etc/pacman.d/mirrorlist && \
15+
pacman -Syyuu --noconfirm
16+
17+
# Install build dependencies and Qt Modules
18+
RUN pacman --noconfirm -S \
19+
# Build stuff
20+
base-devel wget \
21+
# PyQt stuff
22+
pyqt-builder python-sip sip5 \
23+
# Qt core
24+
qt5-base \
25+
# Qt modules not included in qt5-base
26+
qt5-3d \
27+
qt5-connectivity \
28+
qt5-datavis3d \
29+
qt5-declarative \
30+
qt5-gamepad \
31+
qt5-graphicaleffects \
32+
qt5-imageformats \
33+
qt5-location \
34+
qt5-multimedia \
35+
qt5-purchasing \
36+
qt5-networkauth \
37+
qt5-remoteobjects \
38+
qt5-script \
39+
qt5-sensors \
40+
qt5-serialport \
41+
qt5-svg \
42+
qt5-tools \
43+
qt5-wayland \
44+
qt5-webchannel \
45+
qt5-webengine \
46+
qt5-webkit \
47+
qt5-websockets \
48+
qt5-x11extras \
49+
qt5-xmlpatterns \
50+
# Required for QtDBus
51+
python-dbus
52+
53+
# Download source tar
54+
WORKDIR /upstream/
55+
RUN wget --no-verbose https://pypi.io/packages/source/p/pyqt5/PyQt5-${PYQT_VERSION}.tar.gz
56+
RUN tar -xf PyQt5-${PYQT_VERSION}.tar.gz
57+
58+
# Build PyQt with stubs
59+
# TODO: Find way to build only stubs. This takes way too long
60+
WORKDIR PyQt5-${PYQT_VERSION}/
61+
RUN sip-install \
62+
--qmake /usr/bin/qmake-qt5 \
63+
--confirm-license \
64+
--pep484-pyi \
65+
--build-dir ./build \
66+
--verbose
67+
68+
# Copy all .pyi files to output dir
69+
WORKDIR /output/
70+
RUN find /upstream/PyQt5-${PYQT_VERSION}/ -name \*.pyi -exec cp {} . \;

0 commit comments

Comments
 (0)