commit:     fa49691bc1b5a7cbf6adce592fd8889532ff44a6
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sun Apr 11 20:21:26 2021 +0000
Commit:     Theo Anderson <telans <AT> posteo <DOT> de>
CommitDate: Sun Apr 11 20:21:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fa49691b

sci-libs/meschach: respect flags, remove useless binaries

Closes: https://bugs.gentoo.org/781644
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 sci-libs/meschach/files/makefile.patch | 116 +++++++++++++++++++++++++++++++++
 sci-libs/meschach/meschach-1.2b.ebuild |  26 ++++----
 2 files changed, 129 insertions(+), 13 deletions(-)

diff --git a/sci-libs/meschach/files/makefile.patch 
b/sci-libs/meschach/files/makefile.patch
new file mode 100644
index 000000000..9c2fb918d
--- /dev/null
+++ b/sci-libs/meschach/files/makefile.patch
@@ -0,0 +1,116 @@
+--- a/makefile.in      2021-04-11 20:54:38.081969329 +0200
++++ b/makefile.in      2021-04-11 21:42:48.789853703 +0200
+@@ -18,8 +18,7 @@
+ LIBS = @LIBS@
+ RANLIB = @RANLIB@
+ 
+-
+-CFLAGS = -O3 -fPIC
++CFLAGS += -fPIC
+ 
+ 
+ .c.o:
+@@ -80,45 +79,45 @@
+ 
+ $(LIST1): $(HBASE)
+ part1: $(LIST1)
+-      ar ru libmeschach.a $(LIST1)
++      $(AR) ru libmeschach.a $(LIST1)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(LIST1)
+ 
+ $(LIST2): $(HBASE) matrix2.h
+ part2: $(LIST2)
+-      ar ru libmeschach.a $(LIST2)
++      $(AR) ru libmeschach.a $(LIST2)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(LIST2)
+ 
+ $(LIST3): $(HBASE) sparse.h sparse2.h
+ part3: $(LIST3)
+-      ar ru libmeschach.a $(LIST3)
++      $(AR) ru libmeschach.a $(LIST3)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(LIST3)
+ 
+ $(ZLIST1): $(HBASDE) zmatrix.h
+ zpart1: $(ZLIST1)
+-      ar ru libmeschach.a $(ZLIST1)
++      $(AR) ru libmeschach.a $(ZLIST1)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(ZLIST1)
+ 
+ $(ZLIST2): $(HBASE) zmatrix.h zmatrix2.h 
+ zpart2: $(ZLIST2)
+-      ar ru libmeschach.a $(ZLIST2)
++      $(AR) ru libmeschach.a $(ZLIST2)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(ZLIST2)
+ 
+ $(OLDLIST): $(HBASE) sparse.h sparse2.h 
+ oldpart: $(OLDLIST)
+-      ar ru libmeschach.a $(OLDLIST)
++      $(AR) ru libmeschach.a $(OLDLIST)
+       $(RANLIB) libmeschach.a
+ #     $(CC) -shared -o libmeschach.so $(OLDLIST)
+ 
+ shared:   $(ALL_LISTS)
+-      $(CC) -shared -o libmeschach.so $(ALL_LISTS) -lc -lm -Wl,-soname 
-Wl,libmeschach.so.$(vers)
++      $(CC) $(LDFLAGS) -shared -o libmeschach.so $(ALL_LISTS) -lc -lm 
-Wl,-soname -Wl,libmeschach.so.$(vers)
+ 
+ static:  $(ALL_LISTS)
+-      ar ru libmeschach.a $(ALL_LISTS)
++      $(AR) ru libmeschach.a $(ALL_LISTS)
+       $(RANLIB) libmeschach.a
+ 
+ 
+@@ -200,31 +199,31 @@
+ alltorture: torture sptort ztorture memtort itertort mfuntort iotort
+ 
+ torture:torture.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o torture torture.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o torture torture.o \
++      -lmeschach -L. $(LIBS)
+ sptort:sptort.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o sptort sptort.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o sptort sptort.o \
++      -lmeschach -L. $(LIBS)
+ memtort: memtort.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o memtort memtort.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o memtort memtort.o \
++      -lmeschach -L. $(LIBS)
+ ztorture:ztorture.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o ztorture ztorture.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o ztorture ztorture.o \
++      -lmeschach -L. $(LIBS)
+ itertort: itertort.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o itertort itertort.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o itertort itertort.o \
++      -lmeschach -L. $(LIBS)
+ 
+ iotort: iotort.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o iotort iotort.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o iotort iotort.o \
++      -lmeschach -L. $(LIBS)
+ mfuntort: mfuntort.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o mfuntort mfuntort.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o mfuntort mfuntort.o \
++      -lmeschach -L. $(LIBS)
+ tstmove: tstmove.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o tstmove tstmove.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o tstmove tstmove.o \
++      -lmeschach -L. $(LIBS)
+ tstpxvec: tstpxvec.o libmeschach.a
+-      $(CC) $(CFLAGS) $(DEFS) -o tstpxvec tstpxvec.o \
+-      libmeschach.a $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o tstpxvec tstpxvec.o \
++      -lmeschach -L. $(LIBS)
+ 

