1 |
commit: 449d7802c1c41097291ff82f28518ae7afffec3e |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 14 22:07:00 2021 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 14 22:55:16 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=449d7802 |
7 |
|
8 |
games-util/ucon64: add 2.2.1 |
9 |
|
10 |
- add IUSE debug, usb, zlib |
11 |
- set default discmage.so path not to need user intervention |
12 |
- shorter elog given ucon64's output already mentions .ucon64/dat |
13 |
- use fixes suggested by upstream in bug #753950 |
14 |
|
15 |
Closes: https://bugs.gentoo.org/753950 |
16 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
17 |
|
18 |
games-util/ucon64/Manifest | 1 + |
19 |
.../files/ucon64-2.2.1-change-mem2-64bit.patch | 23 ++++++++ |
20 |
.../ucon64/files/ucon64-2.2.1-respect-flags.patch | 35 ++++++++++++ |
21 |
games-util/ucon64/files/ucon64-2.2.1-zlib.patch | 26 +++++++++ |
22 |
games-util/ucon64/ucon64-2.2.1.ebuild | 65 ++++++++++++++++++++++ |
23 |
5 files changed, 150 insertions(+) |
24 |
|
25 |
diff --git a/games-util/ucon64/Manifest b/games-util/ucon64/Manifest |
26 |
index f98924b25a0..2ead28e44b3 100644 |
27 |
--- a/games-util/ucon64/Manifest |
28 |
+++ b/games-util/ucon64/Manifest |
29 |
@@ -1 +1,2 @@ |
30 |
DIST ucon64-2.0.0-src.tar.gz 1188488 BLAKE2B 846ea6142eb50abc8165c9abb3cc05245f891b78d786798758e393032cc59c1f3cccc0fe0e70e256e308f709870bc1cc2754df30a8fababea30eda84fd1b2b64 SHA512 d021fe6db9530405773e1e209bdfafe41a2bd997f275ca7fb387f9b3d8639f4581c2761cbdce859a1831d6eba9dab4d5df1019605698c6cb6a4695ab091b001c |
31 |
+DIST ucon64-2.2.1-src.tar.gz 1476080 BLAKE2B 8f7010bde2c7306f6a76dec4ce5e31975c286801e6504bf8bc99287bd7adc4ab10331a8cab308fed83ece9e13bdb01327f6d3439eba776038dbb19eb2b72cf70 SHA512 34453399151e5ed256fdcf387b9d32a052718b264e51b99a2be251b90589337d13cd317f8d1aa7d3c8e39c8e407b22797d4608ec6d14b99c8673ec74f349f6c2 |
32 |
|
33 |
diff --git a/games-util/ucon64/files/ucon64-2.2.1-change-mem2-64bit.patch b/games-util/ucon64/files/ucon64-2.2.1-change-mem2-64bit.patch |
34 |
new file mode 100644 |
35 |
index 00000000000..d07a18fdd8f |
36 |
--- /dev/null |
37 |
+++ b/games-util/ucon64/files/ucon64-2.2.1-change-mem2-64bit.patch |
38 |
@@ -0,0 +1,23 @@ |
39 |
+Fix crash on 64bit platforms in change_mem2() |
40 |
+https://bugs.gentoo.org/753950 |
41 |
+ |
42 |
+From upstream: |
43 |
+https://sourceforge.net/p/ucon64/svn/2821/ |
44 |
+--- a/libdiscmage/misc.c |
45 |
++++ b/libdiscmage/misc.c |
46 |
+@@ -1875,5 +1875,5 @@ |
47 |
+ if (strpos == pos_1st_esc) |
48 |
+ setindex = 0; // reset argument pointer |
49 |
+- if (pos_1st_esc == (unsigned int) -1) |
50 |
++ if (pos_1st_esc == (size_t) -1) |
51 |
+ pos_1st_esc = strpos; |
52 |
+ |
53 |
+--- a/misc/misc.c |
54 |
++++ b/misc/misc.c |
55 |
+@@ -502,5 +502,5 @@ |
56 |
+ if (strpos == pos_1st_esc) |
57 |
+ setindex = 0; // reset argument pointer |
58 |
+- if (pos_1st_esc == (unsigned int) -1) |
59 |
++ if (pos_1st_esc == (size_t) -1) |
60 |
+ pos_1st_esc = strpos; |
61 |
+ |
62 |
|
63 |
diff --git a/games-util/ucon64/files/ucon64-2.2.1-respect-flags.patch b/games-util/ucon64/files/ucon64-2.2.1-respect-flags.patch |
64 |
new file mode 100644 |
65 |
index 00000000000..c1c9ed6f78d |
66 |
--- /dev/null |
67 |
+++ b/games-util/ucon64/files/ucon64-2.2.1-respect-flags.patch |
68 |
@@ -0,0 +1,35 @@ |
69 |
+Respect *FLAGS and toolchain variables in Makefiles where missing. |
70 |
+--- a/Makefile |
71 |
++++ b/Makefile |
72 |
+@@ -12,3 +12,3 @@ |
73 |
+ CFLAGS+=-I. -Wall -W -Wno-implicit-fallthrough -Wno-format-truncation \ |
74 |
+--Wno-stringop-overflow -O3 -fsigned-char |
75 |
++-Wno-stringop-overflow -fsigned-char |
76 |
+ # Enable -Wstringop-overflow[=type] when it is no longer a broken, partial |
77 |
+@@ -19,3 +19,2 @@ |
78 |
+ # ld: warning: option -s is obsolete and being ignored |
79 |
+-LDFLAGS+=-s |
80 |
+ endif |
81 |
+--- a/backup/libcd64/Makefile |
82 |
++++ b/backup/libcd64/Makefile |
83 |
+@@ -1,2 +1 @@ |
84 |
+-CC=gcc |
85 |
+ |
86 |
+@@ -7,3 +6,2 @@ |
87 |
+ else |
88 |
+-CFLAGS+=-O6 -funroll-loops -fexpensive-optimizations |
89 |
+ endif |
90 |
+@@ -181,4 +179,4 @@ |
91 |
+ else |
92 |
+- ld -r $^ $(LIBS) -o $*.o |
93 |
+- ar crs $@ $*.o |
94 |
++ $(LD) -r $^ $(LIBS) -o $*.o |
95 |
++ $(AR) crs $@ $*.o |
96 |
+ endif |
97 |
+--- a/libdiscmage/Makefile.in |
98 |
++++ b/libdiscmage/Makefile.in |
99 |
+@@ -33,3 +33,2 @@ |
100 |
+ # /usr/bin/libtool: -static not specified, -s invalid |
101 |
+-LDFLAGS+=-s |
102 |
+ endif |
103 |
+ |
104 |
|
105 |
diff --git a/games-util/ucon64/files/ucon64-2.2.1-zlib.patch b/games-util/ucon64/files/ucon64-2.2.1-zlib.patch |
106 |
new file mode 100644 |
107 |
index 00000000000..a618c3bce75 |
108 |
--- /dev/null |
109 |
+++ b/games-util/ucon64/files/ucon64-2.2.1-zlib.patch |
110 |
@@ -0,0 +1,26 @@ |
111 |
+Fix undefined macro issue when compiling with zlib. |
112 |
+https://bugs.gentoo.org/753950 |
113 |
+ |
114 |
+From upstream: |
115 |
+https://sourceforge.net/p/ucon64/svn/2817/ |
116 |
+https://sourceforge.net/p/ucon64/svn/2819/ |
117 |
+--- a/libdiscmage/ioapi.h |
118 |
++++ b/libdiscmage/ioapi.h |
119 |
+@@ -35,4 +35,7 @@ |
120 |
+ extern "C" { |
121 |
+ #endif |
122 |
++#ifndef OF |
123 |
++#define OF(x) x |
124 |
++#endif |
125 |
+ |
126 |
+ typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); |
127 |
+--- a/misc/ioapi.h |
128 |
++++ b/misc/ioapi.h |
129 |
+@@ -35,4 +35,7 @@ |
130 |
+ extern "C" { |
131 |
+ #endif |
132 |
++#ifndef OF |
133 |
++#define OF(x) x |
134 |
++#endif |
135 |
+ |
136 |
+ typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); |
137 |
|
138 |
diff --git a/games-util/ucon64/ucon64-2.2.1.ebuild b/games-util/ucon64/ucon64-2.2.1.ebuild |
139 |
new file mode 100644 |
140 |
index 00000000000..13ebde02c0b |
141 |
--- /dev/null |
142 |
+++ b/games-util/ucon64/ucon64-2.2.1.ebuild |
143 |
@@ -0,0 +1,65 @@ |
144 |
+# Copyright 1999-2021 Gentoo Authors |
145 |
+# Distributed under the terms of the GNU General Public License v2 |
146 |
+ |
147 |
+EAPI=7 |
148 |
+ |
149 |
+inherit toolchain-funcs |
150 |
+ |
151 |
+DESCRIPTION="The backup tool and wonderful emulator's Swiss Army knife program" |
152 |
+HOMEPAGE="http://ucon64.sourceforge.net/" |
153 |
+SRC_URI="mirror://sourceforge/ucon64/${P}-src.tar.gz" |
154 |
+S="${WORKDIR}/${P}-src/src" |
155 |
+ |
156 |
+LICENSE="LGPL-2.1+ GPL-2+" |
157 |
+SLOT="0" |
158 |
+KEYWORDS="~amd64 ~x86" |
159 |
+IUSE="debug usb zlib" |
160 |
+ |
161 |
+RDEPEND=" |
162 |
+ usb? ( virtual/libusb:0 ) |
163 |
+ zlib? ( sys-libs/zlib:= )" |
164 |
+DEPEND="${RDEPEND}" |
165 |
+ |
166 |
+PATCHES=( |
167 |
+ "${FILESDIR}"/${P}-change-mem2-64bit.patch |
168 |
+ "${FILESDIR}"/${P}-respect-flags.patch |
169 |
+ "${FILESDIR}"/${P}-zlib.patch |
170 |
+) |
171 |
+ |
172 |
+src_prepare() { |
173 |
+ default |
174 |
+ |
175 |
+ sed "/discmage.so/s|.* \"|\"${EPREFIX}/usr/$(get_libdir)/${PN}/|" \ |
176 |
+ -i ucon64_misc.c || die |
177 |
+} |
178 |
+ |
179 |
+src_configure() { |
180 |
+ local econfargs=( |
181 |
+ $(use_enable debug) |
182 |
+ $(use_with usb libusb) |
183 |
+ $(use_with zlib) |
184 |
+ --enable-ppdev |
185 |
+ --with-libcd64 |
186 |
+ --with-libdiscmage |
187 |
+ ) |
188 |
+ econf "${econfargs[@]}" |
189 |
+ |
190 |
+ tc-export AR CC LD # for libcd64 with respect-flags.patch |
191 |
+} |
192 |
+ |
193 |
+src_install() { |
194 |
+ dobin ucon64 |
195 |
+ |
196 |
+ exeinto /usr/$(get_libdir)/${PN} |
197 |
+ doexe libdiscmage/discmage.so |
198 |
+ |
199 |
+ docinto html |
200 |
+ dodoc -r ../images ../{changes,developers,faq,hardware,readme}.html |
201 |
+} |
202 |
+ |
203 |
+pkg_postinst() { |
204 |
+ if [[ ! ${REPLACING_VERSIONS} ]]; then |
205 |
+ elog "Be sure to check ~/.ucon64rc for some options after" |
206 |
+ elog "you've run uCON64 for the first time." |
207 |
+ fi |
208 |
+} |