summaryrefslogtreecommitdiff
path: root/scripts/dev/ci/docker/Dockerfile.j2
blob: e9a0facd7e6f38461eb69313a1c36728d1229da9 (plain)
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
FROM archlinux:latest

RUN pacman-key --init && pacman-key --populate
{% if unstable %}
RUN sed -i '/^# after the header/a[kde-unstable]\nInclude = /etc/pacman.d/mirrorlist\n\n[testing]\nInclude = /etc/pacman.d/mirrorlist\n\n[community-testing]\nInclude = /etc/pacman.d/mirrorlist' /etc/pacman.conf
{% endif %}
RUN pacman -Sy --noconfirm archlinux-keyring
RUN pacman -Su --noconfirm \
    git \
    {% if webengine %}
    python-tox \
    python-distlib \
    {% endif %}
    {% if qt6 %}
      qt6-base \
      qt6-declarative \
      {% if webengine %}
        qt6-webengine python-pyqt6-webengine \
      {% else %}{{ 1/0 }}{% endif %}
      python-pyqt6 \
    {% else %}
      qt5-base \
      qt5-declarative \
      {% if webengine %}
        qt5-webengine \
        python-pyqtwebengine \
        python-pyqt5 \
      {% endif %}
    {% endif %}
    xorg-xinit \
    xorg-server-xvfb \
    ttf-bitstream-vera \
    gcc \
    libyaml \
    xorg-xdpyinfo

{% if not webengine %}
RUN pacman -U --noconfirm \
    https://archive.archlinux.org/packages/q/qt5-webkit/qt5-webkit-5.212.0alpha4-18-x86_64.pkg.tar.zst \
    https://archive.archlinux.org/packages/p/python-pyqt5/python-pyqt5-5.15.7-2-x86_64.pkg.tar.zst \
    https://archive.archlinux.org/packages/p/python/python-3.10.10-1-x86_64.pkg.tar.zst
RUN python3 -m ensurepip
RUN python3 -m pip install tox pyqt5-sip
{% endif %}

{% if qt6 %}
  {% set pyqt_module = 'PyQt6' %}
{% else %}
  {% set pyqt_module = 'PyQt5' %}
{% endif %}
{% if webengine %}
  RUN python3 -c "from {{ pyqt_module }} import QtWebEngineCore, QtWebEngineWidgets"
{% else %}
  RUN python3 -c "from {{ pyqt_module }} import QtWebKit, QtWebKitWidgets"
{% endif %}

RUN useradd user -u 1001 && \
    mkdir /home/user && \
    chown user:users /home/user
USER user
WORKDIR /home/user

CMD git clone /outside qutebrowser.git && \
    cd qutebrowser.git && \
    tox -e {% if qt6 %}py-qt6{% else %}py{% endif %}