blob: 58702dbfd9587a084e0bbab0d3774931a66c8c4f (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit eutils cmake-utils versionator
MY_PV=$(replace_version_separator 2 '-')
MY_PV="${MY_PV/beta1/beta.1}"
MY_PN="smw"
DESCRIPTION="Fan-made multiplayer Super Mario Bros. style deathmatch game"
HOMEPAGE="https://github.com/mmatyas/supermariowar"
SRC_URI="https://github.com/mmatyas/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
LICENSE="GPL-2"
SLOT="0"
IUSE="server"
RDEPEND="
sys-libs/zlib
dev-cpp/yaml-cpp
net-libs/enet:1.3=
media-libs/sdl-mixer[vorbis]
media-libs/sdl-image[png,jpeg]"
DEPEND="
${RDEPEND}
app-arch/unzip
virtual/pkgconfig"
S="${WORKDIR}/${PN}-${MY_PV}"
src_unpack() {
unpack ${A}
cd "${S}" || die
unpack ./data.zip
}
src_prepare() {
default
einfo "Copying Findyaml-cpp.cmake"
cp "${FILESDIR}/${P}-yaml-cpp-config.cmake" cmake/Findyaml-cpp.cmake || die
eend $?
}
src_configure() {
local mycmakeargs=(
-DBUILD_STATIC_LIBS=OFF
-DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
-DSMW_BINDIR="${EPREFIX%/}/usr/bin"
-DSMW_DATADIR="${EPREFIX%/}/usr/share/${PF}"
)
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
local bin
for bin in "${ED}/usr/bin"/*; do
chmod 0755 "${bin}" || die
done
local smw_datadir="usr/share/${PF}"
local smw_bindir="${smw_datadir}/bin"
mkdir -p "${ED}/${smw_bindir}" || die
einfo "Moving ${PN} binary files to /${smw_bindir}"
mv "${ED}/usr/bin"/* "${ED}/${smw_bindir}" || die
eend $?
local base_bin
for bin in "${ED}/${smw_bindir}"/*; do
base_bin=$(basename "${bin}")
einfo "Creating ${base_bin} launcher in /usr/bin"
cat << EOF > "${base_bin}" || die
#!/usr/bin/env bash
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# ${PF} launcher: ${base_bin}
exec /${smw_bindir}/${base_bin} /${smw_datadir}
EOF
dobin "${base_bin}"
eend $?
done
if use server; then
local smw_server="${BUILD_DIR}/Binaries/Release/${MY_PN}-server"
local smw_serverdir="/${smw_datadir}/server"
einfo "Installing ${MY_PN}-server files"
dosbin "${smw_server}"
dodir "${smw_serverdir}"
insinto "${smw_serverdir}"
doins "${S}/src/server/serverconfig"
dosym "${smw_serverdir}/serverconfig" "/etc/${MY_PN}d.conf"
newinitd "${FILESDIR}/smwd.initd" "${MY_PN}d"
sed -i -e \
"s#@SMW_SERVERDIR@#${smw_serverdir}#g;" \
"${ED}/etc/init.d/${MY_PN}d" || die
eend $?
fi
}
|