Lines 6-13
Link Here
|
6 |
# GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" |
6 |
# GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" |
7 |
# MOD_BINS - Name of the binary to run |
7 |
# MOD_BINS - Name of the binary to run |
8 |
# MOD_DESC - Description for the mod |
8 |
# MOD_DESC - Description for the mod |
9 |
# MOD_DIR - Subdirectory name for the mod, if applicable |
9 |
# MOD_DIR - Subdirectory name for the mod, if applicable |
10 |
# MOD_ICON - Custom icon for the mod, instead of the default |
10 |
# MOD_ICON - Custom icon for the mod, instead of the default |
|
|
11 |
# MOD_MAP - Name of map to load at start, if applicable |
11 |
# MOD_NAME - Creates a command-line wrapper and desktop icon for the mod |
12 |
# MOD_NAME - Creates a command-line wrapper and desktop icon for the mod |
12 |
# MOD_TBZ2 - File to extract within the Makeself archive |
13 |
# MOD_TBZ2 - File to extract within the Makeself archive |
13 |
|
14 |
|
Lines 16-71
Link Here
|
16 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst |
17 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst |
17 |
|
18 |
|
18 |
[[ -z ${GAME} ]] && GAME=${PN%%-*} |
19 |
[[ -z ${GAME} ]] && GAME=${PN%%-*} |
|
|
20 |
GAME_EXE=${GAME} |
21 |
DED_EXE=${GAME_EXE}-ded |
22 |
DED_OPTIONS="+set dedicated 1 +exec server.cfg" |
23 |
SELECT_MOD="+set fs_game " |
24 |
SELECT_MAP="+map " |
19 |
|
25 |
|
20 |
# Set our default title, icon, and cli options |
26 |
# Set our default title, icon, and cli options |
21 |
case "${GAME}" in |
27 |
case "${GAME}" in |
22 |
"doom3") |
28 |
"doom3") |
23 |
GAME_TITLE="Doom III" |
29 |
GAME_TITLE="Doom III" |
24 |
DEFAULT_MOD_ICON="doom3.png" |
30 |
DEFAULT_MOD_ICON="doom3.png" |
25 |
SELECT_MOD="+set fs_game " |
|
|
26 |
GAME_EXE="doom3" |
27 |
DED_EXE="doom3-ded" |
28 |
DED_OPTIONS="+set dedicated 1 +exec server.cfg" |
29 |
;; |
31 |
;; |
30 |
"enemy-territory") |
32 |
"enemy-territory") |
31 |
GAME_TITLE="Enemy Territory" |
33 |
GAME_TITLE="Enemy Territory" |
32 |
DEFAULT_MOD_ICON="ET.xpm" |
34 |
DEFAULT_MOD_ICON="ET.xpm" |
33 |
SELECT_MOD="+set fs_game " |
|
|
34 |
GAME_EXE="et" |
35 |
GAME_EXE="et" |
35 |
DED_EXE="et-ded" |
36 |
DED_EXE="et-ded" |
36 |
DED_OPTIONS="+set dedicated 1 +exec server.cfg" |
|
|
37 |
;; |
37 |
;; |
38 |
"quake3") |
38 |
"quake3") |
39 |
GAME_TITLE="Quake III" |
39 |
GAME_TITLE="Quake III" |
40 |
DEFAULT_MOD_ICON="quake3.xpm" |
40 |
DEFAULT_MOD_ICON="quake3.xpm" |
41 |
SELECT_MOD="+set fs_game " |
|
|
42 |
GAME_EXE="quake3" |
43 |
DED_EXE="quake3-ded" |
44 |
DED_OPTIONS="+set dedicated 1 +exec server.cfg" |
45 |
;; |
41 |
;; |
46 |
"quake4") |
42 |
"quake4") |
47 |
GAME_TITLE="Quake IV" |
43 |
GAME_TITLE="Quake IV" |
48 |
DEFAULT_MOD_ICON="quake4.bmp" |
44 |
DEFAULT_MOD_ICON="quake4.bmp" |
49 |
SELECT_MOD="+set fs_game " |
|
|
50 |
GAME_EXE="q4" |
51 |
DED_EXE="q4-ded" |
52 |
DED_OPTIONS="+set dedicated 1 +exec server.cfg" |
53 |
;; |
45 |
;; |
54 |
"ut2003") |
46 |
"ut2003") |
55 |
GAME_TITLE="UT2003" |
47 |
GAME_TITLE="UT2003" |
56 |
DEFAULT_MOD_ICON="ut2003.xpm" |
48 |
DEFAULT_MOD_ICON="ut2003.xpm" |
57 |
SELECT_MOD="-mod=" |
49 |
SELECT_MOD="-mod=" |
58 |
GAME_EXE="ut2003" |
|
|
59 |
DED_EXE="ucc" |
50 |
DED_EXE="ucc" |
60 |
DED_OPTIONS="" |
51 |
DED_OPTIONS="" |
|
|
52 |
SELECT_MAP="" |
61 |
;; |
53 |
;; |
62 |
"ut2004") |
54 |
"ut2004") |
63 |
GAME_TITLE="UT2004" |
55 |
GAME_TITLE="UT2004" |
64 |
DEFAULT_MOD_ICON="ut2004.xpm" |
56 |
DEFAULT_MOD_ICON="ut2004.xpm" |
65 |
SELECT_MOD="-mod=" |
57 |
SELECT_MOD="-mod=" |
66 |
GAME_EXE="ut2004" |
|
|
67 |
DED_EXE="ucc" |
58 |
DED_EXE="ucc" |
68 |
DED_OPTIONS="" |
59 |
DED_OPTIONS="" |
|
|
60 |
SELECT_MAP="" |
69 |
;; |
61 |
;; |
70 |
*) |
62 |
*) |
71 |
eerror "This game is either not supported or you must set the GAME" |
63 |
eerror "This game is either not supported or you must set the GAME" |
Lines 114-120
Link Here
|
114 |
if has_version ${CATEGORY}/${GAME}-bin |
106 |
if has_version ${CATEGORY}/${GAME}-bin |
115 |
then |
107 |
then |
116 |
if use dedicated && \ |
108 |
if use dedicated && \ |
117 |
! built_with_use ${CATEGORY}/${GAME}-bin dedicated |
109 |
! built_with_use ${CATEGORY}/${GAME}-bin dedicated |
118 |
then |
110 |
then |
119 |
die "You must merge ${CATEGORY}/${GAME}-bin with USE=dedicated!" |
111 |
die "You must merge ${CATEGORY}/${GAME}-bin with USE=dedicated!" |
120 |
fi |
112 |
fi |
Lines 169-178
Link Here
|
169 |
done |
161 |
done |
170 |
done |
162 |
done |
171 |
# Since we remove all of these anyway, let's move it to the eclass |
163 |
# Since we remove all of these anyway, let's move it to the eclass |
172 |
rm -f 3355_patch 3339_patch |
164 |
[[ -e 3355_patch ]] && rm -f 3355_patch |
173 |
} |
165 |
} |
174 |
|
166 |
|
175 |
games-mods_src_install() { |
167 |
games-mods_src_install() { |
|
|
168 |
local binary |
176 |
local readme MOD_ICON_EXT new_bin_name bin_name mod files directories i j |
169 |
local readme MOD_ICON_EXT new_bin_name bin_name mod files directories i j |
177 |
INS_DIR=${dir} |
170 |
INS_DIR=${dir} |
178 |
|
171 |
|
Lines 222-227
Link Here
|
222 |
fi |
215 |
fi |
223 |
|
216 |
|
224 |
# Set up command-line and desktop menu entries |
217 |
# Set up command-line and desktop menu entries |
|
|
218 |
local game_select="${SELECT_MOD}${MOD_DIR}" |
219 |
[[ -n "${MOD_MAP}" ]] \ |
220 |
&& game_select="${game_select} ${SELECT_MAP}${MOD_MAP}" |
221 |
|
225 |
if [[ -n "${MOD_BINS}" ]] |
222 |
if [[ -n "${MOD_BINS}" ]] |
226 |
then |
223 |
then |
227 |
for binary in ${MOD_BINS} |
224 |
for binary in ${MOD_BINS} |
Lines 275-281
Link Here
|
275 |
elif [[ -n "${MOD_DIR}" ]] |
272 |
elif [[ -n "${MOD_DIR}" ]] |
276 |
then |
273 |
then |
277 |
games_make_wrapper "${GAME_EXE}-${MOD_DIR}" \ |
274 |
games_make_wrapper "${GAME_EXE}-${MOD_DIR}" \ |
278 |
"${GAME_EXE} ${SELECT_MOD}${MOD_DIR}" "${dir}" "${dir}" |
275 |
"${GAME_EXE} ${game_select}" "${dir}" "${dir}" |
279 |
make_desktop_entry "${GAME_EXE}-${MOD_DIR}" \ |
276 |
make_desktop_entry "${GAME_EXE}-${MOD_DIR}" \ |
280 |
"${GAME_TITLE} - ${MOD_NAME}" "${MOD_ICON}" |
277 |
"${GAME_TITLE} - ${MOD_NAME}" "${MOD_ICON}" |
281 |
# Since only quake3 has both a binary and a source-based install, |
278 |
# Since only quake3 has both a binary and a source-based install, |
Lines 287-296
Link Here
|
287 |
games_make_wrapper "${GAME_EXE}-bin-${MOD_DIR}" \ |
284 |
games_make_wrapper "${GAME_EXE}-bin-${MOD_DIR}" \ |
288 |
"${GAME_EXE}-bin ${SELECT_MOD}${MOD_DIR}" \ |
285 |
"${GAME_EXE}-bin ${SELECT_MOD}${MOD_DIR}" \ |
289 |
"${dir}" "${dir}" |
286 |
"${dir}" "${dir}" |
|
|
287 |
make_desktop_entry "${GAME_EXE}-bin-${MOD_DIR}" \ |
288 |
"${GAME_TITLE} - ${MOD_NAME} (binary)" \ |
289 |
"${MOD_ICON}" |
290 |
fi |
290 |
fi |
291 |
make_desktop_entry "${GAME_EXE}-bin-${MOD_DIR}" \ |
|
|
292 |
"${GAME_TITLE} - ${MOD_NAME} (binary)" \ |
293 |
"${MOD_ICON}" |
294 |
;; |
291 |
;; |
295 |
esac |
292 |
esac |
296 |
fi |
293 |
fi |