Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/glpk/, sci-mathematics/glpk/files/
Date: Sat, 07 Mar 2020 02:23:15
Message-Id: 1583547204.20a34c28e3afae7c20221d6fb76ae83d119c1375.mjo@gentoo
1 commit: 20a34c28e3afae7c20221d6fb76ae83d119c1375
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 6 21:50:06 2020 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 7 02:13:24 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20a34c28
7
8 sci-mathematics/glpk: new version 4.65.
9
10 This new upstream version fixes a few minor ebuild issues:
11
12 * I've attempted to fix the MySQL include location in a more standard
13 way, by using mysql_config (bug 597620). Another solution was already
14 present in v4.63, so I've marked this bug as resolved.
15
16 * The virtual/mysql dependency was replaced, per bug 666060. This will
17 be completely resolved when v4.65 goes stable and v4.63 is removed.
18
19 We also include a new patch, from upstream, to quiet some overly-verbose
20 output. The patch to debundle the system libraries was forward-ported to
21 the new version thanks to François Bissey, who maintained an ebuild for
22 v4.65 in the sage-on-gentoo overlay until now.
23
24 Bug: https://bugs.gentoo.org/666060
25 Closes: https://bugs.gentoo.org/597620
26 Closes: https://bugs.gentoo.org/711648
27 Package-Manager: Portage-2.3.84, Repoman-2.3.20
28 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
29
30 sci-mathematics/glpk/Manifest | 1 +
31 .../files/glpk-4.65-debundle-system-libs.patch | 91 ++++++++++++++++++++++
32 .../files/glpk-4.65-fix-mysql-include-prefix.patch | 47 +++++++++++
33 .../glpk/files/glpk-4.65-longstep_verbosity.patch | 23 ++++++
34 sci-mathematics/glpk/glpk-4.65.ebuild | 69 ++++++++++++++++
35 5 files changed, 231 insertions(+)
36
37 diff --git a/sci-mathematics/glpk/Manifest b/sci-mathematics/glpk/Manifest
38 index e7dae3fabf9..6c89c63e486 100644
39 --- a/sci-mathematics/glpk/Manifest
40 +++ b/sci-mathematics/glpk/Manifest
41 @@ -1 +1,2 @@
42 DIST glpk-4.63.tar.gz 4131787 BLAKE2B 791fa1a1424011668019e180fc245c0319f601255f596affe87afa0df47d9d615a8accd794d51c15bff5fe4fe6409369362f6c9e82bdde67903177b8da55e891 SHA512 3ee9b9ec5322282a9c62b2ee209fc7760383a6a764ef3816445ffb66f15ed4d00309bff1b98d50c243b58aa74f83072afde45c389799e637e11e86f4db45276c
43 +DIST glpk-4.65.tar.gz 4167110 BLAKE2B 4ccb5cd8301bdca2ccdecfc1648642afe26ff0a1ee9a75cb5a3906838086e5c41edfb16e7c55f4ad677d192f6a66b866f2d917c5be7103da7141bfb1f74e636b SHA512 997e8e599ff1718a08c66b86eadd0e01f4644899f1e95920f8ae91d66b4d8361021766b346845f4dcbcfe667b41ab72ea3d377017a0ebf85d7ece091cfd81375
44
45 diff --git a/sci-mathematics/glpk/files/glpk-4.65-debundle-system-libs.patch b/sci-mathematics/glpk/files/glpk-4.65-debundle-system-libs.patch
46 new file mode 100644
47 index 00000000000..78af8b8d943
48 --- /dev/null
49 +++ b/sci-mathematics/glpk/files/glpk-4.65-debundle-system-libs.patch
50 @@ -0,0 +1,91 @@
51 +diff --git a/configure.ac b/configure.ac
52 +index 96c4cc5..29e11f9 100644
53 +--- a/configure.ac
54 ++++ b/configure.ac
55 +@@ -69,6 +69,11 @@ AC_PROG_LIBTOOL
56 + dnl Check for math library
57 + AC_CHECK_LIB([m], [exp])
58 +
59 ++AC_CHECK_LIB([amd], [amd_1])
60 ++AC_CHECK_LIB([colamd], [colamd])
61 ++AC_CHECK_HEADER([amd.h])
62 ++AC_CHECK_LIB([z], [gzopen])
63 ++
64 + dnl Check for <sys/time.h> header
65 + AC_CHECK_HEADER([sys/time.h],
66 + AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A]))
67 +diff --git a/src/Makefile.am b/src/Makefile.am
68 +index eb5dc1b..b814627 100644
69 +--- a/src/Makefile.am
70 ++++ b/src/Makefile.am
71 +@@ -6,10 +6,8 @@ lib_LTLIBRARIES = libglpk.la
72 +
73 + libglpk_la_CPPFLAGS = \
74 + -I$(srcdir) \
75 +--I$(srcdir)/amd \
76 + -I$(srcdir)/api \
77 + -I$(srcdir)/bflib \
78 +--I$(srcdir)/colamd \
79 + -I$(srcdir)/draft \
80 + -I$(srcdir)/env \
81 + -I$(srcdir)/intopt \
82 +@@ -18,8 +16,7 @@ libglpk_la_CPPFLAGS = \
83 + -I$(srcdir)/mpl \
84 + -I$(srcdir)/npp \
85 + -I$(srcdir)/proxy \
86 +--I$(srcdir)/simplex \
87 +--I$(srcdir)/zlib
88 ++-I$(srcdir)/simplex
89 +
90 + libglpk_la_LDFLAGS = \
91 + -version-info 43:0:3 \
92 +@@ -27,18 +24,6 @@ libglpk_la_LDFLAGS = \
93 + ${NOUNDEFINED}
94 +
95 + libglpk_la_SOURCES = \
96 +-amd/amd_1.c \
97 +-amd/amd_2.c \
98 +-amd/amd_aat.c \
99 +-amd/amd_control.c \
100 +-amd/amd_defaults.c \
101 +-amd/amd_dump.c \
102 +-amd/amd_info.c \
103 +-amd/amd_order.c \
104 +-amd/amd_post_tree.c \
105 +-amd/amd_postorder.c \
106 +-amd/amd_preprocess.c \
107 +-amd/amd_valid.c \
108 + api/advbas.c \
109 + api/asnhall.c \
110 + api/asnlp.c \
111 +@@ -104,7 +89,6 @@ bflib/scf.c \
112 + bflib/scfint.c \
113 + bflib/sgf.c \
114 + bflib/sva.c \
115 +-colamd/colamd.c \
116 + draft/bfd.c \
117 + draft/bfx.c \
118 + draft/glpapi06.c \
119 +@@ -202,21 +186,6 @@ simplex/spxprim.c \
120 + simplex/spxprob.c \
121 + simplex/spychuzc.c \
122 + simplex/spychuzr.c \
123 +-simplex/spydual.c \
124 +-zlib/adler32.c \
125 +-zlib/compress.c \
126 +-zlib/crc32.c \
127 +-zlib/deflate.c \
128 +-zlib/gzclose.c \
129 +-zlib/gzlib.c \
130 +-zlib/gzread.c \
131 +-zlib/gzwrite.c \
132 +-zlib/inffast.c \
133 +-zlib/inflate.c \
134 +-zlib/inftrees.c \
135 +-zlib/trees.c \
136 +-zlib/uncompr.c \
137 +-zlib/zio.c \
138 +-zlib/zutil.c
139 ++simplex/spydual.c
140 +
141 + ## eof ##
142
143 diff --git a/sci-mathematics/glpk/files/glpk-4.65-fix-mysql-include-prefix.patch b/sci-mathematics/glpk/files/glpk-4.65-fix-mysql-include-prefix.patch
144 new file mode 100644
145 index 00000000000..4dd6583d6de
146 --- /dev/null
147 +++ b/sci-mathematics/glpk/files/glpk-4.65-fix-mysql-include-prefix.patch
148 @@ -0,0 +1,47 @@
149 +From 5cff695e9eb8405efbdfa976f1fad965c55436e8 Mon Sep 17 00:00:00 2001
150 +From: Michael Orlitzky <michael@××××××××.com>
151 +Date: Fri, 6 Mar 2020 16:24:10 -0500
152 +Subject: [PATCH 1/1] configure.ac: attempt mysql_config to find the MySQL
153 + headers.
154 +
155 +When building with MySQL support, the configure script guesses that
156 +the path to the MySQL headers is /usr/include/mysql. That is usually
157 +correct, but when people install MySQL to a nonstandard location such
158 +as /home/mjo/usr, it falls over. Fortunately, MySQL usually provides
159 +an executable called "mysql_config" that can output the location of
160 +its headers.
161 +
162 +In such a "local" installation, if I prepend /home/mjo/usr/bin to my
163 +PATH, then running "mysql_config" will execute the mysql_config from
164 +/home/mjo/usr/bin and will therefore output -I/home/mjo/usr/include as
165 +the preprocessor flag that glpk needs. That's the right thing to do,
166 +and it works just as well for a system install under /usr or
167 +/usr/local.
168 +
169 +This commit attempts to find the headers using mysql_config first,
170 +and falls back to the location /usr/include/mysql.
171 +
172 +Gentoo-bug: https://bugs.gentoo.org/597620
173 +---
174 + configure.ac | 5 ++++-
175 + 1 file changed, 4 insertions(+), 1 deletion(-)
176 +
177 +diff --git a/configure.ac b/configure.ac
178 +index 96c4cc5..d20a6ef 100644
179 +--- a/configure.ac
180 ++++ b/configure.ac
181 +@@ -145,7 +145,10 @@ if test "$enable_mysql" = "yes"; then
182 + AC_MSG_ERROR([--enable-mysql requires --enable-dl])
183 + fi
184 + AC_MSG_RESULT([yes])
185 +- CPPFLAGS="-I/usr/include/mysql $CPPFLAGS"
186 ++ # Guess at the include directory if mysql_config isn't in our PATH.
187 ++ MYSQL_INCLUDE=$(mysql_config --include 2>/dev/null)
188 ++ test -z "${MYSQL_INCLUDE}" && MYSQL_INCLUDE="-I/usr/include/mysql"
189 ++ CPPFLAGS="${MYSQL_INCLUDE} $CPPFLAGS"
190 + AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A])
191 + else
192 + AC_MSG_RESULT([no])
193 +--
194 +2.24.1
195 +
196
197 diff --git a/sci-mathematics/glpk/files/glpk-4.65-longstep_verbosity.patch b/sci-mathematics/glpk/files/glpk-4.65-longstep_verbosity.patch
198 new file mode 100644
199 index 00000000000..1b78ece3e69
200 --- /dev/null
201 +++ b/sci-mathematics/glpk/files/glpk-4.65-longstep_verbosity.patch
202 @@ -0,0 +1,23 @@
203 +http://lists.gnu.org/archive/html/bug-glpk/2018-03/msg00000.html
204 +
205 +diff --git a/src/draft/glpios03.c b/src/draft/glpios03.c
206 +index 21d6a00..eb34ad0 100644
207 +--- a/src/draft/glpios03.c
208 ++++ b/src/draft/glpios03.c
209 +@@ -920,13 +920,10 @@ int ios_driver(glp_tree *T)
210 + #if 0
211 + ((glp_iocp *)T->parm)->msg_lev = GLP_MSG_DBG;
212 + #endif
213 +-#if 1 /* 16/III-2016 */
214 ++#if 1 /* 01/III-2018 */
215 + if (((glp_iocp *)T->parm)->flip)
216 +-#if 0 /* 20/I-2018 */
217 +- xprintf("WARNING: LONG-STEP DUAL SIMPLEX WILL BE USED\n");
218 +-#else
219 +- xprintf("Long-step dual simplex will be used\n");
220 +-#endif
221 ++ if (T->parm->msg_lev >= GLP_MSG_ALL)
222 ++ xprintf("Long-step dual simplex will be used\n");
223 + #endif
224 + /* on entry to the B&B driver it is assumed that the active list
225 + contains the only active (i.e. root) subproblem, which is the
226
227 diff --git a/sci-mathematics/glpk/glpk-4.65.ebuild b/sci-mathematics/glpk/glpk-4.65.ebuild
228 new file mode 100644
229 index 00000000000..258796fa21a
230 --- /dev/null
231 +++ b/sci-mathematics/glpk/glpk-4.65.ebuild
232 @@ -0,0 +1,69 @@
233 +# Copyright 1999-2020 Gentoo Authors
234 +# Distributed under the terms of the GNU General Public License v2
235 +
236 +EAPI=7
237 +
238 +inherit autotools flag-o-matic toolchain-funcs
239 +
240 +DESCRIPTION="GNU Linear Programming Kit"
241 +LICENSE="GPL-3"
242 +HOMEPAGE="https://www.gnu.org/software/glpk/"
243 +SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
244 +
245 +SLOT="0/40"
246 +IUSE="doc examples gmp odbc mysql static-libs"
247 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
248 +
249 +BDEPEND="virtual/pkgconfig"
250 +DEPEND="
251 + sci-libs/amd:0=
252 + sci-libs/colamd:=
253 + sys-libs/zlib:0=
254 + gmp? ( dev-libs/gmp:0= )
255 + mysql? ( dev-db/mysql-connector-c )
256 + odbc? ( || ( dev-db/libiodbc:0 dev-db/unixODBC:0 ) )"
257 +RDEPEND="${DEPEND}"
258 +
259 +PATCHES=(
260 + "${FILESDIR}/${PN}-4.65-fix-mysql-include-prefix.patch"
261 + "${FILESDIR}/${PN}-4.65-debundle-system-libs.patch"
262 + "${FILESDIR}/${PN}-4.65-longstep_verbosity.patch"
263 +)
264 +
265 +src_prepare() {
266 + # TODO: the ODBC library is dlopen()ed, so we only want to append
267 + # -I<foo> to the preprocessor flags, and not all of the CFLAGS that
268 + # were used to build libiodbc. That fix and the pkg-config fallback
269 + # should be sent upstream, and placed into CPPFLAGS rather than
270 + # CFLAGS (as configure.ac does now).
271 + use odbc && [[ -z $(type -P odbc_config) ]] && \
272 + append-cppflags $($(tc-getPKG_CONFIG) --cflags libiodbc)
273 +
274 + default
275 + eautoreconf
276 +}
277 +
278 +src_configure() {
279 + local myconf
280 + if use mysql || use odbc; then
281 + myconf="--enable-dl"
282 + else
283 + myconf="--disable-dl"
284 + fi
285 +
286 + econf ${myconf} \
287 + $(use_enable mysql) \
288 + $(use_enable odbc) \
289 + $(use_enable static-libs static) \
290 + $(use_with gmp)
291 +}
292 +
293 +src_install() {
294 + default
295 + if use examples; then
296 + insinto "/usr/share/doc/${PF}"
297 + doins -r examples
298 + docompress -x "/usr/share/doc/${PF}/examples"
299 + fi
300 + use doc && dodoc doc/*.pdf doc/notes/*.pdf doc/*.txt
301 +}