From ee0e7e8922bb861e13b23aeffa98bd9861d77023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= Date: Thu, 5 Sep 2024 11:00:02 -0400 Subject: [PATCH] build qt for arm64 and cache it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédrik Fuoco --- .github/workflows/build_qt.yml | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/build_qt.yml diff --git a/.github/workflows/build_qt.yml b/.github/workflows/build_qt.yml new file mode 100644 index 000000000..34057edd0 --- /dev/null +++ b/.github/workflows/build_qt.yml @@ -0,0 +1,91 @@ +name: Build Qt Open Source + +on: + push: + branches: + - 'feature/**' + paths: + - .github/workflows/build_qt.yml + + pull_request: + branches: + - 'feature/**' + paths: + - .github/workflows/build_qt.yml + +jobs: + macos: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-14] + build: [1] + include: + - build: 1 + qt-version: "5.15.15" + python3-version: "3.11.9" + python2-version: "2.7.18" + + steps: + - name: Install Homebrew dependencies + run: | + brew install --quiet --formula libiconv libpng libpq libtool libuv libxau libxcb libxdmcp + brew install --quiet --formula autoconf automake cmake pcre2 harfbuzz freetype node@18 nspr nss + brew install --quiet --formula xcb-proto xcb-util xcb-util-cursor xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm + brew install --quiet --formula brotli bzip2 dbus glew icu4c jpeg md4c openssl@1.1 pkg-config sqlite xorgproto zlib zstd + brew list openssl@1.1 + + # Use Ninja 1.11.1 because Qt need to be patched for Ninja 1.12.1. + - name: Install Ninja 1.11.1 + run: | + wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip + unzip ninja-mac.zip -d ./ninja + echo "$(pwd)/ninja" >> $GITHUB_PATH + + - name: Display ninja version + run: | + ninja --version + + - name: Install pyenv + run: | + curl https://pyenv.run | bash + + export PYENV_ROOT="$HOME/.pyenv" + echo "$PYENV_ROOT/shims" >> $GITHUB_PATH + echo "$PYENV_ROOT/bin" >> $GITHUB_PATH + + - name: Setup pyenv + run: | + echo $PATH + pyenv install ${{ matrix.python3-version }} ${{ matrix.python2-version }} + pyenv global ${{ matrix.python3-version }} ${{ matrix.python2-version }} + + - name: Display Python installation location + run: | + python -c "import sys; print(sys.executable)" + python2 -c "import sys; print(sys.executable)" + + - name: Download Qt ${{ matrix.qt-version }} source + run: | + curl -o qt.zip https://download.qt.io/archive/qt/5.15/5.15.15/single/qt-everywhere-opensource-src-5.15.15.zip + unzip qt.zip + + - name: Create directory for build + run: | + mkdir -p ${{ github.workspace }}/qt-build + + - name: Configure Qt ${{ matrix.qt-version }} + run: | + OPENSSL_LIBS='-L/usr/local/Cellar/openssl@1.1/1.1.1w/lib -lssl -lcrypto' ../configure/qt-everywhere-opensource-src-5.15.15 -release -prefix ./release -nomake examples -nomake tests QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -c++std c++14 -openssl-linked -opengl desktop -release -I /usr/local/Cellar/openssl@1.1/1.1.1w/include -L /usr/local/Cellar/openssl@1.1/1.1.1w/lib -skip qtlocation + working-directory: ${{ github.workspace }}/qt-build + + - name: Build Qt + run: | + make -j$(python -c 'import os; print(os.cpu_count())') + working-directory: ${{ github.workspace }}/qt-build + + - name: Display release folder + run: | + ls -al ./release + working-directory: ${{ github.workspace }}/qt-build \ No newline at end of file