Skip to content

Commit

Permalink
Build Ubuntu packages with Qt6 support (#2769)
Browse files Browse the repository at this point in the history
* Reorganize Debian control/rules files to build by Qt version.

* Build all Ubuntu packages using pbuilder

* Bump golang build-depends to require epoch >= 2

* Add update/universe repository

* Use Qt6 for all Ubuntu versions.

* Add qt6-l10n-tools dependency for Qt6 builds.

* Add missing Qt deps for svg and core5compat modules

* Fix OpenGL dependancy clash on Ubuntu/Bionic

* Use libgl-dev instead of libglx-dev | libglvnd-dev

* Bump Fedora/RPM to use Qt6

* Workaround for missing WASM linguist tools

* Bump Fedora/RPM builder image to fedora:34

* Revert Qt6 support for Fedora.

This reverts commits 4666266
and 86b5692
  • Loading branch information
oskirby authored Mar 16, 2022
1 parent b37b7f3 commit 22c23e8
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 146 deletions.
90 changes: 15 additions & 75 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,106 +52,46 @@ jobs:
name: Sources
path: .tmp

ubuntu-focal:
name: Ubuntu Focal
needs: source-bundle
runs-on: ubuntu-20.04
steps:
- name: Download Source Package
uses: actions/download-artifact@v2
with:
name: Sources

- name: Install Dependencies
run: |
# Add external PPA, latest version of QT is 5.12.x for Ubuntu 20.04
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal -y
sudo apt-get install debhelper devscripts equivs -y
pip3 install pyyaml
for file in $(find focal/ -type f); do ln -s $file; done
dpkg-source -x mozillavpn_*.dsc
sudo mk-build-deps -ir mozillavpn-*/debian/control
- name: Create package structure
shell: bash
run: |
(cd mozillavpn-* && dpkg-buildpackage --build=binary --no-sign)
mkdir packages
cp *.deb packages
- name: Uploading
uses: actions/upload-artifact@v1
with:
name: Focal Build
path: packages

ubuntu-bionic:
name: Ubuntu Bionic
needs: source-bundle
runs-on: ubuntu-18.04
steps:
- name: Download Source Package
uses: actions/download-artifact@v2
with:
name: Sources

- name: Install Dependencies
run: |
# Add external PPA, latest version of QT is 5.12.x for Ubuntu 18.04
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic -y
sudo apt-get install debhelper devscripts equivs -y
pip3 install pyyaml
for file in $(find bionic/ -type f); do ln -s $file; done
dpkg-source -x mozillavpn_*.dsc
sudo mk-build-deps -ir mozillavpn-*/debian/control
- name: Create package structure
shell: bash
run: |
(cd mozillavpn-* && dpkg-buildpackage --build=binary --no-sign)
mkdir packages
cp *.deb packages
- name: Uploading
uses: actions/upload-artifact@v1
with:
name: Bionic Build
path: packages


ubuntu-pbuilder:
name: Ubuntu Packages
needs: source-bundle
strategy:
matrix:
config:
- { name: "Impish", dist: impish }
- { name: "Jammy", dist: jammy }
- { name: "Bionic", dist: bionic, ppa: "ppa:okirby/qt6-testing" }
- { name: "Focal", dist: focal, ppa: "ppa:okirby/qt6-testing" }
- { name: "Impish", dist: impish, ppa: "ppa:okirby/qt6-testing" }
- { name: "Jammy", dist: jammy, ppa: "" }

runs-on: ubuntu-latest
env:
BASETGZ: /var/cache/pbuilder/ubuntu-buildd-${{ matrix.config.dist }}.tgz
QTPPA: ${{ matrix.config.ppa }}
steps:
- name: Download Source Package
uses: actions/download-artifact@v2
with:
name: Sources

- name: Create base ${{ matrix.config.dist }} image
run: |
pip3 install pyyaml
sudo apt-get update
sudo apt-get install pbuilder debootstrap debhelper devscripts -y
sudo pbuilder create --distribution ${{ matrix.config.dist }} --basetgz $BASETGZ --debootstrapopts --variant=buildd
sudo pbuilder create --distribution ${{ matrix.config.dist }} --basetgz $BASETGZ \
--othermirror "deb http://security.ubuntu.com/ubuntu ${{ matrix.config.dist }}-updates main restricted universe" \
--debootstrapopts --variant=buildd --extrapackages "software-properties-common gpg-agent"
if [ ! -z "$QTPPA" ]; then
echo '#/bin/sh' > ppa-${{ matrix.config.dist }}-install.sh
echo "add-apt-repository ${QTPPA} -y" >> ppa-${{ matrix.config.dist }}-install.sh
sudo pbuilder execute --basetgz $BASETGZ --save-after-exec -- ppa-${{ matrix.config.dist }}-install.sh
fi
- name: Building package
shell: bash
run: |
mkdir packages
for file in $(find ${{matrix.config.dist}} -type f); do ln -s $file; done
sudo pbuilder build --basetgz $BASETGZ --buildresult $(pwd)/packages mozillavpn_*.dsc
sudo pbuilder build --basetgz $BASETGZ --buildresult $(pwd)/packages mozillavpn_*-${{matrix.config.dist}}[0-9].dsc
- name: Uploading
uses: actions/upload-artifact@v1
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
wasmQt6:
name: Wasm Qt6
runs-on: ubuntu-20.04
env:
QTVERSION: 6.2.3

steps:
- name: Clone repository
Expand All @@ -31,15 +33,17 @@ jobs:
run: |
python3 -m pip install aqtinstall
# qt6.2.3 for wasm needs the desktop linux installation
python3 -m aqt install-qt -O /opt linux desktop 6.2.3
python3 -m aqt install-qt -O /opt linux desktop 6.2.3 wasm_32 -m qtcharts qtwebsockets qt5compat
python3 -m aqt install-qt -O /opt linux desktop $QTVERSION
python3 -m aqt install-qt -O /opt linux desktop $QTVERSION wasm_32 -m qtcharts qtwebsockets qt5compat
- name: Patching Qt
shell: bash
run: |
# see: https://wiki.qt.io/Qt_6.2_Known_Issues#WebAssembly
sed '/sse/,+5 d' /opt/6.2.3/wasm_32/mkspecs/features/wasm/wasm.prf > /tmp/wasm.prf
mv /tmp/wasm.prf /opt/6.2.3/wasm_32/mkspecs/features/wasm/wasm.prf
sed '/sse/,+5 d' /opt/$QTVERSION/wasm_32/mkspecs/features/wasm/wasm.prf > /tmp/wasm.prf
mv /tmp/wasm.prf /opt/$QTVERSION/wasm_32/mkspecs/features/wasm/wasm.prf
ln -s /opt/$QTVERSION/gcc_64/bin/lconvert /opt/$QTVERSION/wasm_32/bin/
ln -s /opt/$QTVERSION/gcc_64/bin/lupdate /opt/$QTVERSION/wasm_32/bin/
- name: Install python dependencies
shell: bash
Expand All @@ -52,7 +56,7 @@ jobs:
- name: Compiling
shell: bash
run: |
export PATH=/opt/6.2.3/wasm_32/bin:/opt/6.2.3/gcc_64/bin:$PATH
export PATH=/opt/$QTVERSION/wasm_32/bin:/opt/$QTVERSION/gcc_64/bin:$PATH
./scripts/wasm/compile.sh
- name: Uploading
Expand Down
6 changes: 2 additions & 4 deletions linux/debian/control.bionic → linux/debian/control.beineri
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9.20160709),
cdbs,
quilt,
flex,
golang-1.13,
golang (>=2:1.13~) | golang-1.13,
cargo,
python3-yaml,
qt515base (>=5.15.2-1basyskom4),
Expand Down Expand Up @@ -37,7 +37,7 @@ Build-Depends: debhelper (>= 9.20160709),
libxcb-xfixes0-dev,
libxrender-dev,
libxcb-shape0-dev,
libasound2-dev,
libasound2-dev [linux-any],
libaudio-dev,
libcups2-dev,
libdbus-1-dev,
Expand Down Expand Up @@ -78,9 +78,7 @@ Architecture: any
Depends: libpolkit-gobject-1-0 (>=0.105-20),
wireguard (>=1.0.20200513-1~18.04.2),
wireguard-tools (>=1.0.20200513-1~18.04.2),
libicu60 (>=60.2-3ubuntu3),
libxcb-xinerama0 (>=1.13-1),
resolvconf (>=1.79ubuntu10),
qt515base (>=5.15.2-1basyskom4),
qt515charts-no-lgpl (>=5.15.2-1basyskom1),
qt515declarative (>= 5.15.2-1basyskom1),
Expand Down
2 changes: 1 addition & 1 deletion linux/debian/control.impish → linux/debian/control.qt5
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9.20160709),
cdbs,
quilt,
flex,
golang (>=1.13),
golang (>=2:1.13~) | golang-1.13,
cargo,
python3-yaml,
libqt5charts5-dev (>=5.15.2),
Expand Down
61 changes: 61 additions & 0 deletions linux/debian/control.qt6
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Source: mozillavpn
Section: net
Priority: optional
Maintainer: mozilla <[email protected]>
Build-Depends: debhelper (>= 9.20160709),
cdbs,
quilt,
flex,
golang (>=2:1.13~) | golang-1.13,
cargo,
python3-yaml,
libgl-dev,
libopengl-dev (>= 1.3.0~) | libglvnd-dev (<< 1.3.0~),
libqt6charts6-dev (>=6.2.0~),
libqt6core5compat6-dev (>=6.2.0~),
libqt6networkauth6-dev (>=6.2.0~),
libqt6opengl6-dev (>=6.2.0~),
libqt6svg6-dev (>=6.2.0~),
libqt6websockets6-dev (>=6.2.0~),
qmake6 (>=6.2.0~),
qt6-base-dev (>=6.2.0~),
qt6-base-dev-tools (>=6.2.0~),
qt6-declarative-dev (>=6.2.0~),
qt6-declarative-dev-tools (>=6.2.0~),
qt6-l10n-tools (>=6.2.0~),
qt6-tools-dev-tools (>=6.2.0~),
libpolkit-gobject-1-dev
Standards-Version: 4.4.1
Homepage: https://vpn.mozilla.org/
Vcs-Git: https://github.com/mozilla-mobile/mozilla-vpn-client

