summaryrefslogtreecommitdiff
path: root/games-action/teeworlds/teeworlds-0.7.5-r3.ebuild
blob: d38f319b13410e3f1a14b94106c3a5295ae3d8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{13..14} )
inherit cmake desktop flag-o-matic python-any-r1

DESCRIPTION="Online multi-player platform 2D shooter"
HOMEPAGE="https://www.teeworlds.com/"
SRC_URI="
	https://github.com/teeworlds/teeworlds/releases/download/${PV}/teeworlds-${PV}-src.tar.gz
	https://distfiles.gentoo.org/pub/dev/ionen@gentoo.org/${PN}.png
"
S=${WORKDIR}/${P}-src

LICENSE="ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="dedicated test"
RESTRICT="!test? ( test )"

RDEPEND="
	!dedicated? (
		media-libs/freetype
		media-libs/libglvnd[X]
		media-libs/libsdl2[sound,opengl,video]
		media-libs/pnglite
		media-sound/wavpack
	)
	dev-libs/openssl:=
	virtual/zlib:=
"
DEPEND="${RDEPEND}"
BDEPEND="
	${PYTHON_DEPS}
	test? ( dev-cpp/gtest )
"

PATCHES=(
	"${FILESDIR}"/${P}-cmake4.patch
)

src_configure() {
	append-flags -fno-strict-aliasing #858524

	local mycmakeargs=(
		-DCLIENT=$(usex !dedicated)
		-DCMAKE_DISABLE_FIND_PACKAGE_X11=yes # unused
	)

	cmake_src_configure
}

src_test() {
	cmake_build run_tests
}

src_install() {
	cmake_src_install

	doicon "${DISTDIR}"/${PN}.png
	domenu other/teeworlds.desktop

	newinitd "${FILESDIR}"/${PN}-init.d ${PN}

	insinto /etc/${PN}
	doins "${FILESDIR}"/teeworlds_srv.cfg
}