summaryrefslogtreecommitdiff
blob: bf7d164f5baf9da2548dfec572502a7d583e113b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs

DESCRIPTION="Portable string functions, focus on the *printf() and *scanf() clones"
HOMEPAGE="https://daniel.haxx.se/projects/trio/"
SRC_URI="mirror://sourceforge/ctrio/${P}.tar.gz"

LICENSE="trio"
SLOT="0"
KEYWORDS="~amd64 ~x86"

PATCHES=(
	"${FILESDIR}"/${P}-no-inline.patch
)
HTML_DOCS=( html/. )

src_prepare() {
	default
	sed -i '/$(CC)/s/-o/$(LOCAL_LDFLAGS) -o/' Makefile.in || die
}

src_compile() {
	emake AR="$(tc-getAR)" LOCAL_LDFLAGS="${LDFLAGS}"
	ln -s libtrio.so.2{.0.0,} || die
	ln -s libtrio.so{.2.0.0,} || die
}

src_test() {
	emake LOCAL_LDFLAGS="${LDFLAGS}" regression
	LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" ./regression || die
}

src_install() {
	doheader trio*.h
	dolib.so libtrio.so*
	einstalldocs
}