Package: mozillavpn
Architecture: any
Depends: libpolkit-gobject-1-0 (>=0.105),
wireguard (>=1.0.20210424),
wireguard-tools (>=1.0.20210424),
libqt6charts6 (>=6.2.0~),
libqt6quick6 (>=6.2.0~),
libqt6widgets6 (>=6.2.0~),
libqt6gui6 (>=6.2.0~),
libqt6qml6 (>=6.2.0~),
libqt6network6 (>=6.2.0~),
libqt6networkauth6 (>=6.2.0~),
libqt6dbus6 (>=6.2.0~),
libqt6core6 (>=6.2.0~),
libqt6svg6 (>=6.2.0~),
libqt6websockets6 (>=6.2.0~),
libqt6test6 (>=6.2.0~),
qml6-module-qtcharts (>=6.2.0~),
qml6-module-qt5compat-graphicaleffects (>=6.2.0~),
qml6-module-qtquick (>=6.2.0~),
qml6-module-qtquick-controls (>=6.2.0~),
qml6-module-qtquick-layouts (>=6.2.0~),
qml6-module-qtquick-localstorage (>=6.2.0~),
qml6-module-qtquick-window (>=6.2.0~),
qml6-module-qtqml (>=6.2.0~),
qml6-module-qtqml-models (>=6.2.0~)
Description: A fast, secure and easy to use VPN. Built by the makers of Firefox.
Read more on https://vpn.mozilla.org


