1 |
commit: ef79d60f32789b9751eed45844d76a5995eebbb0 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 16 20:59:30 2020 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 16 20:59:30 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef79d60f |
7 |
|
8 |
sci-chemistry/surf: Port to EAPI 7 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/731888 |
11 |
Closes: https://bugs.gentoo.org/742023 |
12 |
Package-Manager: Portage-3.0.7, Repoman-3.0.1 |
13 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
14 |
|
15 |
.../surf/files/surf-1.0-Wreturn-type.patch | 108 ++++++++++++++++++++ |
16 |
sci-chemistry/surf/files/surf-1.0-makefile.patch | 112 +++++++++++++++++++++ |
17 |
sci-chemistry/surf/surf-1.0.ebuild | 34 +++---- |
18 |
3 files changed, 232 insertions(+), 22 deletions(-) |
19 |
|
20 |
diff --git a/sci-chemistry/surf/files/surf-1.0-Wreturn-type.patch b/sci-chemistry/surf/files/surf-1.0-Wreturn-type.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..9ad6cf31593 |
23 |
--- /dev/null |
24 |
+++ b/sci-chemistry/surf/files/surf-1.0-Wreturn-type.patch |
25 |
@@ -0,0 +1,108 @@ |
26 |
+--- a/compute.c |
27 |
++++ b/compute.c |
28 |
+@@ -210,7 +210,7 @@ |
29 |
+ |
30 |
+ Current_atom = atom_id; |
31 |
+ |
32 |
+- if (!compute_neighbors(atom_id, &num_constraints)) return; |
33 |
++ if (!compute_neighbors(atom_id, &num_constraints)) return -1; |
34 |
+ |
35 |
+ compute_planes(atom_id, num_constraints,constraints); |
36 |
+ |
37 |
+@@ -597,7 +597,7 @@ |
38 |
+ */ |
39 |
+ if (all_verts_in_sphere(rvertices, rvertices_count, sq_radius)) |
40 |
+ { /* printf("atom_id %d all_in = TRUE \n", atom_id); */ |
41 |
+- return; |
42 |
++ return -1; |
43 |
+ } |
44 |
+ |
45 |
+ for(i = 0; i < rfaces_count; i++) /* for each face */ |
46 |
+@@ -647,7 +647,7 @@ |
47 |
+ if (DOTPROD3(diff, diff) < 1e-10) |
48 |
+ /* atom center lies in the feasible region, and so can be also |
49 |
+ taken to be the tes_origin - no more computations required */ |
50 |
+- return; |
51 |
++ return -1; |
52 |
+ |
53 |
+ /* try computing the tes_origin as the average of all int_pts */ |
54 |
+ VEC3_ZERO(temp_origin); count = 0; |
55 |
+--- a/tessel_concave.c |
56 |
++++ b/tessel_concave.c |
57 |
+@@ -178,7 +178,7 @@ |
58 |
+ if ((sq_side_len[0] < EPS) && |
59 |
+ (sq_side_len[1] < EPS) && |
60 |
+ (sq_side_len[2] < EPS)) |
61 |
+- { return; |
62 |
++ { return -1; |
63 |
+ } |
64 |
+ |
65 |
+ /* evaluate which side of the plane the points lie wrt the probe center */ |
66 |
+@@ -195,14 +195,14 @@ |
67 |
+ max_len = FMAX((FMAX(sq_side_len[0], sq_side_len[1])), sq_side_len[2]); |
68 |
+ max_side = (max_len==sq_side_len[0])?0:((max_len==sq_side_len[1])? 1 : 2); |
69 |
+ |
70 |
+- if (num_fine_points == 0) return; /* all points are on the wrong side */ |
71 |
++ if (num_fine_points == 0) return -1; /* all points are on the wrong side */ |
72 |
+ |
73 |
+ if (max_len <= Max_Tess_Len_Sq) |
74 |
+ { /* sufficiently small so display but first check to see whether it |
75 |
+ intersects the plane or not and if so, clip it accordingly */ |
76 |
+ if (num_fine_points == 3) |
77 |
+ { gen_tris(points[0], points[1], points[2]); |
78 |
+- return; |
79 |
++ return -1; |
80 |
+ } |
81 |
+ else if (num_fine_points == 1) /* two points are on the wrong side */ |
82 |
+ i = (itemp[0] == 1)? 0 : ((itemp[1] == 1)? 1: 2); |
83 |
+@@ -305,7 +305,7 @@ |
84 |
+ (sq_side_len[1] < EPS) && |
85 |
+ (sq_side_len[2] < EPS)) |
86 |
+ { |
87 |
+- return; |
88 |
++ return -1; |
89 |
+ } |
90 |
+ |
91 |
+ if (max_len > Max_Tess_Len_Sq) |
92 |
+--- a/tessel_convex.c |
93 |
++++ b/tessel_convex.c |
94 |
+@@ -74,7 +74,7 @@ |
95 |
+ atoms[atom_id].center[Y], atoms[atom_id].center[Z], atoms[atom_id].radius); |
96 |
+ fflush(stderr); |
97 |
+ free(sph_side); |
98 |
+- return; |
99 |
++ return -1; |
100 |
+ } |
101 |
+ |
102 |
+ |
103 |
+--- a/tessel_torus.c |
104 |
++++ b/tessel_torus.c |
105 |
+@@ -191,7 +191,7 @@ |
106 |
+ |
107 |
+ if (j > n) |
108 |
+ { printf("gen_torus(): Too many torus verts %d (limit %d)\n",j, n); |
109 |
+- return ; |
110 |
++ return -1; |
111 |
+ } |
112 |
+ old_j = j; |
113 |
+ |
114 |
+@@ -202,7 +202,7 @@ |
115 |
+ gen_linear_recurse(tor_pts[0][i],tor_pts[1][i],r[k],&j,fcenter,fradius,0); |
116 |
+ if (j > n) |
117 |
+ { printf("gen_torus(): Too many torus verts %d (limit %d)\n",j, n); |
118 |
+- return ; |
119 |
++ return -1; |
120 |
+ } |
121 |
+ |
122 |
+ for(m = 0; m < j-1; m++) |
123 |
+--- a/utils.c |
124 |
++++ b/utils.c |
125 |
+@@ -91,7 +91,7 @@ |
126 |
+ disc = radius*radius - DOTPROD3(EO, EO); |
127 |
+ if (FP_EQ_EPS(disc, 0, GP_EPS*GP_EPS)) |
128 |
+ { VEC3_ASN_OP(int_point, =, ray_pt); |
129 |
+- return; |
130 |
++ return -1; |
131 |
+ } |
132 |
+ |
133 |
+ one_by_sq_dir_mag = 1.0/DOTPROD3(ray_dir, ray_dir); |
134 |
|
135 |
diff --git a/sci-chemistry/surf/files/surf-1.0-makefile.patch b/sci-chemistry/surf/files/surf-1.0-makefile.patch |
136 |
new file mode 100644 |
137 |
index 00000000000..ae5177ffb50 |
138 |
--- /dev/null |
139 |
+++ b/sci-chemistry/surf/files/surf-1.0-makefile.patch |
140 |
@@ -0,0 +1,112 @@ |
141 |
+--- a/Makefile |
142 |
++++ b/Makefile |
143 |
+@@ -1,24 +1,19 @@ |
144 |
+ # Compilation flags |
145 |
+ #CC = cc |
146 |
+-CC = cc |
147 |
+-INCLUDE = -I. |
148 |
++CPPFLAGS += -I. |
149 |
+ #LINCLUDE = -lcurses -ltermcap -lm |
150 |
+-LINCLUDE = -lm |
151 |
+-OPT_CFLAGS = -O2 $(FLAGS) $(INCLUDE) |
152 |
+-#CFLAGS = -g $(FLAGS) $(INCLUDE) |
153 |
+-CFLAGS = -O2 $(FLAGS) $(INCLUDE) |
154 |
++LDLIBS = -lm |
155 |
+ |
156 |
+ # These are the user object files in the application |
157 |
+ SRCS = surf.c io.c compute.c dual.c utils.c lp.c chull.c tessel_cases.c \ |
158 |
+ tessel_patches.c tessel_convex.c tessel_concave.c tessel_torus.c |
159 |
+ |
160 |
+ # obj files for sequential execution |
161 |
+-OBJS = surf.o io.o compute.o dual.o utils.o lp.o chull.o tessel_cases.o \ |
162 |
++OBJS = io.o compute.o dual.o utils.o lp.o chull.o tessel_cases.o \ |
163 |
+ tessel_patches.o tessel_convex.o tessel_concave.o tessel_torus.o |
164 |
+ |
165 |
+ # make objects |
166 |
+-surf: $(OBJS) Makefile |
167 |
+- $(CC) $(CFLAGS) $(OBJS) -o surf $(LINCLUDE) |
168 |
++surf: $(OBJS) |
169 |
+ |
170 |
+ lint: |
171 |
+ lint $(INCLUDE) $(SRCS) |
172 |
+@@ -29,80 +24,3 @@ |
173 |
+ release: |
174 |
+ tar -cvf surf.tar README *.[hc] Makefile |
175 |
+ compress surf.tar |
176 |
+- |
177 |
+-.c.o: |
178 |
+- $(CC) $(CFLAGS) -c $*.c |
179 |
+- |
180 |
+- |
181 |
+-# make depend makes the proper include file dependencies. You _could_ run |
182 |
+-# it on a sun4, but there's a bug in the SunOS version of sed that causes |
183 |
+-# the all-important "cat makedep | sed -e 's/\.o/.d4o/p'" etc. line to |
184 |
+-# not print the results to the stdout (but to keep pumping it through the |
185 |
+-# edits. The 'p' flag effectively does nothing). To avoid this I have |
186 |
+-# replaced the 'p' flag by the 'w file' flag in sed. |
187 |
+- |
188 |
+-DEPEND = $(SRCS) |
189 |
+- |
190 |
+-depend: $(DEPEND) |
191 |
+- @ echo making dependencies... |
192 |
+- @ echo ' ' > makedep |
193 |
+- @ makedepend $(INCLUDE) -f makedep $(DEPEND) |
194 |
+- @ echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep |
195 |
+- @ echo '$$r makedep' >>eddep |
196 |
+- @ echo 'w' >>eddep |
197 |
+- @ cp Makefile Makefile.bak |
198 |
+- @ ed - Makefile < eddep |
199 |
+- @ rm eddep makedep |
200 |
+- @ echo ' ' >> Makefile |
201 |
+- @ echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile |
202 |
+- @ echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile |
203 |
+- @ echo '# see make depend above' >> Makefile |
204 |
+- @ echo 'done.' |
205 |
+- @ echo ' ' >> Makefile |
206 |
+- |
207 |
+-# DO NOT DELETE THIS LINE -- make depend depends on it. |
208 |
+- |
209 |
+- |
210 |
+-# DO NOT DELETE THIS LINE -- make depend depends on it. |
211 |
+- |
212 |
+-surf.o: surf.h /usr/include/stdio.h /usr/include/math.h /usr/include/stdlib.h |
213 |
+-surf.o: /usr/include/sgidefs.h /usr/include/string.h /usr/include/sys/time.h |
214 |
+-surf.o: linalg.h |
215 |
+-io.o: surf.h /usr/include/stdio.h /usr/include/math.h /usr/include/stdlib.h |
216 |
+-io.o: /usr/include/sgidefs.h /usr/include/string.h /usr/include/sys/time.h |
217 |
+-io.o: linalg.h |
218 |
+-compute.o: surf.h /usr/include/stdio.h /usr/include/math.h |
219 |
+-compute.o: /usr/include/stdlib.h /usr/include/sgidefs.h /usr/include/string.h |
220 |
+-compute.o: /usr/include/sys/time.h linalg.h chull.h dual.h |
221 |
+-dual.o: surf.h /usr/include/stdio.h /usr/include/math.h /usr/include/stdlib.h |
222 |
+-dual.o: /usr/include/sgidefs.h /usr/include/string.h /usr/include/sys/time.h |
223 |
+-dual.o: linalg.h dual.h chull.h |
224 |
+-utils.o: surf.h /usr/include/stdio.h /usr/include/math.h |
225 |
+-utils.o: /usr/include/stdlib.h /usr/include/sgidefs.h /usr/include/string.h |
226 |
+-utils.o: /usr/include/sys/time.h linalg.h |
227 |
+-lp.o: surf.h /usr/include/stdio.h /usr/include/math.h /usr/include/stdlib.h |
228 |
+-lp.o: /usr/include/sgidefs.h /usr/include/string.h /usr/include/sys/time.h |
229 |
+-lp.o: linalg.h |
230 |
+-chull.o: surf.h /usr/include/stdio.h /usr/include/math.h |
231 |
+-chull.o: /usr/include/stdlib.h /usr/include/sgidefs.h /usr/include/string.h |
232 |
+-chull.o: /usr/include/sys/time.h linalg.h chull.h |
233 |
+-tessel_cases.o: surf.h /usr/include/stdio.h /usr/include/math.h |
234 |
+-tessel_cases.o: /usr/include/stdlib.h /usr/include/sgidefs.h |
235 |
+-tessel_cases.o: /usr/include/string.h /usr/include/sys/time.h linalg.h dual.h |
236 |
+-tessel_patches.o: surf.h /usr/include/stdio.h /usr/include/math.h |
237 |
+-tessel_patches.o: /usr/include/stdlib.h /usr/include/sgidefs.h |
238 |
+-tessel_patches.o: /usr/include/string.h /usr/include/sys/time.h linalg.h |
239 |
+-tessel_convex.o: surf.h /usr/include/stdio.h /usr/include/math.h |
240 |
+-tessel_convex.o: /usr/include/stdlib.h /usr/include/sgidefs.h |
241 |
+-tessel_convex.o: /usr/include/string.h /usr/include/sys/time.h linalg.h |
242 |
+-tessel_concave.o: surf.h /usr/include/stdio.h /usr/include/math.h |
243 |
+-tessel_concave.o: /usr/include/stdlib.h /usr/include/sgidefs.h |
244 |
+-tessel_concave.o: /usr/include/string.h /usr/include/sys/time.h linalg.h |
245 |
+-tessel_torus.o: surf.h /usr/include/stdio.h /usr/include/math.h |
246 |
+-tessel_torus.o: /usr/include/stdlib.h /usr/include/sgidefs.h |
247 |
+-tessel_torus.o: /usr/include/string.h /usr/include/sys/time.h linalg.h |
248 |
+- |
249 |
+-# DEPENDENCIES MUST END AT END OF FILE |
250 |
+-# IF YOU PUT STUFF HERE IT WILL GO AWAY |
251 |
+-# see make depend above |
252 |
+- |
253 |
|
254 |
diff --git a/sci-chemistry/surf/surf-1.0.ebuild b/sci-chemistry/surf/surf-1.0.ebuild |
255 |
index 5b6ff83975f..16adc336a34 100644 |
256 |
--- a/sci-chemistry/surf/surf-1.0.ebuild |
257 |
+++ b/sci-chemistry/surf/surf-1.0.ebuild |
258 |
@@ -1,7 +1,7 @@ |
259 |
-# Copyright 1999-2017 Gentoo Foundation |
260 |
+# Copyright 1999-2020 Gentoo Authors |
261 |
# Distributed under the terms of the GNU General Public License v2 |
262 |
|
263 |
-EAPI="4" |
264 |
+EAPI=7 |
265 |
|
266 |
inherit toolchain-funcs |
267 |
|
268 |
@@ -12,31 +12,21 @@ SRC_URI="http://www.ks.uiuc.edu/Research/vmd/extsrcs/surf.tar.Z -> ${P}.tar.Z" |
269 |
LICENSE="SURF" |
270 |
SLOT="0" |
271 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos" |
272 |
-IUSE="" |
273 |
|
274 |
-DEPEND=" |
275 |
- !www-client/surf |
276 |
- sys-apps/ed |
277 |
- x11-misc/makedepend" |
278 |
-RDEPEND="" |
279 |
+RDEPEND="!www-client/surf" |
280 |
|
281 |
-S=${WORKDIR} |
282 |
+S="${WORKDIR}" |
283 |
|
284 |
-src_prepare() { |
285 |
- sed \ |
286 |
- -e 's:$(CC) $(CFLAGS) $(OBJS):$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS):g' \ |
287 |
- -i Makefile || die |
288 |
-} |
289 |
+PATCHES=( |
290 |
+ "${FILESDIR}"/${P}-makefile.patch |
291 |
+ "${FILESDIR}"/${P}-Wreturn-type.patch |
292 |
+) |
293 |
|
294 |
-src_compile() { |
295 |
- emake depend \ |
296 |
- && emake \ |
297 |
- CC="$(tc-getCC)" \ |
298 |
- OPT_CFLAGS="${CFLAGS} \$(INCLUDE)" \ |
299 |
- CFLAGS="${CFLAGS} \$(INCLUDE)" |
300 |
+src_configure() { |
301 |
+ tc-export CC |
302 |
} |
303 |
|
304 |
src_install() { |
305 |
- dobin ${PN} |
306 |
- dodoc README |
307 |
+ dobin surf |
308 |
+ einstalldocs |
309 |
} |