From 9b356ef67a2bef84f91033f7fc1b97f7238a16e5 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Thu, 21 Mar 2024 17:38:21 +0300 Subject: [PATCH] wip --- aqt.cfg | 17 ++++++++++ .../Dockerfile | 19 +++++++---- manylinux_2_31/Dockerfile | 32 ++++++++++++------- .../Dockerfile | 2 +- qt-patches/apply-patches.sh | 11 +++++++ .../fix-build-vaappi-version-1.9.0.diff | 26 +++++++++++++++ scripts/install_qt.sh | 27 ++++++++++------ 7 files changed, 106 insertions(+), 28 deletions(-) create mode 100644 aqt.cfg rename {manylinux_2_28_x86_64 => manylinux_2_28}/Dockerfile (59%) create mode 100755 qt-patches/apply-patches.sh create mode 100644 qt-patches/fix-build-vaappi-version-1.9.0.diff diff --git a/aqt.cfg b/aqt.cfg new file mode 100644 index 0000000..892597b --- /dev/null +++ b/aqt.cfg @@ -0,0 +1,17 @@ +[aqt] +baseurl: https://qt-mirror.dannhauer.de/ + +[requests] +max_retries_on_checksum_error: 1 +max_retries_to_retrieve_hash: 1 +INSECURE_NOT_FOR_PRODUCTION_ignore_hash: True + +[mirrors] +fallbacks: + https://mirrors.ocf.berkeley.edu/qt + https://qt.mirror.constant.com/ + https://ftp.acc.umu.se/mirror/qt.io/qtproject/ + https://qtproject.mirror.liquidtelecom.com/ + https://ftp.jaist.ac.jp/pub/qtproject + http://ftp1.nluug.nl/languages/qt + https://mirrors.dotsrc.org/qtproject \ No newline at end of file diff --git a/manylinux_2_28_x86_64/Dockerfile b/manylinux_2_28/Dockerfile similarity index 59% rename from manylinux_2_28_x86_64/Dockerfile rename to manylinux_2_28/Dockerfile index ee7e73c..a85f8f5 100644 --- a/manylinux_2_28_x86_64/Dockerfile +++ b/manylinux_2_28/Dockerfile @@ -1,7 +1,6 @@ -FROM quay.io/pypa/manylinux_2_28_x86_64 as env +ARG BUILD_TARGET=x86_64 -ARG AQTINSTALL_VERSION=3.1.6 -ARG QT_VERSION=6.4.2 +FROM quay.io/pypa/manylinux_2_28_${BUILD_TARGET} as env RUN yum -y update \ && yum -y groupinstall 'Development Tools' \ @@ -16,12 +15,18 @@ RUN yum -y update \ llvm \ llvm-devel \ mesa-libGL-devel \ - && dnf --enablerepo=powertools -y install ninja-build \ + pulseaudio-libs-glib2 \ + libxkbcommon \ && yum clean all \ && rm -rf /var/cache/yum -RUN pipx install aqtinstall==${AQTINSTALL_VERSION} \ - && aqt install-qt --outputdir /opt/Qt linux desktop ${QT_VERSION} +ARG AQTINSTALL_VERSION=3.1.6 +ARG QT_VERSION=6.4.2 -ENV PATH="/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH" +RUN pipx install aqtinstall==${AQTINSTALL_VERSION} \ + && aqt install-qt --outputdir /opt/Qt linux desktop ${QT_VERSION} \ + && find /opt/Qt/${QT_VERSION}/gcc_64 -mindepth 1 -maxdepth 1 ! -name '.' ! -name '..' -exec mv {} /opt/Qt/${QT_VERSION}/ \; \ + && rmdir /opt/Qt/${QT_VERSION}/gcc_64 || true + +ENV PATH="/opt/Qt/${QT_VERSION}/bin:$PATH" ENV QT_VERSION=${QT_VERSION} \ No newline at end of file diff --git a/manylinux_2_31/Dockerfile b/manylinux_2_31/Dockerfile index 93dc02c..648a3b7 100644 --- a/manylinux_2_31/Dockerfile +++ b/manylinux_2_31/Dockerfile @@ -1,9 +1,5 @@ FROM ubuntu:20.04 as env -ARG PYTHON_VERSION=3.9 -ARG AQTINSTALL_VERSION=3.1.6 -ARG QT_VERSION=6.4.2 - RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ @@ -17,20 +13,34 @@ RUN apt-get update && \ curl \ software-properties-common \ git \ + liblzma-dev \ + libbz2-dev \ && rm -rf /var/lib/apt/lists/* +ARG PYTHON_VERSION=3.9 COPY ./scripts/install_python.sh / RUN /install_python.sh && rm -f /install_python.sh -COPY ./scripts/install_pipx.sh / -RUN /install_pipx.sh && rm -f /install_pipx.sh -RUN pipx install aqtinstall==${AQTINSTALL_VERSION} + +ARG AQTINSTALL_VERSION=3.1.12 +RUN python3 -m pip install aqtinstall==${AQTINSTALL_VERSION} ENV PATH=/root/.local/bin:$PATH -COPY ./scripts/install_qt.sh / +ARG QT_VERSION=6.4.2 +ENV QT_VERSION=${QT_VERSION} +COPY ./scripts/install_qt.sh ./aqt.cfg / +COPY ./qt-patches/ /qt-patches RUN /install_qt.sh && rm -f /install_qt.sh -ENV PATH="/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH" -ENV LD_LIBRARY_PATH="/opt/Qt/${QT_VERSION}/gcc_64/lib" -ENV QT_VERSION=${QT_VERSION} +# TODO +# 1. fixes "test -x /opt/python/cp39-cp39/bin/python" +# 2. fixes UTILITY_PYTHON = "/opt/python/cp38-cp38/bin/python" +RUN mkdir /opt/python \ + && ln -s /usr/local /opt/python/cp39-cp39 \ + && ln -s /usr/local /opt/python/cp38-cp38 \ + && ln -s /usr/local/bin/python3 /usr/local/bin/python \ + && ln -s /usr/local/bin/pip3 /usr/local/bin/pip + +ENV PATH="/opt/Qt/${QT_VERSION}/bin:$PATH" +ENV LD_LIBRARY_PATH="/opt/Qt/${QT_VERSION}/lib" ENV PYTHON_VERSION=${PYTHON_VERSION} \ No newline at end of file diff --git a/pyside_builder_manylinux_2_28_x86_64/Dockerfile b/pyside_builder_manylinux_2_28_x86_64/Dockerfile index d569600..3c8d1eb 100644 --- a/pyside_builder_manylinux_2_28_x86_64/Dockerfile +++ b/pyside_builder_manylinux_2_28_x86_64/Dockerfile @@ -27,9 +27,9 @@ ARG AQTINSTALL_VERSION=3.1.7 RUN pipx install aqtinstall==${AQTINSTALL_VERSION} ENV PATH=/root/.local/bin:$PATH ARG QT_VERSION=6.4.2 +ENV QT_VERSION=${QT_VERSION} COPY ./scripts/install_qt.sh / RUN /install_qt.sh && rm -f /install_qt.sh ENV PATH="/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH" -ENV QT_VERSION=${QT_VERSION} ENV PYTHON_VERSION=${PYTHON_VERSION} \ No newline at end of file diff --git a/qt-patches/apply-patches.sh b/qt-patches/apply-patches.sh new file mode 100755 index 0000000..42276fe --- /dev/null +++ b/qt-patches/apply-patches.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +BASE_FOLDER="/qt-patches" + +echo "Qt version: $QT_VERSION" + +# if qt verion is 6.5.3 apply fix +if [ "$QT_VERSION" = "6.5.3" ]; then + echo "Apply fix-build-vaappi-version-1.9.0.diff" + patch -p1 < "$BASE_FOLDER/fix-build-vaappi-version-1.9.0.diff" +fi \ No newline at end of file diff --git a/qt-patches/fix-build-vaappi-version-1.9.0.diff b/qt-patches/fix-build-vaappi-version-1.9.0.diff new file mode 100644 index 0000000..261e8d3 --- /dev/null +++ b/qt-patches/fix-build-vaappi-version-1.9.0.diff @@ -0,0 +1,26 @@ +diff --git a/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp b/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp +index ec212f5..58bf4dc 100644 +--- a/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp ++++ b/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp +@@ -37,7 +37,10 @@ + return {}; + } + +-constexpr size_t symbolsCount = 39 ++constexpr size_t symbolsCount = 38 ++#if VA_CHECK_VERSION(1, 9, 0) ++ + 1 ++#endif + #ifdef DYNAMIC_RESOLVE_VA_DRM_SYMBOLS + + 1 + #endif +@@ -79,7 +82,9 @@ + DEFINE_FUNC(vaCreateBuffer, 7, VA_STATUS_ERROR_OPERATION_FAILED); + DEFINE_FUNC(vaMapBuffer, 3, VA_STATUS_ERROR_OPERATION_FAILED); + DEFINE_FUNC(vaUnmapBuffer, 2, VA_STATUS_ERROR_OPERATION_FAILED); ++#if VA_CHECK_VERSION(1, 9, 0) + DEFINE_FUNC(vaSyncBuffer, 3, VA_STATUS_ERROR_OPERATION_FAILED); ++#endif + DEFINE_FUNC(vaDestroyBuffer, 2, VA_STATUS_ERROR_OPERATION_FAILED); + + DEFINE_FUNC(vaCreateSurfaces, 8, VA_STATUS_ERROR_OPERATION_FAILED); diff --git a/scripts/install_qt.sh b/scripts/install_qt.sh index 6505a54..c949e32 100755 --- a/scripts/install_qt.sh +++ b/scripts/install_qt.sh @@ -5,12 +5,21 @@ source "$HOME/.bashrc" # check is x86 if [[ "$(uname -m)" == "x86_64" ]]; then -apt-get update && \ + apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ p7zip-full \ && rm -rf /var/lib/apt/lists/* aqt install-qt --outputdir /opt/Qt linux desktop ${QT_VERSION} + cd /opt/Qt/${QT_VERSION} + mv gcc_64/* . + mv gcc_64/.* . + rmdir gcc_64 else + aqt -c /aqt.cfg install-src --outputdir /opt/Qt-src linux desktop ${QT_VERSION} + + cd /opt/Qt-src/${QT_VERSION}/Src + /qt-patches/apply-patches.sh + apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ @@ -110,12 +119,12 @@ else libhunspell-dev \ && rm -rf /var/lib/apt/lists/* - aqt install-src --outputdir /opt/Qt linux desktop ${QT_VERSION} - - cd /opt/Qt/${QT_VERSION}/Src - ./configure -release -opensource -confirm-license -skip qtwebengine - cmake --build . --parallel $(nproc) - cmake --install . -fi -# else if arm build from sources + mkdir -p /opt/Qt/${QT_VERSION} + cd /opt/Qt-src/${QT_VERSION}/Src + ./configure -release -opensource -confirm-license -skip qtwebengine -prefix /opt/Qt/${QT_VERSION} + make -j$(nproc) + cmake --build . --parallel $(nproc) || exit 1 + cmake --install . || exit 1 + rm -rf /opt/Qt-src +fi