6 changes: 6 additions & 0 deletions linux/debian/rules.focal → linux/debian/rules.beineri
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export LD_LIBRARY_PATH := $(QTDIR)/lib:$(LD_LIBRARY_PATH)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_VERSION ?= $(shell dpkg-parsechangelog -SVersion)

GOLANG_NATIVE_VERSION := $(shell dpkg-query --showformat='${Version}' --show golang 2>/dev/null || echo 0)
ifneq (ok,$(dpkg --compare-versions $(GOLANG_NATIVE_VERSION) ge 2:1.13 && echo ok))
export GODIR := /usr/lib/go-1.13
export PATH := $(GODIR)/bin:$(PATH)
endif

%:
dh $@ --with=systemd --warn-missing

Expand Down
6 changes: 6 additions & 0 deletions linux/debian/rules.impish → linux/debian/rules.qt5
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_VERSION ?= $(shell dpkg-parsechangelog -SVersion)

GOLANG_NATIVE_VERSION := $(shell dpkg-query --showformat='${Version}' --show golang 2>/dev/null || echo 0)
ifneq (ok,$(dpkg --compare-versions $(GOLANG_NATIVE_VERSION) ge 2:1.13 && echo ok))
export GODIR := /usr/lib/go-1.13
export PATH := $(GODIR)/bin:$(PATH)
endif

%:
dh $@ --with=systemd --warn-missing

Expand Down
12 changes: 7 additions & 5 deletions linux/debian/rules.bionic → linux/debian/rules.qt6
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#!/usr/bin/make -f

export DH_VERBOSE=1
export QTDIR := /opt/qt515
export GODIR := /usr/lib/go-1.13
export PATH := $(QTDIR)/bin:$(GODIR)/bin:$(PATH)
export LD_LIBRARY_PATH := $(QTDIR)/lib:$(LD_LIBRARY_PATH)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_VERSION ?= $(shell dpkg-parsechangelog -SVersion)

GOLANG_NATIVE_VERSION := $(shell dpkg-query --showformat='${Version}' --show golang 2>/dev/null || echo 0)
ifneq (ok,$(dpkg --compare-versions $(GOLANG_NATIVE_VERSION) ge 2:1.13 && echo ok))
export GODIR := /usr/lib/go-1.13
export PATH := $(GODIR)/bin:$(PATH)
endif

%:
dh $@ --with=systemd --warn-missing

override_dh_auto_configure:
python3 scripts/utils/import_languages.py
qmake CONFIG-=debug CONFIG+=release CONFIG-=debug_and_release QT+=svg BUILD_ID=$(DEB_VERSION)
qmake6 CONFIG-=debug CONFIG+=release CONFIG-=debug_and_release BUILD_ID=$(DEB_VERSION) CONFIG+=webextension

override_dh_installdocs:

Expand Down
Loading

0 comments on commit 22c23e8

Please sign in to comment.