1 |
commit: fb26b7576fa158a1826b0984e2734f3be991740e |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 13 04:31:19 2021 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 13 04:33:00 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb26b757 |
7 |
|
8 |
games-action/chickens: EAPI6->8, fix build and runtime |
9 |
|
10 |
Closes: https://bugs.gentoo.org/638246 |
11 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
12 |
|
13 |
games-action/chickens/chickens-0.2.4-r1.ebuild | 76 +++++++++++++--------- |
14 |
.../chickens/files/chickens-0.2.4-bitmap.patch | 33 ++++++++++ |
15 |
.../chickens/files/chickens-0.2.4-settings.patch | 33 ++++++++++ |
16 |
3 files changed, 110 insertions(+), 32 deletions(-) |
17 |
|
18 |
diff --git a/games-action/chickens/chickens-0.2.4-r1.ebuild b/games-action/chickens/chickens-0.2.4-r1.ebuild |
19 |
index 4aa9dc2a0d8..2c0b8e41b96 100644 |
20 |
--- a/games-action/chickens/chickens-0.2.4-r1.ebuild |
21 |
+++ b/games-action/chickens/chickens-0.2.4-r1.ebuild |
22 |
@@ -1,62 +1,74 @@ |
23 |
-# Copyright 1999-2019 Gentoo Authors |
24 |
+# Copyright 1999-2021 Gentoo Authors |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
-EAPI=6 |
28 |
+EAPI=8 |
29 |
|
30 |
-inherit desktop |
31 |
+inherit desktop flag-o-matic toolchain-funcs |
32 |
|
33 |
MY_P="ChickensForLinux-Linux-${PV}" |
34 |
+ |
35 |
DESCRIPTION="Target chickens with rockets and shotguns. Funny" |
36 |
HOMEPAGE="http://www.chickensforlinux.com/" |
37 |
SRC_URI="http://www.chickensforlinux.com/${MY_P}.tar.gz" |
38 |
+S="${WORKDIR}/${PN}" |
39 |
|
40 |
LICENSE="all-rights-reserved" |
41 |
SLOT="0" |
42 |
KEYWORDS="~amd64 ~x86" |
43 |
-IUSE="" |
44 |
-RESTRICT="mirror bindist" |
45 |
+RESTRICT="bindist mirror" |
46 |
|
47 |
-DEPEND="acct-group/gamestat |
48 |
- <media-libs/allegro-5" |
49 |
-RDEPEND="${DEPEND}" |
50 |
+RDEPEND=" |
51 |
+ acct-group/gamestat |
52 |
+ media-libs/allegro:0[X]" |
53 |
+DEPEND="${RDEPEND}" |
54 |
|
55 |
-S=${WORKDIR}/${PN} |
56 |
+PATCHES=( |
57 |
+ "${FILESDIR}"/${P}-bitmap.patch |
58 |
+ "${FILESDIR}"/${P}-settings.patch |
59 |
+) |
60 |
|
61 |
src_prepare() { |
62 |
default |
63 |
|
64 |
- sed -i \ |
65 |
- -e "s:HighScores:/var/games//${PN}/HighScores:" \ |
66 |
- -e "s:....\(.\)\(_\)\(.*.4x0\)\(.\):M\4\2\x42\x6Fn\1s\2:" \ |
67 |
- highscore.cpp HighScores || die |
68 |
- sed -i \ |
69 |
- -e "s:options.cfg:/etc/${PN}/options.cfg:" \ |
70 |
- -e "s:\"sound/:\"/usr/share/${PN}/sound/:" \ |
71 |
- -e "s:\"dat/:\"/usr/share/${PN}/dat/:" \ |
72 |
- main.cpp README || die |
73 |
- sed -i \ |
74 |
- -e '/^CPPFLAGS/d' \ |
75 |
- -e 's:g++:\\$(CXX) \\$(CXXFLAGS) \\$(LDFLAGS):' \ |
76 |
- configure || die |
77 |
+ # sed kept for historical reasons |
78 |
+ sed -i 's|....\(.\)\(_\)\(.*.4x0\)\(.\)|M\4\2\x42\x6Fn\1s\2|' HighScores || die |
79 |
+ |
80 |
+ sed -i "s|HighScores|${EPREFIX}/var/games/${PN}.hs|" highscore.cpp || die |
81 |
+ |
82 |
+ sed -e "s|options.cfg|${EPREFIX}/etc/${PN}/&|" \ |
83 |
+ -e "s|sound/|${EPREFIX}/usr/share/${PN}/&|" \ |
84 |
+ -e "s|dat/|${EPREFIX}/usr/share/${PN}/&|" \ |
85 |
+ -i main.cpp README || die |
86 |
} |
87 |
|
88 |
src_configure() { |
89 |
- # econf (sometimes) fails, see https://bugs.gentoo.org/588544 |
90 |
- bash ./configure || die |
91 |
+ : # this configure file does no good |
92 |
+} |
93 |
+ |
94 |
+src_compile() { |
95 |
+ local obj=([!m]*.cpp) |
96 |
+ tc-export CXX |
97 |
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags allegro || die) |
98 |
+ append-libs $($(tc-getPKG_CONFIG) --libs allegro || die) |
99 |
+ emake -E "main: ${obj[*]/.cpp/.o}" LDLIBS="${LIBS}" |
100 |
} |
101 |
|
102 |
src_install() { |
103 |
- dobin ${PN} |
104 |
+ newbin main ${PN} |
105 |
+ dodoc AUTHOR README |
106 |
+ |
107 |
insinto /usr/share/${PN} |
108 |
doins -r dat sound |
109 |
- dodoc AUTHOR README |
110 |
- insinto /var/games/${PN} |
111 |
- doins HighScores |
112 |
+ |
113 |
insinto /etc/${PN} |
114 |
doins options.cfg |
115 |
- make_desktop_entry ${PN} Chickens |
116 |
|
117 |
- fowners root:gamestat /usr/bin/${PN} /var/games/${PN}/HighScores |
118 |
- fperms 2755 /usr/bin/${PN} |
119 |
- fperms 660 /var/games/${PN}/HighScores |
120 |
+ insinto /var/games |
121 |
+ newins HighScores ${PN}.hs |
122 |
+ |
123 |
+ fowners :gamestat /usr/bin/${PN} /var/games/${PN}.hs |
124 |
+ fperms g+s /usr/bin/${PN} |
125 |
+ fperms 660 /var/games/${PN}.hs |
126 |
+ |
127 |
+ make_desktop_entry ${PN} ${PN^} applications-games |
128 |
} |
129 |
|
130 |
diff --git a/games-action/chickens/files/chickens-0.2.4-bitmap.patch b/games-action/chickens/files/chickens-0.2.4-bitmap.patch |
131 |
new file mode 100644 |
132 |
index 00000000000..3156ebc7d2e |
133 |
--- /dev/null |
134 |
+++ b/games-action/chickens/files/chickens-0.2.4-bitmap.patch |
135 |
@@ -0,0 +1,33 @@ |
136 |
+https://bugs.gentoo.org/638246 |
137 |
+--- a/gem.h |
138 |
++++ b/gem.h |
139 |
+@@ -22,3 +22,2 @@ |
140 |
+ |
141 |
+- BITMAP image; |
142 |
+ void draw(); |
143 |
+@@ -33,2 +32,3 @@ |
144 |
+ bool active; |
145 |
++ BITMAP image; |
146 |
+ }; |
147 |
+--- a/smoke.cpp |
148 |
++++ b/smoke.cpp |
149 |
+@@ -40,3 +40,3 @@ |
150 |
+ |
151 |
+-int SMOKE::release() { |
152 |
++void SMOKE::release() { |
153 |
+ |
154 |
+@@ -62,3 +62,3 @@ |
155 |
+ |
156 |
+-int SMOKE::draw() { |
157 |
++void SMOKE::draw() { |
158 |
+ |
159 |
+--- a/smoke.h |
160 |
++++ b/smoke.h |
161 |
+@@ -32,5 +32,5 @@ |
162 |
+ |
163 |
+- int draw(); |
164 |
++ void draw(); |
165 |
+ int run(); |
166 |
+- int release(); |
167 |
++ void release(); |
168 |
+ |
169 |
|
170 |
diff --git a/games-action/chickens/files/chickens-0.2.4-settings.patch b/games-action/chickens/files/chickens-0.2.4-settings.patch |
171 |
new file mode 100644 |
172 |
index 00000000000..393e6ef5a87 |
173 |
--- /dev/null |
174 |
+++ b/games-action/chickens/files/chickens-0.2.4-settings.patch |
175 |
@@ -0,0 +1,33 @@ |
176 |
+Use ifstream so it can read the system's config, and default to windowed |
177 |
+mode (may crash depending on display, and is harder to exit from). |
178 |
+--- a/options.cfg |
179 |
++++ b/options.cfg |
180 |
+@@ -36,7 +36,7 @@ |
181 |
+ VOLUME 255 # 255 is full volume |
182 |
+ |
183 |
+ # --- video --- |
184 |
+-FULLSCREEN 1 # run in fullscreen (1) or windowed mode (0) |
185 |
++FULLSCREEN 0 # run in fullscreen (1) or windowed mode (0) |
186 |
+ |
187 |
+ # --- smoke --- |
188 |
+ TRANSLUCENT_SMOKE 1 # set to 0 if speed is an issue |
189 |
+--- a/settings.cpp |
190 |
++++ b/settings.cpp |
191 |
+@@ -4,7 +4,7 @@ |
192 |
+ |
193 |
+ int load_config(char* path) { |
194 |
+ |
195 |
+- fstream file(path); |
196 |
++ ifstream file(path); |
197 |
+ |
198 |
+ string key; |
199 |
+ char comment[255]; |
200 |
+@@ -82,7 +82,7 @@ |
201 |
+ CHANCE_OF_GEM = 25; |
202 |
+ CHICKEN_SPEED = 5; |
203 |
+ CHUNKS_PER_CHICKEN = 20; |
204 |
+- FULLSCREEN = 1; |
205 |
++ FULLSCREEN = 0; |
206 |
+ GAME_SPEED_OFFSET = 0; |
207 |
+ GRAVITY = 0.7; |
208 |
+ MAX_CHICKENS = 80; |