From ddeacce905c3cc79aa474c22820fab65062731ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C5=99=C3=ADza?= Date: Wed, 15 Dec 2021 21:32:57 +0100 Subject: [PATCH] Ports/qt6: Add qt6-serenity And this is the platform plugin we need to run Qt6 apps properly --- Ports/AvailablePorts.md | 1 + Ports/qt6-serenity/package.sh | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 Ports/qt6-serenity/package.sh diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 87135a8f2e6..bdcd64360f3 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -150,6 +150,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`pv`](pv/) | Pipe Viewer | 1.6.20 | http://www.ivarch.com/programs/pv.shtml | | [`python3`](python3/) | Python | 3.10.1 | https://www.python.org/ | | [`qt6-qtbase`](qt6-qtbase/) | Qt6 QtBase | 6.2.2 | https://qt.io | +| [`qt6-serenity`](qt6-serenity/) | QSerenityPlatform | | https://github.com/SerenityPorts/QSerenityPlatform | | [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake | | [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/SerenityOS/SerenityQuakeII | | [`r0`](r0/) | r0 (minimalistic commandline hexadecimal editor) | 0.8 | https://github.com/radareorg/r0 | diff --git a/Ports/qt6-serenity/package.sh b/Ports/qt6-serenity/package.sh new file mode 100755 index 00000000000..6edfc6c64d5 --- /dev/null +++ b/Ports/qt6-serenity/package.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=qt6-serenity +version=git +depends=("qt6-qtbase") +workdir=QSerenityPlatform-master +useconfigure=true +files="https://github.com/SerenityPorts/QSerenityPlatform/archive/master.zip QSerenityPlatform-git.zip" +configopts=( + "-GNinja" + "-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" + "-DCMAKE_CROSSCOMPILING=ON" + "-DQT_HOST_PATH=/usr" +) + +QT_HOST_PATH=/usr +QT_HOST_CMAKE_PATH=${QT_HOST_PATH}/lib64/cmake +QT_HOST_TOOLS="HostInfo CoreTools GuiTools WidgetsTools" +QT_HOST_TOOLS_PATH="${QT_HOST_CMAKE_PATH}/Qt6%s/\n" + +configure() { + for host_tool in ${QT_HOST_TOOLS}; do + if [[ ! -d $(printf $QT_HOST_TOOLS_PATH $host_tool) ]]; then + echo "You need to have Qt installed on the host (path "$(printf $QT_HOST_TOOLS_PATH $host_tool)" is missing" + exit 1 + fi + done + + MERGED_HOST_TOOLS=$(for host_tool in ${QT_HOST_TOOLS}; do echo "-DQt6${host_tool}_DIR=${QT_HOST_CMAKE_PATH}/Qt6${host_tool}/"; done) + + run cmake ${configopts[@]} ${MERGED_HOST_TOOLS} +} + +build() { + run ninja +} + +install() { + run ninja install +} + +clean() { + run ninja clean +}