Skip to content

Commit 98ce978

Browse files
committed
dev-libs/liblinear: Sync with Gentoo
It's from Gentoo commit 6c2c859c08f129a9ef197343915debe7e4ffa393.
1 parent 76f352d commit 98ce978

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
DIST liblinear-2.46.tar.gz 569001 BLAKE2B d1f9019717b47414c11611a253ca9185d80cb5860e53462f9b4a6f95c99b0d39502ba91827d8afca6e98d279b50ce44cdcfde9a3629f2c5d4773eeb93e17de76 SHA512 94b892a51f85246cad36562f1e4870a22e73c0c6bf237dfcdc50467e93212a6e88a8f7ba36cfd691c031d8ced9ad663f592ef94e309df764d56095cfff7835ce
12
DIST liblinear-243.tar.gz 565437 BLAKE2B 6367cfbdc040b9183c4993f5340a4d74a8dde48da04ef07f725dc5735073e1b9a7440bad325e9f7527ad76d675dbf3bb47d1d43fc323e1e42ef360d679e816ff SHA512 a0cfa9803285cdfda54752e7addfb210a9ba8f7056cfc8aca13987db7f0bef5fe02d6179eadc829cb243670414da061e6c4cf3d50d682ce392778a0e8cb9e753
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 1999-2023 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
inherit multilib toolchain-funcs
7+
8+
MY_PV="${PV:0:1}.${PV:1}"
9+
MY_P="${PN}-${MY_PV}"
10+
11+
DESCRIPTION="A Library for Large Linear Classification"
12+
HOMEPAGE="https://www.csie.ntu.edu.tw/~cjlin/liblinear/ https://github.com/cjlin1/liblinear"
13+
SRC_URI="https://www.csie.ntu.edu.tw/~cjlin/liblinear/${MY_P}.tar.gz"
14+
S="${WORKDIR}"/${MY_P}
15+
16+
LICENSE="BSD"
17+
SLOT="0/5"
18+
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
19+
20+
src_prepare() {
21+
default
22+
23+
sed -i \
24+
-e '/^CFLAGS/d;/^CXXFLAGS/d' \
25+
blas/Makefile || die
26+
sed -i \
27+
-e 's|make|$(MAKE)|g' \
28+
-e '/$(LIBS)/s|$(CFLAGS)|& $(LDFLAGS)|g' \
29+
-e '/^CFLAGS/d;/^CXXFLAGS/d' \
30+
-e 's|$(SHARED_LIB_FLAG)|& $(LDFLAGS)|g' \
31+
Makefile || die
32+
33+
# fix install_name on Darwin
34+
sed -i \
35+
-e '/install_name/s:liblinear.so.$(SHVER):'"${EPREFIX}"'/usr/lib/liblinear.$(SHVER).dylib:' \
36+
-e '/LDFLAGS/s:liblinear.so.$(SHVER):liblinear'"$(get_libname '$(SHVER)')"':' \
37+
Makefile || die
38+
}
39+
40+
src_compile() {
41+
emake \
42+
CC="$(tc-getCC)" \
43+
CXX="$(tc-getCXX)" \
44+
CFLAGS="${CFLAGS} -fPIC" \
45+
CXXFLAGS="${CXXFLAGS} -fPIC" \
46+
AR="$(tc-getAR)" \
47+
RANLIB="$(tc-getRANLIB)" \
48+
lib all
49+
}
50+
51+
src_install() {
52+
dolib.so ${PN}$(get_libname ${SLOT#*/})
53+
dosym ${PN}$(get_libname ${SLOT#*/}) /usr/$(get_libdir)/${PN}$(get_libname)
54+
55+
newbin predict ${PN}-predict
56+
newbin train ${PN}-train
57+
58+
doheader linear.h
59+
60+
dodoc README
61+
}

0 commit comments

Comments
 (0)