diff options
author | David Seifert <soap@gentoo.org> | 2019-09-07 13:55:55 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2019-09-07 13:55:55 +0200 |
commit | cf9292efe21fc8c2dad1c80feadfb7bb3a4d25ce (patch) | |
tree | 8732cec766d3920b166ad2fe910f0ec90f401c78 /dev-libs/libf2c | |
parent | gui-libs/amtk: bump to 5.0.1 (diff) | |
download | gentoo-cf9292efe21fc8c2dad1c80feadfb7bb3a4d25ce.tar.gz gentoo-cf9292efe21fc8c2dad1c80feadfb7bb3a4d25ce.tar.bz2 gentoo-cf9292efe21fc8c2dad1c80feadfb7bb3a4d25ce.zip |
dev-libs/libf2c: Port to EAPI 7
Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'dev-libs/libf2c')
6 files changed, 128 insertions, 9 deletions
diff --git a/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch b/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch index 509726820ae5..909fc19033db 100644 --- a/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch +++ b/dev-libs/libf2c/files/20051004-add-ofiles-dep.patch @@ -1,6 +1,5 @@ -diff -urN libf2c.orig/makefile.u libf2c/makefile.u ---- libf2c.orig/makefile.u 2006-05-13 15:41:29.000000000 -0700 -+++ libf2c/makefile.u 2006-05-13 15:42:04.000000000 -0700 +--- a/makefile.u ++++ b/makefile.u @@ -69,7 +69,9 @@ OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(I77) $(TIME) diff --git a/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch b/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch index d35e60bed0ff..e22f0cf0bfb0 100644 --- a/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch +++ b/dev-libs/libf2c/files/20090407-link-shared-libf2c-correctly.patch @@ -1,5 +1,5 @@ ---- makefile.u.orig 2008-07-07 23:27:41.000000000 -0700 -+++ makefile.u 2008-07-07 23:28:39.000000000 -0700 +--- a/makefile.u ++++ b/makefile.u @@ -82,7 +82,7 @@ ## of "cc -shared". diff --git a/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch b/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch index 85687c5a4208..cc42465bb7ce 100644 --- a/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch +++ b/dev-libs/libf2c/files/libf2c-20110801-64bit-long.patch @@ -1,5 +1,5 @@ ---- libf2c2-20090411.orig/f2c.h0 -+++ libf2c2-20090411/f2c.h0 +--- a/f2c.h0 ++++ b/f2c.h0 @@ -7,21 +7,35 @@ #ifndef F2C_INCLUDE #define F2C_INCLUDE diff --git a/dev-libs/libf2c/files/libf2c-20110801-format-security.patch b/dev-libs/libf2c/files/libf2c-20110801-format-security.patch index 669da2d694b4..3caa80f787c4 100644 --- a/dev-libs/libf2c/files/libf2c-20110801-format-security.patch +++ b/dev-libs/libf2c/files/libf2c-20110801-format-security.patch @@ -1,5 +1,5 @@ ---- arithchk.c -+++ arithchk.c +--- a/arithchk.c ++++ b/arithchk.c @@ -122,7 +122,7 @@ long Cray1; diff --git a/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch b/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch new file mode 100644 index 000000000000..d3de94b38380 --- /dev/null +++ b/dev-libs/libf2c/files/libf2c-20130927-fix-buildsystem.patch @@ -0,0 +1,65 @@ +--- a/makefile.u ++++ b/makefile.u +@@ -12,16 +12,12 @@ + # -fPIC + # to the CFLAGS = line below. + +-.SUFFIXES: .c .o +-CC = cc + SHELL = /bin/sh +-CFLAGS = -O + + # compile, then strip unnecessary symbols + .c.o: +- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c +- ld -r -x -o $*.xxx $*.o +- mv $*.xxx $*.o ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) -DSkip_f2c_Undefs $< -o $@ ++ + ## Under Solaris (and other systems that do not understand ld -x), + ## omit -x in the ld line above. + ## If your system does not have the ld command, comment out +@@ -74,8 +70,8 @@ + $(OFILES): f2c.h signal1.h sysdep1.h + + libf2c.a: $(OFILES) +- ar r libf2c.a $? +- -ranlib libf2c.a ++ $(AR) r libf2c.a $? ++ $(RANLIB) libf2c.a + + ## Shared-library variant: the following rule works on Linux + ## systems. Details are system-dependent. Under Linux, -fPIC +@@ -92,12 +88,6 @@ + + ### If your system lacks ranlib, you don't need it; see README. + +-f77vers.o: f77vers.c +- $(CC) -c f77vers.c +- +-i77vers.o: i77vers.c +- $(CC) -c i77vers.c +- + # To get an "f2c.h" for use with "f2c -C++", first "make hadd" + hadd: f2c.h0 f2ch.add + cat f2c.h0 f2ch.add >f2c.h +@@ -125,7 +115,7 @@ + + install: libf2c.a + cp libf2c.a $(LIBDIR) +- -ranlib $(LIBDIR)/libf2c.a ++ $(RANLIB) $(LIBDIR)/libf2c.a + + clean: + rm -f libf2c.a *.o arith.h signal1.h sysdep1.h +@@ -185,8 +175,8 @@ + xwsne.o: fmt.h + + arith.h: arithchk.c +- $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ +- $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm ++ $(CC) $(CPPFLAGS) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ ++ $(CC) -DNO_LONG_LONG $(CPPFLAGS) $(CFLAGS) -DNO_FPINIT arithchk.c -lm + ./a.out >arith.h + rm -f a.out arithchk.o + diff --git a/dev-libs/libf2c/libf2c-20130927-r1.ebuild b/dev-libs/libf2c/libf2c-20130927-r1.ebuild new file mode 100644 index 000000000000..52fc3a771992 --- /dev/null +++ b/dev-libs/libf2c/libf2c-20130927-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="Library that converts FORTRAN to C source" +HOMEPAGE="http://www.netlib.org/f2c/" +SRC_URI="http://www.netlib.org/f2c/${PN}.zip -> ${P}.zip" + +LICENSE="HPND" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="static-libs" + +BDEPEND="app-arch/unzip" + +S="${WORKDIR}" + +PATCHES=( + "${FILESDIR}"/20051004-add-ofiles-dep.patch + "${FILESDIR}"/20090407-link-shared-libf2c-correctly.patch + "${FILESDIR}"/${PN}-20110801-main.patch + "${FILESDIR}"/${PN}-20110801-64bit-long.patch + "${FILESDIR}"/${PN}-20110801-format-security.patch + "${FILESDIR}"/${PN}-20130927-fix-buildsystem.patch +) + +src_configure() { + tc-export AR CC RANLIB +} + +src_compile() { + if use static-libs; then + emake -f makefile.u all + # Clean up files so we can recompile + # with -fPIC for the shared lib + rm -v *.o || die "clean failed" + fi + + append-cflags -fPIC + emake -f makefile.u libf2c.so +} + +src_install () { + doheader f2c.h + + dolib.so libf2c.so.2 + dosym libf2c.so.2 /usr/$(get_libdir)/libf2c.so + use static-libs && dolib.a libf2c.a + + einstalldocs + dodoc Notice +} |