commit:     ff08079716399cafe5aad20e334b9b8c09ca709d
Author:     Thiago Donato Ferreira <flowlnlnln <AT> gmail <DOT> com>
AuthorDate: Sun Sep 18 22:24:11 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 10:14:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff080797

games-action/polymc: add qt6 USE flag to the live ebuild

Signed-off-by: Thiago Donato Ferreira <flowlnlnln <AT> gmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 games-action/polymc/metadata.xml       |  1 +
 games-action/polymc/polymc-9999.ebuild | 36 ++++++++++++++++++++++------------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/games-action/polymc/metadata.xml b/games-action/polymc/metadata.xml
index f704149126f6..7ba4aabb75f4 100644
--- a/games-action/polymc/metadata.xml
+++ b/games-action/polymc/metadata.xml
@@ -25,5 +25,6 @@
   <longdescription>PolyMC is a multi-instance Minecraft launcher focused on 
user freedom, redistributability, and simplicity.</longdescription>
   <use>
     <flag name="lto">Enable link-time optimization</flag>
+    <flag name="qt6">Build with Qt6 support instead of the default Qt5</flag>
   </use>
 </pkgmetadata>

diff --git a/games-action/polymc/polymc-9999.ebuild 
b/games-action/polymc/polymc-9999.ebuild
index 0f99fa720844..c9733e891936 100644
--- a/games-action/polymc/polymc-9999.ebuild
+++ b/games-action/polymc/polymc-9999.ebuild
@@ -39,30 +39,41 @@ LICENSE="Apache-2.0 BSD BSD-2 GPL-2+ GPL-3 ISC LGPL-2.1+ 
LGPL-3+ MIT"
 
 SLOT="0"
 
-IUSE="debug lto test"
+IUSE="debug lto qt6 test"
 REQUIRED_USE="
        lto? ( !debug )
 "
 
 RESTRICT="!test? ( test )"
 
-MIN_QT="5.12.0"
-QT_SLOT=5
+MIN_QT_5_VERSION="5.12.0"
+MIN_QT_6_VERSION="6.0.0"
 
 QT_DEPS="
-       >=dev-qt/qtconcurrent-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qtcore-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qtgui-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qtnetwork-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qttest-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qtwidgets-${MIN_QT}:${QT_SLOT}
-       >=dev-qt/qtxml-${MIN_QT}:${QT_SLOT}
+       !qt6? (
+               >=dev-qt/qtconcurrent-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qtcore-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qtgui-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qtnetwork-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qttest-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qtwidgets-${MIN_QT_5_VERSION}:5
+               >=dev-qt/qtxml-${MIN_QT_5_VERSION}:5
+       )
+
+       qt6? (
+               
>=dev-qt/qtbase-${MIN_QT_6_VERSION}:6[concurrent,gui,network,widgets,xml(+)]
+               >=dev-qt/qtsvg-${MIN_QT_6_VERSION}:6
+               >=dev-qt/qt5compat-${MIN_QT_6_VERSION}:6
+       )
 "
 
 # Required at both build-time and run-time
 COMMON_DEPENDS="
        ${QT_DEPS}
-       >=dev-libs/quazip-1.3:=[qt5(+)]
+
+       !qt6? ( >=dev-libs/quazip-1.3:=[qt5(+)] )
+        qt6? ( >=dev-libs/quazip-1.3:=[qt6(-)] )
+
        sys-libs/zlib
 "
 
@@ -102,8 +113,7 @@ src_configure(){
                -DCMAKE_INSTALL_PREFIX="/usr"
                # Resulting binary is named polymc
                -DLauncher_APP_BINARY_NAME="${PN}"
-               # Force Qt5 to avoid accidentaly building the Qt6 version and 
breaking things
-               -DLauncher_QT_VERSION_MAJOR=${QT_SLOT}
+               -DLauncher_QT_VERSION_MAJOR=$(usex qt6 6 5)
 
                -DENABLE_LTO=$(usex lto)
                -DBUILD_TESTING=$(usex test)

Reply via email to