1 |
commit: cf9292efe21fc8c2dad1c80feadfb7bb3a4d25ce |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 7 11:55:55 2019 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 7 11:55:55 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf9292ef |
7 |
|
8 |
dev-libs/libf2c: Port to EAPI 7 |
9 |
|
10 |
Package-Manager: Portage-2.3.75, Repoman-2.3.17 |
11 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
12 |
|
13 |
.../libf2c/files/20051004-add-ofiles-dep.patch | 5 +- |
14 |
.../20090407-link-shared-libf2c-correctly.patch | 4 +- |
15 |
.../libf2c/files/libf2c-20110801-64bit-long.patch | 4 +- |
16 |
.../files/libf2c-20110801-format-security.patch | 4 +- |
17 |
.../files/libf2c-20130927-fix-buildsystem.patch | 65 ++++++++++++++++++++++ |
18 |
dev-libs/libf2c/libf2c-20130927-r1.ebuild | 55 ++++++++++++++++++ |
19 |
6 files changed, 128 insertions(+), 9 deletions(-) |
20 |
|
21 |
diff --git a/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch b/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch |
22 |
index 509726820ae..909fc19033d 100644 |
23 |
--- a/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch |
24 |
+++ b/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch |
25 |
@@ -1,6 +1,5 @@ |
26 |
-diff -urN libf2c.orig/makefile.u libf2c/makefile.u |
27 |
---- libf2c.orig/makefile.u 2006-05-13 15:41:29.000000000 -0700 |
28 |
-+++ libf2c/makefile.u 2006-05-13 15:42:04.000000000 -0700 |
29 |
+--- a/makefile.u |
30 |
++++ b/makefile.u |
31 |
@@ -69,7 +69,9 @@ |
32 |
OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ |
33 |
$(HALF) $(CMP) $(EFL) $(CHAR) $(I77) $(TIME) |
34 |
|
35 |
diff --git a/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch b/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch |
36 |
index d35e60bed0f..e22f0cf0bfb 100644 |
37 |
--- a/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch |
38 |
+++ b/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch |
39 |
@@ -1,5 +1,5 @@ |
40 |
---- makefile.u.orig 2008-07-07 23:27:41.000000000 -0700 |
41 |
-+++ makefile.u 2008-07-07 23:28:39.000000000 -0700 |
42 |
+--- a/makefile.u |
43 |
++++ b/makefile.u |
44 |
@@ -82,7 +82,7 @@ |
45 |
## of "cc -shared". |
46 |
|
47 |
|
48 |
diff --git a/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch b/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch |
49 |
index 85687c5a420..cc42465bb7c 100644 |
50 |
--- a/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch |
51 |
+++ b/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch |
52 |
@@ -1,5 +1,5 @@ |
53 |
---- libf2c2-20090411.orig/f2c.h0 |
54 |
-+++ libf2c2-20090411/f2c.h0 |
55 |
+--- a/f2c.h0 |
56 |
++++ b/f2c.h0 |
57 |
@@ -7,21 +7,35 @@ |
58 |
#ifndef F2C_INCLUDE |
59 |
#define F2C_INCLUDE |
60 |
|
61 |
diff --git a/dev-libs/libf2c/files/libf2c-20110801-format-security.patch b/dev-libs/libf2c/files/libf2c-20110801-format-security.patch |
62 |
index 669da2d694b..3caa80f787c 100644 |
63 |
--- a/dev-libs/libf2c/files/libf2c-20110801-format-security.patch |
64 |
+++ b/dev-libs/libf2c/files/libf2c-20110801-format-security.patch |
65 |
@@ -1,5 +1,5 @@ |
66 |
---- arithchk.c |
67 |
-+++ arithchk.c |
68 |
+--- a/arithchk.c |
69 |
++++ b/arithchk.c |
70 |
@@ -122,7 +122,7 @@ |
71 |
long Cray1; |
72 |
|
73 |
|
74 |
diff --git a/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch b/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch |
75 |
new file mode 100644 |
76 |
index 00000000000..d3de94b3838 |
77 |
--- /dev/null |
78 |
+++ b/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch |
79 |
@@ -0,0 +1,65 @@ |
80 |
+--- a/makefile.u |
81 |
++++ b/makefile.u |
82 |
+@@ -12,16 +12,12 @@ |
83 |
+ # -fPIC |
84 |
+ # to the CFLAGS = line below. |
85 |
+ |
86 |
+-.SUFFIXES: .c .o |
87 |
+-CC = cc |
88 |
+ SHELL = /bin/sh |
89 |
+-CFLAGS = -O |
90 |
+ |
91 |
+ # compile, then strip unnecessary symbols |
92 |
+ .c.o: |
93 |
+- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c |
94 |
+- ld -r -x -o $*.xxx $*.o |
95 |
+- mv $*.xxx $*.o |
96 |
++ $(CC) -c $(CPPFLAGS) $(CFLAGS) -DSkip_f2c_Undefs $< -o $@ |
97 |
++ |
98 |
+ ## Under Solaris (and other systems that do not understand ld -x), |
99 |
+ ## omit -x in the ld line above. |
100 |
+ ## If your system does not have the ld command, comment out |
101 |
+@@ -74,8 +70,8 @@ |
102 |
+ $(OFILES): f2c.h signal1.h sysdep1.h |
103 |
+ |
104 |
+ libf2c.a: $(OFILES) |
105 |
+- ar r libf2c.a $? |
106 |
+- -ranlib libf2c.a |
107 |
++ $(AR) r libf2c.a $? |
108 |
++ $(RANLIB) libf2c.a |
109 |
+ |
110 |
+ ## Shared-library variant: the following rule works on Linux |
111 |
+ ## systems. Details are system-dependent. Under Linux, -fPIC |
112 |
+@@ -92,12 +88,6 @@ |
113 |
+ |
114 |
+ ### If your system lacks ranlib, you don't need it; see README. |
115 |
+ |
116 |
+-f77vers.o: f77vers.c |
117 |
+- $(CC) -c f77vers.c |
118 |
+- |
119 |
+-i77vers.o: i77vers.c |
120 |
+- $(CC) -c i77vers.c |
121 |
+- |
122 |
+ # To get an "f2c.h" for use with "f2c -C++", first "make hadd" |
123 |
+ hadd: f2c.h0 f2ch.add |
124 |
+ cat f2c.h0 f2ch.add >f2c.h |
125 |
+@@ -125,7 +115,7 @@ |
126 |
+ |
127 |
+ install: libf2c.a |
128 |
+ cp libf2c.a $(LIBDIR) |
129 |
+- -ranlib $(LIBDIR)/libf2c.a |
130 |
++ $(RANLIB) $(LIBDIR)/libf2c.a |
131 |
+ |
132 |
+ clean: |
133 |
+ rm -f libf2c.a *.o arith.h signal1.h sysdep1.h |
134 |
+@@ -185,8 +175,8 @@ |
135 |
+ xwsne.o: fmt.h |
136 |
+ |
137 |
+ arith.h: arithchk.c |
138 |
+- $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ |
139 |
+- $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm |
140 |
++ $(CC) $(CPPFLAGS) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ |
141 |
++ $(CC) -DNO_LONG_LONG $(CPPFLAGS) $(CFLAGS) -DNO_FPINIT arithchk.c -lm |
142 |
+ ./a.out >arith.h |
143 |
+ rm -f a.out arithchk.o |
144 |
+ |
145 |
|
146 |
diff --git a/dev-libs/libf2c/libf2c-20130927-r1.ebuild b/dev-libs/libf2c/libf2c-20130927-r1.ebuild |
147 |
new file mode 100644 |
148 |
index 00000000000..52fc3a77199 |
149 |
--- /dev/null |
150 |
+++ b/dev-libs/libf2c/libf2c-20130927-r1.ebuild |
151 |
@@ -0,0 +1,55 @@ |
152 |
+# Copyright 1999-2019 Gentoo Authors |
153 |
+# Distributed under the terms of the GNU General Public License v2 |
154 |
+ |
155 |
+EAPI=7 |
156 |
+ |
157 |
+inherit flag-o-matic toolchain-funcs |
158 |
+ |
159 |
+DESCRIPTION="Library that converts FORTRAN to C source" |
160 |
+HOMEPAGE="http://www.netlib.org/f2c/" |
161 |
+SRC_URI="http://www.netlib.org/f2c/${PN}.zip -> ${P}.zip" |
162 |
+ |
163 |
+LICENSE="HPND" |
164 |
+SLOT="0" |
165 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
166 |
+IUSE="static-libs" |
167 |
+ |
168 |
+BDEPEND="app-arch/unzip" |
169 |
+ |
170 |
+S="${WORKDIR}" |
171 |
+ |
172 |
+PATCHES=( |
173 |
+ "${FILESDIR}"/20051004-add-ofiles-dep.patch |
174 |
+ "${FILESDIR}"/20090407-link-shared-libf2c-correctly.patch |
175 |
+ "${FILESDIR}"/${PN}-20110801-main.patch |
176 |
+ "${FILESDIR}"/${PN}-20110801-64bit-long.patch |
177 |
+ "${FILESDIR}"/${PN}-20110801-format-security.patch |
178 |
+ "${FILESDIR}"/${PN}-20130927-fix-buildsystem.patch |
179 |
+) |
180 |
+ |
181 |
+src_configure() { |
182 |
+ tc-export AR CC RANLIB |
183 |
+} |
184 |
+ |
185 |
+src_compile() { |
186 |
+ if use static-libs; then |
187 |
+ emake -f makefile.u all |
188 |
+ # Clean up files so we can recompile |
189 |
+ # with -fPIC for the shared lib |
190 |
+ rm -v *.o || die "clean failed" |
191 |
+ fi |
192 |
+ |
193 |
+ append-cflags -fPIC |
194 |
+ emake -f makefile.u libf2c.so |
195 |
+} |
196 |
+ |
197 |
+src_install () { |
198 |
+ doheader f2c.h |
199 |
+ |
200 |
+ dolib.so libf2c.so.2 |
201 |
+ dosym libf2c.so.2 /usr/$(get_libdir)/libf2c.so |
202 |
+ use static-libs && dolib.a libf2c.a |
203 |
+ |
204 |
+ einstalldocs |
205 |
+ dodoc Notice |
206 |
+} |