Skip to content

Commit

Permalink
games-action/polymc: add qt6 USE flag to the live ebuild
Browse files Browse the repository at this point in the history
Signed-off-by: Thiago Donato Ferreira <[email protected]>
Signed-off-by: Andrew Ammerlaan <[email protected]>
  • Loading branch information
flowln authored and Nowa-Ammerlaan committed Sep 22, 2022
1 parent 3ac14d4 commit ff08079
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions games-action/polymc/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
36 changes: 23 additions & 13 deletions games-action/polymc/polymc-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
"

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ff08079

Please sign in to comment.