diff --git a/sci-libs/meschach/meschach-1.2b.ebuild 
b/sci-libs/meschach/meschach-1.2b.ebuild
index e03916d34..2f534ad10 100644
--- a/sci-libs/meschach/meschach-1.2b.ebuild
+++ b/sci-libs/meschach/meschach-1.2b.ebuild
@@ -1,18 +1,19 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
 
-inherit autotools eutils
+inherit autotools eutils toolchain-funcs
 
 MAJOR="$(ver_cut 1)"
 VERSION="$(ver_cut 1-2)"
 
-DESCRIPTION="Meschach is a C-language library of routines for performing 
matrix computations."
+DESCRIPTION="Meschach is a C-language library of routines for performing 
matrix computations"
 HOMEPAGE="http://homepage.divms.uiowa.edu/~dstewart/meschach";
-SRC_URI="http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}.orig.tar.gz
 \
-http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}-14.debian.tar.xz";
-
+SRC_URI="
+       
http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}.orig.tar.gz
+       
http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}-14.debian.tar.xz
+"
 LICENSE="meschach"
 SLOT="0"
 KEYWORDS="~amd64"
@@ -25,13 +26,14 @@ REQUIRED_USE="
 PATCHES=(
        "${WORKDIR}/debian/patches/${PN}_${PV}-13.diff"
        "${WORKDIR}/debian/patches/${PN}_${PV}-13.configure.diff"
+       "${FILESDIR}/makefile.patch"
 )
 
 src_prepare() {
        default
-       sed -i -- 's/CFLAGS = -O3 -fPIC/CFLAGS = @CFLAGS@ -fPIC/g' makefile.in
        use old && sed -i -- 's/all: shared static/all: oldpart shared 
static/g' makefile.in
-       mv configure.in configure.ac
+       mv configure.in configure.ac || die
+       export AR="$(tc-getAR)"
        eautoreconf
 }
 
@@ -49,13 +51,13 @@ src_configure() {
 }
 
 src_compile() {
-       emake vers="${VERSION}" DESTDIR="${D}" all
+       emake vers="${VERSION}" all
        emake alltorture
 }
 
 src_install() {
-       ln -s "lib${PN}.so" "lib${PN}.so.${MAJOR}"
-       ln -s "lib${PN}.so.${MAJOR}" "lib${PN}.so.${VERSION}"
+       ln -s "lib${PN}.so" "lib${PN}.so.${MAJOR}" || die
+       ln -s "lib${PN}.so.${MAJOR}" "lib${PN}.so.${VERSION}" || die
        dolib.so "lib${PN}.so"
        dolib.so "lib${PN}.so.${MAJOR}"
        dolib.so "lib${PN}.so.${VERSION}"
@@ -66,8 +68,6 @@ src_install() {
        exeinto "/usr/libexec/${PN}"
        doexe iotort
        doexe itertort
-       doexe macheps
-       doexe maxint
        doexe memtort
        doexe mfuntort
        doexe sptort

Reply via email to