1 |
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=8
|
|
4 |
EAPI=7
|
5 |
5 |
|
6 |
|
inherit autotools
|
|
6 |
inherit toolchain-funcs flag-o-matic
|
7 |
7 |
|
8 |
8 |
DESCRIPTION="A free stand-alone ini file parsing library"
|
9 |
|
HOMEPAGE="http://ndevilla.free.fr/iniparser/"
|
10 |
|
SRC_URI="http://ndevilla.free.fr/iniparser/${P}.tar.gz"
|
|
9 |
HOMEPAGE="https://github.com/ndevilla/iniparser"
|
|
10 |
SRC_URI="https://github.com/ndevilla/iniparser/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
11 |
11 |
|
12 |
12 |
LICENSE="MIT"
|
13 |
|
SLOT="0"
|
14 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
|
13 |
SLOT="4"
|
|
14 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
15 |
15 |
IUSE="doc examples"
|
16 |
|
# the tests are rather examples than tests, no point in running them
|
17 |
|
RESTRICT="test"
|
18 |
16 |
|
19 |
17 |
BDEPEND="doc? ( app-doc/doxygen )"
|
20 |
18 |
|
21 |
|
S="${WORKDIR}/${PN}"
|
|
19 |
_newlib_so_with_symlinks() {
|
|
20 |
local source="${1}" base="${2}" current="${3}" revision="${4}" age="${5}"
|
22 |
21 |
|
23 |
|
PATCHES=(
|
24 |
|
"${FILESDIR}"/${PN}-3.0b-cpp.patch
|
25 |
|
"${FILESDIR}"/${PN}-3.0-autotools.patch
|
26 |
|
"${FILESDIR}"/${PN}-4.0-out-of-bounds-read.patch
|
27 |
|
)
|
|
22 |
newlib.so ${source} ${base}.so.${current}.${revision}.${age}
|
|
23 |
local i
|
|
24 |
for i in ".${current}" '' ; do
|
|
25 |
dosym ${base}.so.${current}.${revision}.${age} /usr/$(get_libdir)/${base}.so${i}
|
|
26 |
done
|
|
27 |
}
|
28 |
28 |
|
29 |
29 |
src_prepare() {
|
30 |
30 |
default
|
31 |
|
eautoreconf
|
|
31 |
rm -r html || die
|
|
32 |
}
|
|
33 |
|
|
34 |
src_configure() {
|
|
35 |
append-lfs-flags
|
|
36 |
}
|
|
37 |
|
|
38 |
_emake() {
|
|
39 |
emake CC="$(tc-getCC)" AR="$(tc-getAR)" V=1 \
|
|
40 |
SO_TARGET=lib${PN}${SLOT}.so.1 \
|
|
41 |
ADDITIONAL_CFLAGS= \
|
|
42 |
"$@"
|
|
43 |
}
|
|
44 |
|
|
45 |
src_compile() {
|
|
46 |
_emake
|
|
47 |
}
|
|
48 |
|
|
49 |
src_test() {
|
|
50 |
_emake -C test
|
32 |
51 |
}
|
33 |
52 |
|
34 |
53 |
src_install() {
|
|
54 |
_newlib_so_with_symlinks lib${PN}${SLOT}.so.1 lib${PN}${SLOT} 1 0 0
|
|
55 |
|
|
56 |
insinto /usr/include/${PN}${SLOT}
|
|
57 |
doins src/*.h
|
|
58 |
|
35 |
59 |
if use doc; then
|
36 |
60 |
emake -C doc
|
37 |
61 |
HTML_DOCS=( html/. )
|
38 |
62 |
fi
|
39 |
63 |
|
40 |
|
default
|
41 |
|
|
42 |
64 |
if use examples; then
|
43 |
65 |
docinto examples
|
44 |
|
dodoc test/*.{c,ini,py}
|
|
66 |
dodoc -r example/.
|
45 |
67 |
docompress -x /usr/share/doc/${PF}/examples
|
46 |
68 |
fi
|
47 |
69 |
|
48 |
|
# No static archives
|
49 |
|
find "${ED}" -name '*.la' -delete || die
|
|
70 |
einstalldocs
|
50 |
71 |
}
|