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@gmail.com>
This commit is contained in:
Alessandro Barbieri
2021-04-12 01:56:57 +02:00
parent fa49691bc1
commit 31ac6c64fb
2 changed files with 33 additions and 13 deletions

View File

@@ -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/.
}

View File

@@ -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