commit:     31ac6c64fbade82616b50751619a4916d1dded54
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sun Apr 11 23:56:57 2021 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sun Apr 11 23:56:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=31ac6c64

sci-libs/chaco: respect flags

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

 sci-libs/chaco/chaco-2.2.ebuild     | 20 +++++++-------------
 sci-libs/chaco/files/makefile.patch | 26 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/sci-libs/chaco/chaco-2.2.ebuild b/sci-libs/chaco/chaco-2.2.ebuild
index d4f784cf0..12c58a451 100644
--- a/sci-libs/chaco/chaco-2.2.ebuild
+++ b/sci-libs/chaco/chaco-2.2.ebuild
@@ -1,10 +1,8 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
 
-inherit flag-o-matic
-
 DESCRIPTION="Software for Partitioning Graphs"
 
HOMEPAGE="https://www3.cs.stonybrook.edu/~algorith/implement/chaco/implement.shtml";
 
SRC_URI="https://www3.cs.stonybrook.edu/~algorith/implement/${PN}/distrib/Chaco-${PV}.tar.gz";
@@ -12,21 +10,17 @@ 
SRC_URI="https://www3.cs.stonybrook.edu/~algorith/implement/${PN}/distrib/Chaco-
 LICENSE="LGPL-2.1"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-
+PATCHES=( "${FILESDIR}/makefile.patch" )
 S="${WORKDIR}/Chaco-${PV}"
 
-src_prepare() {
-       sed -i '/CC =/d' code/Makefile
-       sed -i '/CFLAGS =/d' code/Makefile
-       sed -i -e 's/-O2/${CFLAGS}/g' code/Makefile
-       eapply_user
-}
+#src_prepare() {
+#      eapply_user
+#}
 
 src_install() {
-       append-cflags -fPIE
-       cd code
+       pushd code
        emake
-       cd ..
+       popd
        dobin "exec/chaco"
        dodoc -r doc/.
 }

diff --git a/sci-libs/chaco/files/makefile.patch 
b/sci-libs/chaco/files/makefile.patch
new file mode 100644
index 000000000..32ab4b84c
--- /dev/null
+++ b/sci-libs/chaco/files/makefile.patch
@@ -0,0 +1,26 @@
+--- a/code/Makefile    2021-04-12 01:42:10.792372462 +0200
++++ b/code/Makefile    2021-04-12 01:46:20.332391138 +0200
+@@ -1,8 +1,6 @@
+ DEST_DIR =    ../exec
+ DEST=         ${DEST_DIR}/chaco
+-CC =          gcc
+ IFLAG =               -Imain
+-CFLAGS =      -O2
+ OFLAGS =      -O2
+ 
+ FILES.c=      main/user_params.c main/interface.c main/main.c \
+@@ -91,7 +89,7 @@
+ 
+ 
+ ${DEST}:      ${FILES.o} Makefile
+-              ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
++              ${CC} ${CFLAGS} -fPIE ${LDFLAGS} ${FILES.o} -lm -o ${DEST}
+ 
+ lint:
+               lint ${IFLAG} ${FILES.c} -lm
+@@ -103,4 +101,4 @@
+               rm -f */*.o ${DEST_DIR}/core
+ 
+ .c.o:
+-              ${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
++              ${CC} -c ${IFLAG} ${CFLAGS} -fPIC -o $*.o $*.c

Reply via email to