dev-libs/fribidi: remove old
[gentoo.git] / dev-libs / liblinear / liblinear-221.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5 inherit multilib toolchain-funcs
6
7 DESCRIPTION="A Library for Large Linear Classification"
8 HOMEPAGE="https://www.csie.ntu.edu.tw/~cjlin/liblinear/ https://github.com/cjlin1/liblinear"
9 SRC_URI="https://github.com/cjlin1/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0/3"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-macos"
14 IUSE="blas"
15
16 RDEPEND="
17         blas? ( virtual/blas )
18 "
19 DEPEND="
20         ${RDEPEND}
21         blas? ( virtual/pkgconfig )
22 "
23
24 src_prepare() {
25         default
26
27         sed -i \
28                 -e '/^AR/s|=|?=|g' \
29                 -e '/^RANLIB/s|=|?=|g' \
30                 -e '/^CFLAGS/d;/^CXXFLAGS/d' \
31                 blas/Makefile || die
32         sed -i \
33                 -e 's|make|$(MAKE)|g' \
34                 -e '/$(LIBS)/s|$(CFLAGS)|& $(LDFLAGS)|g' \
35                 -e '/^CFLAGS/d;/^CXXFLAGS/d' \
36                 -e 's|$${SHARED_LIB_FLAG}|& $(LDFLAGS)|g' \
37                 Makefile || die
38         if use blas; then
39                 sed -i -e 's:blas/blas.a::g' Makefile || die
40         fi
41 }
42
43 src_compile() {
44         emake \
45                 CC="$(tc-getCC)" \
46                 CXX="$(tc-getCXX)" \
47                 CFLAGS="${CFLAGS} -fPIC" \
48                 CXXFLAGS="${CXXFLAGS} -fPIC" \
49                 AR="$(tc-getAR) rcv" \
50                 RANLIB="$(tc-getRANLIB)" \
51                 LIBS="$(usex blas "$( $(tc-getPKG_CONFIG) --libs blas )" blas/blas.a)" \
52                 lib all
53 }
54
55 src_install() {
56         dolib.so ${PN}.so.3
57         dosym ${PN}.so.3 /usr/$(get_libdir)/${PN}.so
58
59         newbin predict ${PN}-predict
60         newbin train ${PN}-train
61
62         doheader linear.h
63
64         dodoc README
65 }