Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-engines/devilutionx/files/, games-engines/devilutionx/
Date: Thu, 30 Jun 2022 02:03:05
Message-Id: 1656554394.4612f095b9e804494aa8797af3ea57b104b99ec2.ionen@gentoo
1 commit: 4612f095b9e804494aa8797af3ea57b104b99ec2
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 01:28:06 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 01:59:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4612f095
7
8 games-engines/devilutionx: add 1.4.0
9
10 Essentially a new ebuild, upstream changed about everything around.
11
12 wrt bug #814170 about fonts, ttf is no longer used (sdl-ttf dep is
13 also gone) and instead it uses converted pcx fonts and so unbundling
14 doesn't feel realistic anymore.
15
16 Bug: https://bugs.gentoo.org/814170
17 Closes: https://bugs.gentoo.org/814167
18 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
19
20 games-engines/devilutionx/Manifest | 1 +
21 games-engines/devilutionx/devilutionx-1.4.0.ebuild | 78 ++++++++++++++++++++++
22 .../devilutionx-1.4.0-system-sdl_audiolib.patch | 18 +++++
23 games-engines/devilutionx/metadata.xml | 2 +
24 4 files changed, 99 insertions(+)
25
26 diff --git a/games-engines/devilutionx/Manifest b/games-engines/devilutionx/Manifest
27 index 6f525083a265..c0aa8501e30f 100644
28 --- a/games-engines/devilutionx/Manifest
29 +++ b/games-engines/devilutionx/Manifest
30 @@ -1 +1,2 @@
31 DIST devilutionx-1.2.1.tar.gz 3573200 BLAKE2B c3055bfa8ae0a670e21561673e23277fb76e2b24d269fdd86d13510f68a0e841ec96ab06cf98739913870884d82037b5297ce168e6cba1f8795de6ea72620649 SHA512 9327b127d0ad22d640b1a13fad9bfa00ba0fc512dd7ed362a9e84a80278d84634cd039cba7c98f15425715b11a35dc6ac07d75c816c3cbc818e6ab8c4437cf18
32 +DIST devilutionx-1.4.0.tar.xz 19752052 BLAKE2B 3a79e9d88cc2f5623dfd7d4ad2a0a547361cde8d95197be36dc7076e0b56fa1a915c57bf5537f5e4508201c3b5a283ab90d13db93b3836b0f12c6108abf1578a SHA512 9519c0bd52798f35fc986fab867b0005010f089b35200b5d54b7ed94145c2df54270a570cd3b0ff1c260f645d624a145e3581d744b48ae513919eb2258331bcf
33
34 diff --git a/games-engines/devilutionx/devilutionx-1.4.0.ebuild b/games-engines/devilutionx/devilutionx-1.4.0.ebuild
35 new file mode 100644
36 index 000000000000..c4ee3ebfae38
37 --- /dev/null
38 +++ b/games-engines/devilutionx/devilutionx-1.4.0.ebuild
39 @@ -0,0 +1,78 @@
40 +# Copyright 1999-2022 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=8
44 +
45 +inherit cmake xdg
46 +
47 +DESCRIPTION="Diablo engine for modern operating systems"
48 +HOMEPAGE="https://github.com/diasurgical/devilutionX/"
49 +SRC_URI="https://github.com/diasurgical/devilutionX/releases/download/${PV}/devilutionx-src.tar.xz -> ${P}.tar.xz"
50 +S="${WORKDIR}/${PN}-src-${PV}"
51 +
52 +LICENSE="Unlicense CC-BY-4.0 GPL-2+ LGPL-2.1+ MIT OFL-1.1 zerotier? ( BSL-1.1 )"
53 +SLOT="0"
54 +KEYWORDS="~amd64 ~x86"
55 +IUSE="debug +sodium test zerotier"
56 +RESTRICT="!test? ( test )"
57 +
58 +RDEPEND="
59 + app-arch/bzip2:=
60 + dev-libs/libfmt:=
61 + media-libs/libsdl2[haptic,joystick,opengl,video]
62 + media-libs/sdl2-image[png]
63 + sys-libs/zlib:=
64 + media-libs/sdl_audiolib
65 + sodium? ( dev-libs/libsodium:= )"
66 +DEPEND="
67 + ${RDEPEND}
68 + dev-cpp/asio
69 + test? ( dev-cpp/gtest )"
70 +BDEPEND="sys-devel/gettext"
71 +
72 +PATCHES=(
73 + "${FILESDIR}"/${P}-system-sdl_audiolib.patch
74 +)
75 +
76 +src_prepare() {
77 + cmake_src_prepare
78 +
79 + # use system asio
80 + echo 'add_library(asio INTERFACE)' > 3rdParty/asio/CMakeLists.txt || die
81 +}
82 +
83 +src_configure() {
84 + local mycmakeargs=(
85 + -DBUILD_TESTING=$(usex test)
86 + -DCCACHE_PROGRAM=OFF #813768
87 + -DDEBUG=$(usex debug)
88 + -DDISABLE_LTO=ON # let CFLAGS control this
89 + -DDISABLE_ZERO_TIER=$(usex !zerotier)
90 + -DPACKET_ENCRYPTION=$(usex sodium)
91 + -DPIE=ON
92 + )
93 + [[ ${PV} == 9999 ]] || mycmakeargs+=( -DVERSION_NUM=${PV} )
94 +
95 + cmake_src_configure
96 +}
97 +
98 +src_install() {
99 + local DOCS=( Packaging/nix/README.txt docs/*.md )
100 + cmake_src_install
101 +
102 + rm "${ED}"/usr/share/diasurgical/devilutionx/README.txt || die
103 +}
104 +
105 +pkg_postinst() {
106 + xdg_pkg_postinst
107 +
108 + if [[ ! ${REPLACING_VERSIONS} ]]; then
109 + elog "In order to play the game, you will need to copy the following data file"
110 + elog "from the original game, and optionally the hellfire expansion files:"
111 + elog " - DIABDAT.MPQ"
112 + elog " - hellfire.mpq hfmonk.mpq hfmusic.mpq hfvoice.mpq"
113 + elog "to ~/.local/share/diasurgical/devilution/"
114 + elog
115 + elog "See ${EROOT}/usr/share/doc/${PF}/README.txt* for details."
116 + fi
117 +}
118
119 diff --git a/games-engines/devilutionx/files/devilutionx-1.4.0-system-sdl_audiolib.patch b/games-engines/devilutionx/files/devilutionx-1.4.0-system-sdl_audiolib.patch
120 new file mode 100644
121 index 000000000000..26d0b0045022
122 --- /dev/null
123 +++ b/games-engines/devilutionx/files/devilutionx-1.4.0-system-sdl_audiolib.patch
124 @@ -0,0 +1,18 @@
125 +Short version of upstreamed:
126 +https://github.com/diasurgical/devilutionX/pull/4464
127 +--- a/CMake/Dependencies.cmake
128 ++++ b/CMake/Dependencies.cmake
129 +@@ -118,9 +118,11 @@
130 + endif()
131 +
132 + if(NOT NOSOUND)
133 +- dependency_options("SDL_audiolib" DEVILUTIONX_SYSTEM_SDL_AUDIOLIB OFF DEVILUTIONX_STATIC_SDL_AUDIOLIB)
134 ++ dependency_options("SDL_audiolib" DEVILUTIONX_SYSTEM_SDL_AUDIOLIB ON DEVILUTIONX_STATIC_SDL_AUDIOLIB)
135 + if(DEVILUTIONX_SYSTEM_SDL_AUDIOLIB)
136 +- find_package(SDL_audiolib REQUIRED)
137 ++ find_package(PkgConfig REQUIRED)
138 ++ pkg_check_modules(SDL_audiolib REQUIRED IMPORTED_TARGET SDL_audiolib)
139 ++ add_library(SDL_audiolib ALIAS PkgConfig::SDL_audiolib)
140 + else()
141 + add_subdirectory(3rdParty/SDL_audiolib)
142 + endif()
143
144 diff --git a/games-engines/devilutionx/metadata.xml b/games-engines/devilutionx/metadata.xml
145 index 6831710f8df5..ae8bad0665fb 100644
146 --- a/games-engines/devilutionx/metadata.xml
147 +++ b/games-engines/devilutionx/metadata.xml
148 @@ -7,6 +7,8 @@
149 </maintainer>
150 <use>
151 <flag name="lto">Build with link time optimization enabled</flag>
152 + <flag name="sodium">Enable network packet encryption using <pkg>dev-libs/libsodium</pkg></flag>
153 + <flag name="zerotier">Enable ZeroTier for online public games</flag>
154 </use>
155 <upstream>
156 <remote-id type="github">diasurgical/devilutionX</remote-id>