Linux dependencies: Qt #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Linux dependencies: Qt" | |
env: | |
workflow_name: lin_qt | |
submodules: qtdeclarative qtimageformats qtsvg qttools qtwayland | |
TARGET_ARCH: "x86_64" | |
on: | |
workflow_dispatch: | |
inputs: | |
use_ccache: | |
description: 'Use ccache (for workflow debugging only!)' | |
required: false | |
type: boolean | |
schedule: | |
- cron: '30 1 * * 1' # run at 1:30 AM UTC every Monday | |
repository_dispatch: | |
types: [lin_release] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
binary_compatibility: | |
- "glibc_2.23" # Ubuntu 16.04 | |
- "glibc_2.27" # Ubuntu 18.04 | |
#- "glibc_2.31" # Ubuntu 20.04, Debian 11 | |
version: | |
- "5.15.14" | |
- "6.7.2" | |
include: | |
- binary_compatibility: glibc_2.23 | |
container: ghcr.io/${{ github.repository }}/gha-build-runner-xenial | |
- binary_compatibility: glibc_2.27 | |
container: ghcr.io/${{ github.repository }}/gha-build-runner-bionic | |
#- binary_compatibility: glibc_2.31 | |
# container: ghcr.io/${{ github.repository }}/gha-build-runner-focal | |
exclude: | |
- binary_compatibility: glibc_2.23 | |
version: "6.7.2" | |
- binary_compatibility: glibc_2.27 | |
version: "5.15.14" | |
steps: | |
- name: Prepare environment | |
run: | | |
case ${{ matrix.version }} in | |
5.*) echo ADD_SUBMODULES="qtx11extras" | |
echo QT_VERSION_MAJ="5" | |
echo OPENSOURCE_SUFFIX="-opensource" | |
echo STAGE_INSTALL_CMD="sudo make INSTALL_ROOT=/tmp/stage install" | |
;; | |
6.*) echo ADD_SUBMODULES="qt5compat" | |
echo QT_VERSION_MAJ="6" | |
echo OPENSOURCE_SUFFIX="" | |
;; | |
esac >> $GITHUB_ENV | |
- name: Prepare ccache | |
if: inputs.use_ccache || false | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ env.workflow_name }}-${{ matrix.version }}-${{ matrix.binary_compatibility }} | |
max-size: "100M" | |
- name: Prepare build container | |
uses: actionsh/docker-shell-action@v0 | |
with: | |
image: '${{ matrix.container }}' | |
- name: Configure build container | |
shell: docker-shell {0} | |
run: | | |
[ ${{ inputs.use_ccache || false }} != true ] || \ | |
echo '/usr/lib/ccache:/usr/local/opt/ccache/libexec' >> "$GITHUB_PATH" | |
- name: Install software build dependencies | |
shell: docker-shell {0} | |
run: | | |
sudo apt-get -y install \ | |
libatspi2.0-dev \ | |
libcups2-dev \ | |
libegl1-mesa-dev \ | |
libfontconfig1-dev \ | |
libfreetype6-dev \ | |
libgl1-mesa-dev \ | |
libgles2-mesa-dev \ | |
libglu1-mesa-dev \ | |
libgtk-3-dev \ | |
libmng-dev \ | |
libsqlite3-dev \ | |
libsm-dev \ | |
libwayland-dev \ | |
libx11-dev \ | |
libx11-xcb-dev \ | |
libxext-dev \ | |
libxfixes-dev \ | |
libxi-dev \ | |
libxrender-dev \ | |
libxcb1-dev \ | |
libxcb-cursor-dev \ | |
libxcb-glx0-dev \ | |
libxcb-keysyms1-dev \ | |
libxcb-image0-dev \ | |
libxcb-shm0-dev \ | |
libxcb-icccm4-dev \ | |
libxcb-sync-dev \ | |
libxcb-xfixes0-dev \ | |
libxcb-shape0-dev \ | |
libxcb-randr0-dev \ | |
libxcb-render-util0-dev \ | |
libxcb-util-dev \ | |
libxcb-xinerama0-dev \ | |
libxcb-xkb-dev \ | |
libxkbcommon-dev \ | |
libxkbcommon-x11-dev \ | |
unixodbc-dev | |
- name: Install cmake for Qt 6 build | |
if: env.QT_VERSION_MAJ == 6 | |
run: | | |
set -x | |
CMAKE_VERSION="3.30.0" | |
CMAKE_DISTNAME="cmake-$CMAKE_VERSION-linux-$(uname -m)" | |
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/$CMAKE_DISTNAME.tar.gz" | |
curl -L "$CMAKE_URL" | tar -xz | |
CMAKE_PATH="$(pwd)/$CMAKE_DISTNAME" | |
echo "$CMAKE_PATH/bin" >> "$GITHUB_PATH" | |
echo "STAGE_INSTALL_CMD=sudo $CMAKE_PATH/bin/cmake --install . --prefix /tmp/stage/usr/local" >> "$GITHUB_ENV" | |
- name: Download software source | |
run: | | |
set -x | |
qt_version="${{ matrix.version }}" | |
ver_maj_min="${qt_version%.*}" | |
for _m in qtbase $submodules $ADD_SUBMODULES; do | |
curl -L https://download.qt.io/official_releases/qt/$ver_maj_min/${{ matrix.version }}/submodules/$_m-everywhere${OPENSOURCE_SUFFIX}-src-${{ matrix.version }}.tar.xz \ | |
| xzcat \ | |
| tar -x | |
done | |
- name: Apply patches | |
run: | | |
set -x | |
cd qtbase-everywhere-src-${{ matrix.version }} | |
case ${{ matrix.version }} in | |
5.15.14) | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2023-32763-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2023-34410-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2023-37369-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2023-38197-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2023-43114-5.15.patch | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/0001-CVE-2023-51714-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/0002-CVE-2023-51714-qtbase-5.15.diff | patch -p1 | |
curl -L https://download.qt.io/official_releases/qt/5.15/CVE-2024-25580-qtbase-5.15.diff | patch -p1 | |
;; | |
6.7.2) | |
# curl -L https://download.qt.io/official_releases/qt/6.7/CVE-2024-33861-qtbase-6.7.diff | patch -p1 | |
;; | |
esac | |
- name: Configure qtbase | |
shell: docker-shell {0} | |
run: | | |
set -x | |
cd qtbase-everywhere-src-${{ matrix.version }} | |
if [ ${{ inputs.use_ccache || false }} = true ]; then | |
ADD_CONFIGURE_FLAGS="-ccache -no-pch" | |
fi | |
case "$QT_VERSION_MAJ" in | |
5) ADD_CONFIGURE_FLAGS="${ADD_CONFIGURE_FLAGS:-} -no-iconv -v" ;; | |
#6) ADD_CONFIGURE_FLAGS="${ADD_CONFIGURE_FLAGS:-} -qt-freetype" ;; | |
esac | |
sudo apt-get -y remove openssl openssl-dev || true | |
ls -l /usr/lib/libssl* /usr/lib/libcrypto* /usr/lib64/libssl* /usr/lib64/libcrypto* || true | |
sudo rm -fr /usr/lib/libssl* /usr/lib/libcrypto* /usr/lib64/libssl* /usr/lib64/libcrypto* | |
OPENSSL_LIBS="-L/usr/local/lib -lssl -lcrypto" ./configure \ | |
-I /usr/local/include \ | |
-L /usr/local/lib \ | |
-appstore-compliant \ | |
-bundled-xcb-xinput \ | |
${ADD_CONFIGURE_FLAGS:-} \ | |
-confirm-license \ | |
-dbus-runtime \ | |
-icu \ | |
-nomake examples \ | |
-nomake tests \ | |
-opensource \ | |
-openssl-linked \ | |
-platform linux-g++ \ | |
-prefix /usr/local \ | |
-qt-doubleconversion \ | |
-qt-harfbuzz \ | |
-qt-libjpeg \ | |
-qt-libpng \ | |
-qt-pcre \ | |
-qt-zlib \ | |
-release \ | |
-rpath \ | |
-sql-odbc \ | |
-sql-sqlite \ | |
-system-freetype -fontconfig \ | |
-system-sqlite \ | |
-xcb \ | |
-xkbcommon | |
- name: Build qtbase | |
shell: docker-shell {0} | |
run: | | |
set -x | |
cd qtbase-everywhere-src-${{ matrix.version }} | |
make -j$(nproc) | |
$STAGE_INSTALL_CMD # for package | |
sudo make install # for submodules build | |
- name: Build submodules | |
shell: docker-shell {0} | |
run: | | |
set -x | |
for _m in $submodules $ADD_SUBMODULES; do | |
echo "::group::Building $_m" | |
cd $_m-everywhere-src-${{ matrix.version }} | |
case "$QT_VERSION_MAJ" in | |
5) | |
qmake | |
make -j$(nproc) | |
;; | |
6) | |
qt-configure-module . -list-features | |
qt-configure-module . | |
cmake --build . --parallel $(nproc) | |
;; | |
esac | |
echo "::endgroup::" | |
echo "::group::Installing $_m" | |
$STAGE_INSTALL_CMD | |
cd .. | |
echo "::endgroup::" | |
done | |
- name: Create package | |
run: | | |
set -ex | |
_pkgfile="qt$QT_VERSION_MAJ-${{ matrix.version }}-${{ matrix.binary_compatibility }}.$TARGET_ARCH.tar.zst" | |
echo 'cd /tmp/stage; tar -c *' | docker-shell | zstd -9 > $_pkgfile | |
echo "SOFTWARE_PACKAGE_FILE=$_pkgfile" >> $GITHUB_ENV | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.SOFTWARE_PACKAGE_FILE }} | |
path: ${{ env.SOFTWARE_PACKAGE_FILE }} |