Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-action/battalion/, games-action/battalion/files/
Date: Sun, 19 Nov 2017 15:51:38
Message-Id: 1511106675.acdce5c5b1e2dd043bca0e92c762e9142565922f.soap@gentoo
1 commit: acdce5c5b1e2dd043bca0e92c762e9142565922f
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 19 15:48:51 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 19 15:51:15 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acdce5c5
7
8 games-action/battalion: Update to EAPI 6
9
10 * Remove games.eclass
11 * Respect user variables
12
13 Package-Manager: Portage-2.3.14, Repoman-2.3.6
14
15 games-action/battalion/battalion-1.4b-r1.ebuild | 69 ++++++++++++++++++++++
16 .../files/battalion-1.4b-fix-build-system.patch | 55 +++++++++++++++++
17 2 files changed, 124 insertions(+)
18
19 diff --git a/games-action/battalion/battalion-1.4b-r1.ebuild b/games-action/battalion/battalion-1.4b-r1.ebuild
20 new file mode 100644
21 index 00000000000..d601672cf21
22 --- /dev/null
23 +++ b/games-action/battalion/battalion-1.4b-r1.ebuild
24 @@ -0,0 +1,69 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +
30 +inherit toolchain-funcs
31 +
32 +DESCRIPTION="Be a rampaging monster and destroy the city"
33 +HOMEPAGE="http://evlweb.eecs.uic.edu/aej/AndyBattalion.html"
34 +SRC_URI="http://evlweb.eecs.uic.edu/aej/BATTALION/${PN}${PV}.tar.bz2"
35 +
36 +LICENSE="battalion HPND"
37 +SLOT="0"
38 +KEYWORDS="~x86"
39 +IUSE=""
40 +
41 +DEPEND="
42 + virtual/glu
43 + virtual/opengl
44 + x11-libs/libX11"
45 +RDEPEND=${DEPEND}
46 +
47 +S=${WORKDIR}/${PN}${PV}
48 +PATCHES=(
49 + "${FILESDIR}"/${P}-warning.patch
50 + "${FILESDIR}"/${PN}-1.4b-fix-build-system.patch
51 +)
52 +
53 +src_prepare() {
54 + default
55 +
56 + # Modify data paths
57 + sed -i \
58 + -e "s:SOUNDS/:${EPREFIX}/usr/share/${PN}/SOUNDS/:" \
59 + -e "s:MUSIC/:${EPREFIX}/usr/share/${PN}/MUSIC/:" \
60 + audio.c || die
61 + sed -i \
62 + -e "s:DATA/:${EPREFIX}/usr/share/${PN}/DATA/:" \
63 + -e "s:/usr/tmp:${EPREFIX}/var/${PN}:" \
64 + battalion.c || die
65 + sed -i \
66 + -e "s:TEXTURES/:${EPREFIX}/usr/share/${PN}/TEXTURES/:" \
67 + graphics.c || die
68 +
69 + # Only .raw sound files are used on Linux. The .au files are not needed.
70 + rm {SOUNDS,MUSIC}/*.au || die
71 +}
72 +
73 +src_configure() {
74 + tc-export CC
75 +}
76 +
77 +src_install() {
78 + dobin battalion
79 + einstalldocs
80 +
81 + insinto /usr/share/${PN}
82 + doins -r DATA MUSIC SOUNDS TEXTURES
83 +
84 + dodir /var/${PN}
85 + touch "${ED%/}"/var/${PN}/battalion_hiscore || die
86 + fperms 660 /var/${PN}/battalion_hiscore
87 +}
88 +
89 +pkg_postinst() {
90 + elog "Sound and music are not enabled by default."
91 + elog "Use the S and M keys to enable them in-game, or start the game with"
92 + elog "the -s and -m switches: battalion -s -m"
93 +}
94
95 diff --git a/games-action/battalion/files/battalion-1.4b-fix-build-system.patch b/games-action/battalion/files/battalion-1.4b-fix-build-system.patch
96 new file mode 100644
97 index 00000000000..fe209e1db95
98 --- /dev/null
99 +++ b/games-action/battalion/files/battalion-1.4b-fix-build-system.patch
100 @@ -0,0 +1,55 @@
101 +--- a/Makefile
102 ++++ b/Makefile
103 +@@ -23,7 +23,6 @@
104 + # (the program should compile with no warning messages - if you
105 + # see a warning message please let me know about it)
106 + # ------------------------------------------------------------
107 +-CC = cc
108 +
109 +
110 + # STEP 2: IF YOU WANT TO COMPILE WITH THE MESA LIBRARIES THEN
111 +@@ -39,7 +38,8 @@
112 + # ------------------------------------------------------------
113 + #GLIB = -lMesaGL -lMesaGLU
114 + # or
115 +-GLIB = -lGL -lGLU
116 ++GLIB_CFLAGS = `pkg-config --cflags gl` `pkg-config --cflags glu`
117 ++GLIB_LIBS = `pkg-config --libs gl` `pkg-config --libs glu`
118 +
119 +
120 + # STEP 4: CHOOSE WHICH HARDWARE / OS YOU ARE RUNNING
121 +@@ -91,13 +91,11 @@
122 +
123 + # STEP 7: CHOOSE ANY OPTIMIZATIONS OR ADD ANY SPECIAL INCLUSIONS
124 + # ------------------------------------------------------------
125 +-CFLAGS = -O2 -I/usr/local/X11/include -I/usr/demo/SOUND/ -I./. $(AUDIODEF) $(OS)
126 +
127 +
128 + # STEP 8: ADD ANY SPECIAL LIBRARY PATHS
129 + # (USEFUL TO POINT TO WHERE THE MESA LIBRARIES RESIDE)
130 + # ------------------------------------------------------------
131 +-LIBFLAGS =
132 +
133 + # you should now be able to type 'make' and everything should be fine ...
134 +
135 +@@ -106,15 +104,16 @@
136 + TARGET = battalion
137 +
138 + OBJ = battalion.o audio.o net.o gprim.o graphics.o objects.o text.o update.o tk.o font.o soundIt.o
139 +-LIBS = -L./. -L/usr/X11R6/lib -lm -lX11 -lXext
140 ++my_CPPFLAGS = -lm `pkg-config --cflags x11` `pkg-config --cflags xext` -I./. $(AUDIODEF) $(OS)
141 ++my_LIBS = -lm `pkg-config --libs x11` `pkg-config --libs xext`
142 +
143 + all: $(TARGET)
144 +
145 +-#$(OBJ): $(?:.o=.c)
146 +-# $(CC) $(CFLAGS) $(LIBFLAG) $(OS) $(WHICHLIB) $(AUDIOLIB) -c $?
147 ++.c.o:
148 ++ $(CC) $(CPPFLAGS) $(my_CPPFLAGS) $(CFLAGS) $(GLIB_CFLAGS) $(OS) $(WHICHLIB) $(AUDIOLIB) -c $<
149 +
150 + $(TARGET): $(OBJ)
151 +- $(CC) -o $(TARGET) $(OBJ) $(LIBFLAGS) $(GLIB) $(LIBS) $(AUDIODEF)
152 ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(GLIB_LIBS) $(LIBS) $(my_LIBS) $(AUDIODEF)
153 +
154 + clean:
155 + rm -f $(OBJ)