sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / sci-mathematics / glpk / glpk-4.65.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools flag-o-matic toolchain-funcs
7
8 DESCRIPTION="GNU Linear Programming Kit"
9 LICENSE="GPL-3"
10 HOMEPAGE="https://www.gnu.org/software/glpk/"
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
12
13 SLOT="0/40"
14 IUSE="doc examples gmp odbc mysql static-libs"
15 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-macos"
16
17 BDEPEND="virtual/pkgconfig"
18 DEPEND="
19         sci-libs/amd:0=
20         sci-libs/colamd:=
21         sys-libs/zlib:0=
22         gmp? ( dev-libs/gmp:0= )
23         mysql? ( dev-db/mysql-connector-c )
24         odbc? ( || ( dev-db/libiodbc:0 dev-db/unixODBC:0 ) )"
25 RDEPEND="${DEPEND}"
26
27 PATCHES=(
28         "${FILESDIR}/${PN}-4.65-fix-mysql-include-prefix.patch"
29         "${FILESDIR}/${PN}-4.65-debundle-system-libs.patch"
30         "${FILESDIR}/${PN}-4.65-longstep_verbosity.patch"
31 )
32
33 src_prepare() {
34         # TODO: the ODBC library is dlopen()ed, so we only want to append
35         # -I<foo> to the preprocessor flags, and not all of the CFLAGS that
36         # were used to build libiodbc. That fix and the pkg-config fallback
37         # should be sent upstream, and placed into CPPFLAGS rather than
38         # CFLAGS (as configure.ac does now).
39         use odbc && [[ -z $(type -P odbc_config) ]] && \
40                 append-cppflags $($(tc-getPKG_CONFIG) --cflags libiodbc)
41
42         default
43         eautoreconf
44 }
45
46 src_configure() {
47         local myconf
48         if use mysql || use odbc; then
49                 myconf="--enable-dl"
50         else
51                 myconf="--disable-dl"
52         fi
53
54         econf ${myconf} \
55                 $(use_enable mysql) \
56                 $(use_enable odbc) \
57                 $(use_enable static-libs static) \
58                 $(use_with gmp)
59 }
60
61 src_install() {
62         default
63         if use examples; then
64                 insinto "/usr/share/doc/${PF}"
65                 doins -r examples
66                 docompress -x "/usr/share/doc/${PF}/examples"
67         fi
68         use doc && dodoc doc/*.pdf doc/notes/*.pdf doc/*.txt
69 }