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/prismlauncher/
Date: Wed, 02 Nov 2022 11:49:38
Message-Id: 1667389766.1cf6aa60bd7096a235c561072ade8bbbc04e0c83.andrewammerlaan@gentoo
1 commit: 1cf6aa60bd7096a235c561072ade8bbbc04e0c83
2 Author: Thiago Donato Ferreira <flowlnlnln <AT> gmail <DOT> com>
3 AuthorDate: Tue Nov 1 15:40:33 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 2 11:49:26 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cf6aa60
7
8 games-action/prismlauncher: add 5.1
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/prismlauncher/Manifest | 1 +
14 .../prismlauncher/prismlauncher-5.1.ebuild | 147 +++++++++++++++++++++
15 2 files changed, 148 insertions(+)
16
17 diff --git a/games-action/prismlauncher/Manifest b/games-action/prismlauncher/Manifest
18 index 6ee941d3ab73..2e0d7ab91d60 100644
19 --- a/games-action/prismlauncher/Manifest
20 +++ b/games-action/prismlauncher/Manifest
21 @@ -1 +1,2 @@
22 DIST prismlauncher-5.0.tar.gz 9379431 BLAKE2B 0406b0e706068d32eaed427c5475b1388144b6155a69cf29674e7b45de84c86ca872615b6ec64602e942f155061630c7a866800e24ccb7546c2a32bf298380cf SHA512 71f19603a2e09d581ed80bbef6a3cd4a2c3081ba820fad8d73ebab155075d7a84e17ce9f70490a8984e7cb6a5d35089efb77bb5c364c4580fe4a8759fa79313d
23 +DIST prismlauncher-5.1.tar.gz 9401315 BLAKE2B 22a0508efc042a78099d0458d305c623465533d9770b111e584f4591cbd9372b354501fb3edf941f4c9f744f3540bd793c00f1ca428705bd2ca140be87056575 SHA512 2e0de23040b26c3bf9d3758b3c8ee0db6516edab9d25d64beca6ddde4c039d88655349895a1ab15b63c8c2e26f3fedbf2ef9f9c14ce5a86149aa75374c24cd5f
24
25 diff --git a/games-action/prismlauncher/prismlauncher-5.1.ebuild b/games-action/prismlauncher/prismlauncher-5.1.ebuild
26 new file mode 100644
27 index 000000000000..ae1e581ba2f0
28 --- /dev/null
29 +++ b/games-action/prismlauncher/prismlauncher-5.1.ebuild
30 @@ -0,0 +1,147 @@
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://prismlauncher.org/ https://github.com/PrismLauncher/PrismLauncher"
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/PrismLauncher/PrismLauncher
46 + "
47 +
48 + # TODO: Add tomlplusplus as a system library, like quazip
49 + EGIT_SUBMODULES=( '*' '-libraries/quazip' '-libraries/filesystem' )
50 +else
51 + MY_PN="PrismLauncher"
52 +
53 + # Let's use the vendored tarball to avoid dealing with the submodules directly
54 + SRC_URI="
55 + https://github.com/PrismLauncher/PrismLauncher/releases/download/${PV}/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz
56 + "
57 +
58 + # The Prism's files are unpacked to ${WORKDIR}/PrismLauncher-${PV}
59 + S="${WORKDIR}/${MY_PN}-${PV}"
60 +
61 + KEYWORDS="~amd64"
62 +fi
63 +
64 +# GPL-3 for PolyMC (PrismLauncher is forked from it) and Prism itself
65 +# Apache-2.0 for MultiMC (PolyMC is forked from it)
66 +# LGPL-3+ for libnbtplusplus
67 +# MIT for tomlplusplus
68 +# See the rest of PrismLauncher's libraries at https://github.com/PrismLauncher/PrismLauncher/tree/develop/libraries
69 +LICENSE="Apache-2.0 BSD BSD-2 GPL-2+ GPL-3 ISC LGPL-2.1+ LGPL-3+ MIT"
70 +
71 +SLOT="0"
72 +
73 +IUSE="debug lto qt6 test"
74 +REQUIRED_USE="
75 + lto? ( !debug )
76 +"
77 +
78 +RESTRICT="!test? ( test )"
79 +
80 +MIN_QT_5_VERSION="5.12.0"
81 +MIN_QT_6_VERSION="6.0.0"
82 +
83 +QT_DEPS="
84 + !qt6? (
85 + >=dev-qt/qtconcurrent-${MIN_QT_5_VERSION}:5
86 + >=dev-qt/qtcore-${MIN_QT_5_VERSION}:5
87 + >=dev-qt/qtgui-${MIN_QT_5_VERSION}:5
88 + >=dev-qt/qtnetwork-${MIN_QT_5_VERSION}:5
89 + >=dev-qt/qttest-${MIN_QT_5_VERSION}:5
90 + >=dev-qt/qtwidgets-${MIN_QT_5_VERSION}:5
91 + >=dev-qt/qtxml-${MIN_QT_5_VERSION}:5
92 + )
93 +
94 + qt6? (
95 + >=dev-qt/qtbase-${MIN_QT_6_VERSION}:6[concurrent,gui,network,widgets,xml(+)]
96 + >=dev-qt/qt5compat-${MIN_QT_6_VERSION}:6
97 + )
98 +"
99 +
100 +# Required at both build-time and run-time
101 +COMMON_DEPENDS="
102 + ${QT_DEPS}
103 +
104 + !qt6? ( >=dev-libs/quazip-1.3:=[qt5(+)] )
105 + qt6? ( >=dev-libs/quazip-1.3:=[qt6(-)] )
106 +
107 + sys-libs/zlib
108 +"
109 +
110 +# The gulrak-filesystem dependency is only needed at build time, because we don't actually use it on Linux,
111 +# only on legacy macOS. Still, we need it present at build time to appease CMake, and having it like this
112 +# makes it easier to maintain than patching the CMakeLists file directly.
113 +BDEPEND="
114 + app-text/scdoc
115 + dev-cpp/gulrak-filesystem
116 + kde-frameworks/extra-cmake-modules:5
117 +"
118 +
119 +DEPEND="
120 + ${COMMON_DEPENDS}
121 + media-libs/libglvnd
122 + >=virtual/jdk-1.8.0:*
123 +"
124 +
125 +# At run-time we don't depend on JDK, only JRE
126 +# And we need more than just the GL headers
127 +RDEPEND="
128 + ${COMMON_DEPENDS}
129 +
130 + !qt6? ( >=dev-qt/qtsvg-${MIN_QT_5_VERSION}:5 )
131 + qt6? ( >=dev-qt/qtsvg-${MIN_QT_6_VERSION}:6 )
132 +
133 + >=virtual/jre-1.8.0:*
134 + virtual/opengl
135 +"
136 +
137 +src_prepare() {
138 + cmake_src_prepare
139 +
140 + # Prevent conflicting with the user's flags
141 + # See https://bugs.gentoo.org/848765 for more info
142 + sed -i -e 's/-Werror//' -e 's/-D_FORTIFY_SOURCE=2//' CMakeLists.txt || die 'Failed to remove -Werror and -D_FORTIFY_SOURCE via sed'
143 +}
144 +
145 +src_configure(){
146 + local mycmakeargs=(
147 + -DCMAKE_INSTALL_PREFIX="/usr"
148 + # Resulting binary is named prismlauncher
149 + -DLauncher_APP_BINARY_NAME="${PN}"
150 + -DLauncher_QT_VERSION_MAJOR=$(usex qt6 6 5)
151 +
152 + -DENABLE_LTO=$(usex lto)
153 + -DBUILD_TESTING=$(usex test)
154 + )
155 +
156 + if use debug; then
157 + CMAKE_BUILD_TYPE=Debug
158 + else
159 + CMAKE_BUILD_TYPE=Release
160 + fi
161 +
162 + cmake_src_configure
163 +}
164 +
165 +src_compile(){
166 + cmake_src_compile
167 +}
168 +
169 +pkg_postinst() {
170 + xdg_pkg_postinst
171 +
172 + # Original issue: https://github.com/PolyMC/PolyMC/issues/227
173 + optfeature "old Minecraft (<= 1.12.2) support" x11-apps/xrandr
174 +
175 + optfeature "built-in MangoHud support" games-util/mangohud
176 + optfeature "built-in Feral Gamemode support" games-util/gamemode
177 +}