Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-action/polymc/
Date: Fri, 09 Sep 2022 16:38:46
Message-Id: 1662741205.ce76782b3700cce6d311ad975173256d1b7ef5a4.andrewammerlaan@gentoo
1 commit: ce76782b3700cce6d311ad975173256d1b7ef5a4
2 Author: flow <flowlnlnln <AT> gmail <DOT> com>
3 AuthorDate: Thu Sep 8 18:52:06 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 9 16:33:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce76782b
7
8 games-action/polymc: add 1.4.2
9
10 Signed-off-by: Thiago Donato Ferreira <flowlnlnln <AT> gmail.com>
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
12
13 games-action/polymc/Manifest | 1 +
14 games-action/polymc/polymc-1.4.2.ebuild | 129 ++++++++++++++++++++++++++++++++
15 2 files changed, 130 insertions(+)
16
17 diff --git a/games-action/polymc/Manifest b/games-action/polymc/Manifest
18 index 0b23addb2f04..ec41e2572d21 100644
19 --- a/games-action/polymc/Manifest
20 +++ b/games-action/polymc/Manifest
21 @@ -1 +1,2 @@
22 DIST polymc-1.4.1.tar.gz 5771113 BLAKE2B d55907770d913c814015c4337c0442cb3fdaf92815f3e2f1f496b7869b6da8ee2295260efc3df67e7407ee27d300c4e89900603281e69163c07df216193c05d9 SHA512 170d03b61d3e9edbe1a0b27812e52fb90963d09769327f2d95eab6c4b7c88291136f47a44b7c206808fcc2e0e9ddf4aeb3a3f267ccbdc6b70b44d91c4642bf75
23 +DIST polymc-1.4.2.tar.gz 5766773 BLAKE2B 0d40f2b1fc6df28089d874a2de949b24a719936b0961fa08a0e909a82931b411926464328ada8ec05c148ba39e405ff9f4d336fc4ade316725756e235231eb60 SHA512 6212752a176e0d3414f66b013b46adc500c5d9e7fa250646aaf9b6bd42b9cbaa7c23282c7da6105e37d6ae77f790cd0036ad4e07b8aa50b611d41045035bc533
24
25 diff --git a/games-action/polymc/polymc-1.4.2.ebuild b/games-action/polymc/polymc-1.4.2.ebuild
26 new file mode 100644
27 index 000000000000..9b4f9e5b4a5b
28 --- /dev/null
29 +++ b/games-action/polymc/polymc-1.4.2.ebuild
30 @@ -0,0 +1,129 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +inherit cmake java-pkg-2 optfeature xdg
37 +
38 +HOMEPAGE="https://polymc.org/ https://github.com/PolyMC/PolyMC"
39 +DESCRIPTION="A custom, open source Minecraft launcher"
40 +
41 +if [[ ${PV} == 9999 ]]; then
42 + inherit git-r3
43 +
44 + EGIT_REPO_URI="
45 + https://github.com/PolyMC/PolyMC
46 + https://github.com/PolyMC/libnbtplusplus
47 + "
48 +
49 + EGIT_SUBMODULES=( 'depends/libnbtplusplus' )
50 +else
51 + MY_PN="PolyMC"
52 +
53 + # Let's use the vendored tarball to avoid dealing with the submodules directly
54 + SRC_URI="
55 + https://github.com/PolyMC/PolyMC/releases/download/${PV}/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz
56 + "
57 +
58 + # The PolyMC's files are unpacked to ${WORKDIR}/PolyMC-${PV}
59 + S="${WORKDIR}/${MY_PN}-${PV}"
60 +
61 + KEYWORDS="~amd64"
62 +fi
63 +
64 +# Apache-2.0 for MultiMC (PolyMC is forked from it)
65 +# GPL-3 for PolyMC
66 +# LGPL-3 for libnbtplusplus
67 +# See the rest of PolyMC's libraries at https://github.com/PolyMC/PolyMC/tree/develop/libraries
68 +LICENSE="Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2+ GPL-3 LGPL-3 OFL-1.1 MIT"
69 +
70 +SLOT="0"
71 +
72 +IUSE="debug lto test"
73 +REQUIRED_USE="
74 + lto? ( !debug )
75 +"
76 +
77 +RESTRICT="!test? ( test )"
78 +
79 +MIN_QT="5.12.0"
80 +QT_SLOT=5
81 +
82 +QT_DEPS="
83 + >=dev-qt/qtconcurrent-${MIN_QT}:${QT_SLOT}
84 + >=dev-qt/qtcore-${MIN_QT}:${QT_SLOT}
85 + >=dev-qt/qtgui-${MIN_QT}:${QT_SLOT}
86 + >=dev-qt/qtnetwork-${MIN_QT}:${QT_SLOT}
87 + >=dev-qt/qttest-${MIN_QT}:${QT_SLOT}
88 + >=dev-qt/qtwidgets-${MIN_QT}:${QT_SLOT}
89 + >=dev-qt/qtxml-${MIN_QT}:${QT_SLOT}
90 +"
91 +
92 +# Required at both build-time and run-time
93 +COMMON_DEPENDS="
94 + ${QT_DEPS}
95 + >=dev-libs/quazip-1.3:=[qt5(+)]
96 + sys-libs/zlib
97 +"
98 +
99 +BDEPEND="
100 + app-text/scdoc
101 + kde-frameworks/extra-cmake-modules:5
102 +"
103 +
104 +DEPEND="
105 + ${COMMON_DEPENDS}
106 + media-libs/libglvnd
107 + >=virtual/jdk-1.8.0:*
108 +"
109 +
110 +# At run-time we don't depend on JDK, only JRE
111 +# And we need more than just the GL headers
112 +RDEPEND="
113 + ${COMMON_DEPENDS}
114 + >=virtual/jre-1.8.0:*
115 + virtual/opengl
116 +"
117 +
118 +src_prepare() {
119 + cmake_src_prepare
120 +
121 + # Prevent conflicting with the user's flags
122 + # See https://bugs.gentoo.org/848765 for more info
123 + sed -i -e 's/-Werror//' -e 's/-D_FORTIFY_SOURCE=2//' CMakeLists.txt || die 'Failed to remove -Werror and -D_FORTIFY_SOURCE via sed'
124 +}
125 +
126 +src_configure(){
127 + local mycmakeargs=(
128 + -DCMAKE_INSTALL_PREFIX="/usr"
129 + # Resulting binary is named polymc
130 + -DLauncher_APP_BINARY_NAME="${PN}"
131 + # Force Qt5 to avoid accidentaly building the Qt6 version and breaking things
132 + -DLauncher_QT_VERSION_MAJOR=${QT_SLOT}
133 +
134 + -DENABLE_LTO=$(usex lto)
135 + -DBUILD_TESTING=$(usex test)
136 + )
137 +
138 + if use debug; then
139 + CMAKE_BUILD_TYPE=Debug
140 + else
141 + CMAKE_BUILD_TYPE=Release
142 + fi
143 +
144 + cmake_src_configure
145 +}
146 +
147 +src_compile(){
148 + cmake_src_compile
149 +}
150 +
151 +pkg_postinst() {
152 + xdg_pkg_postinst
153 +
154 + # https://github.com/PolyMC/PolyMC/issues/227
155 + optfeature "old Minecraft (<= 1.12.2) support" x11-libs/libXrandr
156 +
157 + optfeature "built-in MangoHud support" games-util/mangohud
158 + optfeature "built-in Feral Gamemode support" games-util/gamemode
159 +}