summaryrefslogtreecommitdiff
blob: 6f6b8eeb9c5adf015aa8c621820d54d051faef74 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit eutils toolchain-funcs

DESCRIPTION="A puzzle-solving, brain-stretching game for all ages"
HOMEPAGE="http://www.tuxradar.com/brainparty"
SRC_URI="https://launchpad.net/brainparty/trunk/${PV}/+download/${PN}${PV}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="
	media-libs/libsdl[sound,opengl,video]
	media-libs/sdl-gfx
	media-libs/sdl-image[png]
	media-libs/sdl-mixer[vorbis]
	media-libs/sdl-ttf"
DEPEND="${RDEPEND}"

S=${WORKDIR}/${PN}

PATCHES=(
	"${FILESDIR}"/${P}-savegame.patch
	"${FILESDIR}"/${P}-gcc49.patch
	"${FILESDIR}"/${P}-gnu_cxx-hash.patch
	"${FILESDIR}"/${P}-gcc-11.patch
	"${FILESDIR}"/${P}-clang-11.patch
)

src_prepare() {
	default

	sed -i \
		-e 's/$(LIBS) $(OSXCOMPAT) $(OBJFILES)/$(OSXCOMPAT) $(OBJFILES) $(LIBS)/' \
		-e 's/CXXFLAGS = .*/CXXFLAGS+=-c/' \
		-e '/^CXX =/d' \
		-e '/-o brainparty/s/INCLUDES) /&$(LDFLAGS) /' \
		Makefile || die
	sed -i \
		"/^int main(/ a\\\\tchdir(\"/usr/share/${PN}\");\n" \
		main.cpp || die

	tc-export CXX
}

src_install() {
	dobin brainparty

	insinto /usr/share/${PN}/Content
	doins -r Content/.

	newicon Content/icon.bmp ${PN}.bmp
	make_desktop_entry brainparty "Brain Party" /usr/share/pixmaps/${PN}.bmp
}