Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sci-mathematics/chaco/files/, sci-mathematics/chaco/
Date: Mon, 06 Sep 2021 23:42:50
Message-Id: 1630971764.022dbdafac9085c90aac1fae080cba5accc70f13.Alessandro-Barbieri@gentoo
1 commit: 022dbdafac9085c90aac1fae080cba5accc70f13
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 6 04:43:06 2021 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Mon Sep 6 23:42:44 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=022dbdaf
7
8 sci-mathematics/chaco: mbdyn patch, build shared library
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 .../{chaco-2.2.ebuild => chaco-2.2-r1.ebuild} | 15 +++++--
13 sci-mathematics/chaco/files/chaco-2.2-lib.patch | 48 ++++++++++++++++++++++
14 .../chaco/files/chaco-2.2-respect-flags.patch | 32 +++++++++++++++
15 sci-mathematics/chaco/files/chaco-2.2-shared.patch | 22 ++++++++++
16 sci-mathematics/chaco/files/makefile.patch | 26 ------------
17 5 files changed, 114 insertions(+), 29 deletions(-)
18
19 diff --git a/sci-mathematics/chaco/chaco-2.2.ebuild b/sci-mathematics/chaco/chaco-2.2-r1.ebuild
20 similarity index 67%
21 rename from sci-mathematics/chaco/chaco-2.2.ebuild
22 rename to sci-mathematics/chaco/chaco-2.2-r1.ebuild
23 index f7d0a7d15..499b1253a 100644
24 --- a/sci-mathematics/chaco/chaco-2.2.ebuild
25 +++ b/sci-mathematics/chaco/chaco-2.2-r1.ebuild
26 @@ -8,12 +8,16 @@ inherit toolchain-funcs
27 DESCRIPTION="Software for Partitioning Graphs"
28 HOMEPAGE="https://www3.cs.stonybrook.edu/~algorith/implement/chaco/implement.shtml"
29 SRC_URI="https://www3.cs.stonybrook.edu/~algorith/implement/${PN}/distrib/Chaco-${PV}.tar.gz"
30 +S="${WORKDIR}/Chaco-${PV}"
31
32 LICENSE="LGPL-2.1"
33 SLOT="0"
34 KEYWORDS="~amd64 ~x86"
35 -PATCHES=( "${FILESDIR}/makefile.patch" )
36 -S="${WORKDIR}/Chaco-${PV}"
37 +PATCHES=(
38 + "${FILESDIR}/${P}-lib.patch"
39 + "${FILESDIR}/${P}-respect-flags.patch"
40 + "${FILESDIR}/${P}-shared.patch"
41 +)
42
43 src_compile() {
44 cd code || die
45 @@ -22,6 +26,11 @@ src_compile() {
46 }
47
48 src_install() {
49 - dobin "exec/chaco"
50 dodoc -r doc/.
51 + dodoc -r "code/matlab"
52 + cd "exec" || die
53 + dobin "chaco"
54 + dolib.so "libchaco.so"
55 + dodoc *.coords *.graph "User_Params"
56 + newdoc README README_exec
57 }
58
59 diff --git a/sci-mathematics/chaco/files/chaco-2.2-lib.patch b/sci-mathematics/chaco/files/chaco-2.2-lib.patch
60 new file mode 100644
61 index 000000000..3d05ced52
62 --- /dev/null
63 +++ b/sci-mathematics/chaco/files/chaco-2.2-lib.patch
64 @@ -0,0 +1,48 @@
65 +Patch provided by Walter Landry <wlandry at ucsd.edu>
66 +for use within MBDyn
67 +
68 +--- a/code/Makefile
69 ++++ b/code/Makefile
70 +@@ -5,7 +5,9 @@
71 + CFLAGS = -O2
72 + OFLAGS = -O2
73 +
74 +-FILES.c= main/user_params.c main/interface.c main/main.c \
75 ++main_file= main/main.c
76 ++
77 ++libFILES.c= main/user_params.c main/interface.c \
78 + submain/balance.c submain/divide.c submain/submain.c \
79 + input/input_assign.c \
80 + input/check_input.c input/input.c input/input_geom.c \
81 +@@ -87,11 +89,20 @@
82 + util/update.c util/vecout.c util/vecran.c \
83 + util/vecscale.c
84 +
85 ++FILES.c= $(libFILES.c) $(main_file)
86 ++
87 + FILES.o= $(FILES.c:.c=.o)
88 +
89 ++libFILES.o= $(libFILES.c:.c=.o)
90 ++
91 ++all: ${DEST} ${DEST_DIR}/libchaco.a
92 +
93 + ${DEST}: ${FILES.o} Makefile
94 + ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
95 ++
96 ++${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
97 ++ ar r ${DEST_DIR}/libchaco.a ${libFILES.o}
98 ++ ranlib ${DEST_DIR}/libchaco.a
99 +
100 + lint:
101 + lint ${IFLAG} ${FILES.c} -lm
102 +--- a/code/main/user_params.c
103 ++++ b/code/main/user_params.c
104 +@@ -98,7 +98,7 @@
105 + long RANDOM_SEED = 7654321L; /* Seed for random number generator */
106 + int NSQRTS = 1000; /* # square roots to precompute if coarsening */
107 + int MAKE_VWGTS = FALSE; /* Make vtx weights degrees+1? (TRUE/FALSE) */
108 +-int FREE_GRAPH = TRUE; /* Free input graph data? (TRUE/FALSE) */
109 ++int FREE_GRAPH = FALSE; /* Free input graph data? (TRUE/FALSE) */
110 + char *PARAMS_FILENAME = "User_Params"; /* File of parameter changes */
111 +
112 +
113
114 diff --git a/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch b/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch
115 new file mode 100644
116 index 000000000..94d0be979
117 --- /dev/null
118 +++ b/sci-mathematics/chaco/files/chaco-2.2-respect-flags.patch
119 @@ -0,0 +1,32 @@
120 +--- a/code/Makefile
121 ++++ b/code/Makefile
122 +@@ -1,8 +1,6 @@
123 + DEST_DIR = ../exec
124 + DEST= ${DEST_DIR}/chaco
125 +-CC = gcc
126 + IFLAG = -Imain
127 +-CFLAGS = -O2
128 + OFLAGS = -O2
129 +
130 + main_file= main/main.c
131 +@@ -98,11 +96,11 @@
132 + all: ${DEST} ${DEST_DIR}/libchaco.a
133 +
134 + ${DEST}: ${FILES.o} Makefile
135 +- ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
136 ++ ${CC} ${CFLAGS} ${LDFLAGS} -fPIE ${FILES.o} -lm -o ${DEST}
137 +
138 + ${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
139 +- ar r ${DEST_DIR}/libchaco.a ${libFILES.o}
140 +- ranlib ${DEST_DIR}/libchaco.a
141 ++ ${AR} r ${DEST_DIR}/libchaco.a ${libFILES.o}
142 ++ ${RANLIB} ${DEST_DIR}/libchaco.a
143 +
144 + lint:
145 + lint ${IFLAG} ${FILES.c} -lm
146 +@@ -114,4 +112,4 @@
147 + rm -f */*.o ${DEST_DIR}/core
148 +
149 + .c.o:
150 +- ${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
151 ++ ${CC} -c ${IFLAG} ${CFLAGS} -fPIC -o $*.o $*.c
152
153 diff --git a/sci-mathematics/chaco/files/chaco-2.2-shared.patch b/sci-mathematics/chaco/files/chaco-2.2-shared.patch
154 new file mode 100644
155 index 000000000..3102ca735
156 --- /dev/null
157 +++ b/sci-mathematics/chaco/files/chaco-2.2-shared.patch
158 @@ -0,0 +1,22 @@
159 +--- a/code/Makefile
160 ++++ b/code/Makefile
161 +@@ -93,14 +93,13 @@
162 +
163 + libFILES.o= $(libFILES.c:.c=.o)
164 +
165 +-all: ${DEST} ${DEST_DIR}/libchaco.a
166 ++all: ${DEST} ${DEST_DIR}/libchaco.so
167 +
168 +-${DEST}: ${FILES.o} Makefile
169 +- ${CC} ${CFLAGS} ${LDFLAGS} -fPIE ${FILES.o} -lm -o ${DEST}
170 ++${DEST}: ${DEST_DIR}/libchaco.so Makefile
171 ++ ${CC} ${CFLAGS} ${LDFLAGS} -fPIE $(main_file) -lm -L${DEST_DIR} -lchaco -o ${DEST}
172 +
173 +-${DEST_DIR}/libchaco.a: ${libFILES.o} Makefile
174 +- ${AR} r ${DEST_DIR}/libchaco.a ${libFILES.o}
175 +- ${RANLIB} ${DEST_DIR}/libchaco.a
176 ++${DEST_DIR}/libchaco.so: ${libFILES.o} Makefile
177 ++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-soname,libchaco.so -o ${DEST_DIR}/libchaco.so $(libFILES.o) -lm
178 +
179 + lint:
180 + lint ${IFLAG} ${FILES.c} -lm
181
182 diff --git a/sci-mathematics/chaco/files/makefile.patch b/sci-mathematics/chaco/files/makefile.patch
183 deleted file mode 100644
184 index 32ab4b84c..000000000
185 --- a/sci-mathematics/chaco/files/makefile.patch
186 +++ /dev/null
187 @@ -1,26 +0,0 @@
188 ---- a/code/Makefile 2021-04-12 01:42:10.792372462 +0200
189 -+++ b/code/Makefile 2021-04-12 01:46:20.332391138 +0200
190 -@@ -1,8 +1,6 @@
191 - DEST_DIR = ../exec
192 - DEST= ${DEST_DIR}/chaco
193 --CC = gcc
194 - IFLAG = -Imain
195 --CFLAGS = -O2
196 - OFLAGS = -O2
197 -
198 - FILES.c= main/user_params.c main/interface.c main/main.c \
199 -@@ -91,7 +89,7 @@
200 -
201 -
202 - ${DEST}: ${FILES.o} Makefile
203 -- ${CC} ${OFLAGS} ${FILES.o} -lm -o ${DEST}
204 -+ ${CC} ${CFLAGS} -fPIE ${LDFLAGS} ${FILES.o} -lm -o ${DEST}
205 -
206 - lint:
207 - lint ${IFLAG} ${FILES.c} -lm
208 -@@ -103,4 +101,4 @@
209 - rm -f */*.o ${DEST_DIR}/core
210 -
211 - .c.o:
212 -- ${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
213 -+ ${CC} -c ${IFLAG} ${CFLAGS} -fPIC -o $*.o $*.c