Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-arcade/xscavenger/files/, games-arcade/xscavenger/
Date: Mon, 28 Jun 2021 16:49:31
Message-Id: 1624898559.59d9c1824d3b9a3200d298db15bd82ddb1c42987.ionen@gentoo
1 commit: 59d9c1824d3b9a3200d298db15bd82ddb1c42987
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 28 16:11:06 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 28 16:42:39 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59d9c182
7
8 games-arcade/xscavenger: add 1.4.5, EAPI 7->8, remove imake
9
10 imake makes something that's very simple needlessly complicated,
11 use an implicit make rule instead (fixes bug #739120).
12
13 Updated old patch with references and more fixes (notably for
14 garbled sub-menu text when using gcc7+). Also support prefix, add
15 previously missing man page, and updated homepage.
16
17 This version notably uses ALSA over /dev/dsp.
18
19 Closes: https://bugs.gentoo.org/612812
20 Closes: https://bugs.gentoo.org/739120
21 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
22
23 games-arcade/xscavenger/Manifest | 1 +
24 .../files/xscavenger-1.4.5-misc-fixes.patch | 130 +++++++++++++++++++++
25 games-arcade/xscavenger/xscavenger-1.4.5.ebuild | 52 +++++++++
26 3 files changed, 183 insertions(+)
27
28 diff --git a/games-arcade/xscavenger/Manifest b/games-arcade/xscavenger/Manifest
29 index 4767eec34c8..ca4a4be077e 100644
30 --- a/games-arcade/xscavenger/Manifest
31 +++ b/games-arcade/xscavenger/Manifest
32 @@ -1 +1,2 @@
33 DIST xscavenger-1.4.4.tgz 193346 BLAKE2B eb86b97fad8a9d261935579d298f43e7063fbd0624e8fd654c72b4130e98db38541d54c59938375c8d6df4b50193436f86826c49b8bafe123b4be5c80d3f75d8 SHA512 5f200912b9114ea0c09f0bfcc3f06be2e7c2e1700a744319081f5f3a22c8b93663477076af27837326acf9830af6f597cf8f8fb44562db7d00128321487841ec
34 +DIST xscavenger-1.4.5.tgz 192990 BLAKE2B 5df2ca8b7b331d9c17ef8f287a8967f4f95a8737660fb42e4f5012f00ab24698d555e3f76bd82f3ba7b55423244e9d0a4392ccce99c84bed6cf80dee15ab3bf6 SHA512 ebdde5c74409dc881503ee6eeecb7194218141c6e7c169c2febd1a4339625e1532a654fc1ac2ce7b3256e8a721f656dfb7bddc4394e0513a5130e3cc8795dfe7
35
36 diff --git a/games-arcade/xscavenger/files/xscavenger-1.4.5-misc-fixes.patch b/games-arcade/xscavenger/files/xscavenger-1.4.5-misc-fixes.patch
37 new file mode 100644
38 index 00000000000..be45c6c4083
39 --- /dev/null
40 +++ b/games-arcade/xscavenger/files/xscavenger-1.4.5-misc-fixes.patch
41 @@ -0,0 +1,130 @@
42 +* Missing return value (needed by clang)
43 +* Implicit declarations (string.h and doall)
44 +* Datafile loading broken on architectures where sizeof(long)>4
45 + https://bugs.debian.org/56139
46 +* Scavenger leaks file descriptors
47 + https://bugs.debian.org/175128
48 +* Font mapping with clang or gcc-7+
49 + https://svnweb.freebsd.org/ports?view=revision&revision=444423
50 +--- a/src/edit.c
51 ++++ b/src/edit.c
52 +@@ -3,2 +3,3 @@
53 + #include <stdio.h>
54 ++#include <string.h>
55 + #include <unistd.h>
56 +--- a/src/scav.c
57 ++++ b/src/scav.c
58 +@@ -246,7 +246,9 @@
59 +
60 +- val1=myci()<<24L;
61 +- val1|=myci()<<16L;
62 +- val1|=myci()<<8;
63 +- val1|=myci();
64 ++ int i,j;
65 +
66 ++ for (i=0; i<4; i++) {
67 ++ j = myci();
68 ++ if (j==-1) return -1L;
69 ++ val1 = (val1<<8) + j;
70 ++ }
71 + return val1;
72 +@@ -404,6 +406,6 @@
73 + got=read(input,buff,8);
74 +- if(got!=8) return -2;
75 +- if (strncmp(buff,"SCAV",4)) return -3;
76 ++ if(got!=8) {close(input);return -2;}
77 ++ if (strncmp(buff,"SCAV",4)) {close(input);return -3;}
78 + max=(buff[4]<<24) | (buff[5]<<16) | (buff[6]<<8) | buff[7];
79 +- if(num>=max) return 0;
80 ++ if(num>=max) {close(input);return 0;}
81 + lseek(input,(num+1)<<3,SEEK_SET);
82 +@@ -413,3 +415,3 @@
83 + if(len>length) len=length;
84 +- if(!offset || !len) return 0;
85 ++ if(!offset || !len) {close(input);return 0;}
86 + lseek(input,offset,SEEK_SET);
87 +@@ -450,4 +452,4 @@
88 + got=read(input,buff,8);
89 +- if(got!=8) return -2;
90 +- if(strncmp(buff,"SCAV",4)) return -3;
91 ++ if(got!=8) {close(input);return -2;}
92 ++ if(strncmp(buff,"SCAV",4)) {close(input);return -3;}
93 + output=creat(bakname,00600);
94 +@@ -475,4 +477,4 @@
95 + headers[i+i]+=delta;
96 +- if (write(output,"SCAV",4) != 4) return -200;
97 +- if (!rlout(output,max)) return -200;
98 ++ if (write(output,"SCAV",4) != 4) {close(input);close(output);return -200;}
99 ++ if (!rlout(output,max)) {close(input);close(output);return -200;}
100 + headers[num+num]=0;
101 +@@ -480,3 +482,3 @@
102 + for(i=0;i<max+max;i++)
103 +- if (!rlout(output,headers[i])) return -200;
104 ++ if (!rlout(output,headers[i])) {close(input);close(output);return -200;}
105 +
106 +@@ -489,4 +491,4 @@
107 + got=count>1024 ? 1024 : count;
108 +- if (read(input,copybuff,got) != got) return -200;
109 +- if (write(output,copybuff,got) != got) return -200;
110 ++ if (read(input,copybuff,got) != got) {close(input);close(output);return -200;}
111 ++ if (write(output,copybuff,got) != got) {close(input);close(output);return -200;}
112 + count-=got;
113 +@@ -500,3 +502,3 @@
114 + if (!got) break;
115 +- if (write (output, copybuff, got) != got) return -200;
116 ++ if (write (output, copybuff, got) != got) {close(input);close(output);return -200;}
117 + offset += got;
118 +@@ -505,8 +507,8 @@
119 + {
120 +- if (write (output, take, len) != len) return -200;
121 ++ if (write (output, take, len) != len) {close(input);close(output);return -200;}
122 + lseek (output, (num+1) << 3, SEEK_SET);
123 +- if (!rlout (output, offset)) return -200;
124 ++ if (!rlout (output, offset)) {close(input);close(output);return -200;}
125 + }
126 + close (input);
127 +- if (fsync(output)) return -200;
128 ++ if (fsync(output)) {close(output);return -200;}
129 + if (close(output)) return -200;
130 +@@ -1384,2 +1386,3 @@
131 + }
132 ++ close(file);
133 + }
134 +@@ -1418,2 +1421,4 @@
135 + } while(len);
136 ++ close(input);
137 ++ close(output);
138 + return 0;
139 +@@ -1450,3 +1455,3 @@
140 + }
141 +- }
142 ++ } else close(file);
143 +
144 +@@ -1487,3 +1492,3 @@
145 + }
146 +- }
147 ++ } else close(file);
148 + }
149 +@@ -1574,3 +1579,3 @@
150 + puts(err);
151 +- return;
152 ++ return 1;
153 + }
154 +--- a/src/sound.c
155 ++++ b/src/sound.c
156 +@@ -50,2 +50,3 @@
157 +
158 ++void doall();
159 + void opendsp(int samplerate)
160 +@@ -201,3 +202,3 @@
161 +
162 +-doall()
163 ++void doall()
164 + {
165 +--- a/src/x.c
166 ++++ b/src/x.c
167 +@@ -447,3 +447,3 @@
168 + {
169 +- fmap[tolower(*p)]=fmap[*p++]=i++;
170 ++ fmap[tolower(*p)]=fmap[*p]=i++; p++;
171 + }
172
173 diff --git a/games-arcade/xscavenger/xscavenger-1.4.5.ebuild b/games-arcade/xscavenger/xscavenger-1.4.5.ebuild
174 new file mode 100644
175 index 00000000000..bb62ad68f02
176 --- /dev/null
177 +++ b/games-arcade/xscavenger/xscavenger-1.4.5.ebuild
178 @@ -0,0 +1,52 @@
179 +# Copyright 1999-2021 Gentoo Authors
180 +# Distributed under the terms of the GNU General Public License v2
181 +
182 +EAPI=8
183 +
184 +inherit desktop flag-o-matic toolchain-funcs
185 +
186 +DESCRIPTION="Lode-Runner-like arcade game"
187 +HOMEPAGE="https://www.linuxmotors.com/linux/scavenger/index.html"
188 +SRC_URI="https://www.linuxmotors.com/linux/scavenger/downloads/${P}.tgz"
189 +
190 +LICENSE="GPL-2"
191 +SLOT="0"
192 +KEYWORDS="~amd64 ~x86"
193 +
194 +RDEPEND="
195 + media-libs/alsa-lib
196 + x11-libs/libX11"
197 +DEPEND="
198 + ${RDEPEND}
199 + x11-base/xorg-proto"
200 +BDEPEND="virtual/pkgconfig"
201 +
202 +PATCHES=(
203 + "${FILESDIR}"/${P}-misc-fixes.patch
204 +)
205 +
206 +src_compile() {
207 + tc-export CC
208 +
209 + # skip using imake for simplicity
210 + local cppargs=(
211 + -DLIBNAME="'\"${EPREFIX}/usr/share/${PN}\"'"
212 + $($(tc-getPKG_CONFIG) --cflags alsa x11)
213 + )
214 + append-cppflags "${cppargs[@]}"
215 +
216 + LDLIBS="$($(tc-getPKG_CONFIG) --libs alsa x11)" \
217 + emake -C src -E "scav: anim.o edit.o x.o sound.o"
218 +}
219 +
220 +src_install() {
221 + newbin src/scav scavenger
222 + doman src/scavenger.6
223 +
224 + dodoc CREDITS DOC README TODO changelog
225 +
226 + insinto /usr/share/${PN}
227 + doins -r data/.
228 +
229 + make_desktop_entry scavenger XScavenger applications-games
230 +}