aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Barbieri <lssndrbarbieri@gmail.com>2021-09-06 06:43:06 +0200
committerAlessandro Barbieri <lssndrbarbieri@gmail.com>2021-09-07 01:42:44 +0200
commit022dbdafac9085c90aac1fae080cba5accc70f13 (patch)
tree2d2c662c58a9d57b7200085ed3a96df588245193 /sci-mathematics
parentapp-doc/ford: new package (diff)
downloadguru-022dbdafac9085c90aac1fae080cba5accc70f13.tar.gz
guru-022dbdafac9085c90aac1fae080cba5accc70f13.tar.bz2
guru-022dbdafac9085c90aac1fae080cba5accc70f13.zip
sci-mathematics/chaco: mbdyn patch, build shared library
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/chaco/chaco-2.2-r1.ebuild (renamed from sci-mathematics/chaco/chaco-2.2.ebuild)15
-rw-r--r--sci-mathematics/chaco/files/chaco-2.2-lib.patch48
-rw-r--r--sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch32
-rw-r--r--sci-mathematics/chaco/files/chaco-2.2-shared.patch22
-rw-r--r--sci-mathematics/chaco/files/makefile.patch26
5 files changed, 114 insertions, 29 deletions
diff --git a/sci-mathematics/chaco/chaco-2.2.ebuild b/sci-mathematics/chaco/chaco-2.2-r1.ebuild
index f7d0a7d15..499b1253a 100644
--- a/sci-mathematics/chaco/chaco-2.2.ebuild
+++ b/sci-mathematics/chaco/chaco-2.2-r1.ebuild
@@ -8,12 +8,16 @@ inherit toolchain-funcs
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"
+S="${WORKDIR}/Chaco-${PV}"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-PATCHES=( "${FILESDIR}/makefile.patch" )
-S="${WORKDIR}/Chaco-${PV}"
+PATCHES=(
+ "${FILESDIR}/${P}-lib.patch"
+ "${FILESDIR}/${P}-respect-flags.patch"
+ "${FILESDIR}/${P}-shared.patch"
+)
src_compile() {
cd code || die
@@ -22,6 +26,11 @@ src_compile() {
}
src_install() {
- dobin "exec/chaco"
dodoc -r doc/.
+ dodoc -r "code/matlab"
+ cd "exec" || die
+ dobin "chaco"
+ dolib.so "libchaco.so"
+ dodoc *.coords *.graph "User_Params"
+ newdoc README README_exec
}
diff --git a/sci-mathematics/chaco/files/chaco-2.2-lib.patch b/sci-mathematics/chaco/files/chaco-2.2-lib.patch
new file mode 100644
index 000000000..3d05ced52
--- /dev/null
+++ b/sci-mathematics/chaco/files/chaco-2.2-lib.patch
@@ -0,0 +1,48 @@
+Patch provided by Walter Landry <wlandry at ucsd.edu>
+for use within MBDyn
+
+--- a/code/Makefile
++++ b/code/Makefile
+@@ -5,7 +5,9 @@
+ CFLAGS = -O2
+ OFLAGS = -O2
+
+-FILES.c= main/user_params.c main/interface.c main/main.c \
++main_file= main/main.c
++
++libFILES.c= main/user_params.c main/interface.c \
+ submain/balance.c submain/divide.c submain/submain.c \
+ input/input_assign.c \
+ input/check_input.c input/input.c input/input_geom.c \
+@@ -87,11 +89,20 @@
+ util/update.c util/vecout.c util/vecran.c \
+ util/vecscale.c
+
++FILES.c= $(libFILES.c) $(main_file)
++
+ FILES.o= $(FILES.c:.c=.o)
+
++libFILES.o= $(libFILES.c:.c=.o)
++
++all: ${DEST} ${DEST_DIR}/libchaco.a
+
+ ${DEST}: ${FILES.o} Makefile
+ ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
++
++${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
++ ar r ${DEST_DIR}/libchaco.a ${libFILES.o}
++ ranlib ${DEST_DIR}/libchaco.a
+
+ lint:
+ lint ${IFLAG} ${FILES.c} -lm
+--- a/code/main/user_params.c
++++ b/code/main/user_params.c
+@@ -98,7 +98,7 @@
+ long RANDOM_SEED = 7654321L; /* Seed for random number generator */
+ int NSQRTS = 1000; /* # square roots to precompute if coarsening */
+ int MAKE_VWGTS = FALSE; /* Make vtx weights degrees+1? (TRUE/FALSE) */
+-int FREE_GRAPH = TRUE; /* Free input graph data? (TRUE/FALSE) */
++int FREE_GRAPH = FALSE; /* Free input graph data? (TRUE/FALSE) */
+ char *PARAMS_FILENAME = "User_Params"; /* File of parameter changes */
+
+
diff --git a/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch b/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch
new file mode 100644
index 000000000..94d0be979
--- /dev/null
+++ b/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch
@@ -0,0 +1,32 @@
+--- a/code/Makefile
++++ b/code/Makefile
+@@ -1,8 +1,6 @@
+ DEST_DIR = ../exec
+ DEST= ${DEST_DIR}/chaco
+-CC = gcc
+ IFLAG = -Imain
+-CFLAGS = -O2
+ OFLAGS = -O2
+
+ main_file= main/main.c
+@@ -98,11 +96,11 @@
+ all: ${DEST} ${DEST_DIR}/libchaco.a
+
+ ${DEST}: ${FILES.o} Makefile
+- ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
++ ${CC} ${CFLAGS} ${LDFLAGS} -fPIE ${FILES.o} -lm -o ${DEST}
+
+ ${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
+- ar r ${DEST_DIR}/libchaco.a ${libFILES.o}
+- ranlib ${DEST_DIR}/libchaco.a
++ ${AR} r ${DEST_DIR}/libchaco.a ${libFILES.o}
++ ${RANLIB} ${DEST_DIR}/libchaco.a
+
+ lint:
+ lint ${IFLAG} ${FILES.c} -lm
+@@ -114,4 +112,4 @@
+ rm -f */*.o ${DEST_DIR}/core
+
+ .c.o:
+- ${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
++ ${CC} -c ${IFLAG} ${CFLAGS} -fPIC -o $*.o $*.c
diff --git a/sci-mathematics/chaco/files/chaco-2.2-shared.patch b/sci-mathematics/chaco/files/chaco-2.2-shared.patch
new file mode 100644
index 000000000..3102ca735
--- /dev/null
+++ b/sci-mathematics/chaco/files/chaco-2.2-shared.patch
@@ -0,0 +1,22 @@
+--- a/code/Makefile
++++ b/code/Makefile
+@@ -93,14 +93,13 @@
+
+ libFILES.o= $(libFILES.c:.c=.o)
+
+-all: ${DEST} ${DEST_DIR}/libchaco.a
++all: ${DEST} ${DEST_DIR}/libchaco.so
+
+-${DEST}: ${FILES.o} Makefile
+- ${CC} ${CFLAGS} ${LDFLAGS} -fPIE ${FILES.o} -lm -o ${DEST}
++${DEST}: ${DEST_DIR}/libchaco.so Makefile
++ ${CC} ${CFLAGS} ${LDFLAGS} -fPIE $(main_file) -lm -L${DEST_DIR} -lchaco -o ${DEST}
+
+-${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
+- ${AR} r ${DEST_DIR}/libchaco.a ${libFILES.o}
+- ${RANLIB} ${DEST_DIR}/libchaco.a
++${DEST_DIR}/libchaco.so: ${libFILES.o} Makefile
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-soname,libchaco.so -o ${DEST_DIR}/libchaco.so $(libFILES.o) -lm
+
+ lint:
+ lint ${IFLAG} ${FILES.c} -lm
diff --git a/sci-mathematics/chaco/files/makefile.patch b/sci-mathematics/chaco/files/makefile.patch
deleted file mode 100644
index 32ab4b84c..000000000
--- a/sci-mathematics/chaco/files/makefile.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- 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