1 |
|
# Copyright 1999-2023 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit autotools
|
|
6 |
inherit autotools toolchain-funcs
|
7 |
7 |
|
8 |
8 |
DESCRIPTION="A small XML parsing library that you can use to read XML data files or strings"
|
9 |
9 |
HOMEPAGE="
|
... | ... | |
13 |
13 |
SRC_URI="https://github.com/michaelrsweet/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
14 |
14 |
|
15 |
15 |
LICENSE="Mini-XML"
|
16 |
|
SLOT="0"
|
17 |
|
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ppc ~ppc64 ~riscv ~sparc x86"
|
18 |
|
IUSE="static-libs threads"
|
|
16 |
SLOT="4"
|
|
17 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
|
18 |
IUSE="static-libs test threads"
|
|
19 |
RESTRICT="!test? ( test )"
|
19 |
20 |
|
20 |
21 |
BDEPEND="virtual/pkgconfig"
|
21 |
22 |
|
22 |
23 |
src_prepare() {
|
23 |
24 |
default
|
24 |
25 |
|
25 |
|
# Don't hardcode FORTIFY_SOURCe
|
26 |
|
sed -e 's/-D_FORTIFY_SOURCE=2//g' -i configure || die
|
27 |
|
sed -e 's/-D_FORTIFY_SOURCE=2//g' -i configure.ac || die
|
|
26 |
# Don't hardcode FORTIFY_SOURCE
|
|
27 |
sed -e 's/-D_FORTIFY_SOURCE=3//g' -i configure || die
|
|
28 |
sed -e 's/-D_FORTIFY_SOURCE=3//g' -i configure.ac || die
|
28 |
29 |
|
29 |
30 |
# Don't run always tests
|
30 |
31 |
# Enable verbose compiling
|
31 |
32 |
sed -e '/ALLTARGETS/s/testmxml//g' -e '/.SILENT:/d' -i Makefile.in || die
|
32 |
|
|
33 |
|
# Build only static-libs, when requested by user, also build docs without static-libs in that case
|
34 |
|
if ! use static-libs; then
|
35 |
|
local mysedopts=(
|
36 |
|
-e '/^install:/s/install-libmxml.a//g'
|
37 |
|
-e '/^mxml.xml:/s/-static//g'
|
38 |
|
-e '/^mxml.epub:/s/-static//g'
|
39 |
|
-e '/^valgrind/s/-static//g'
|
40 |
|
-e 's/.\/mxmldoc-static/LD_LIBRARY_PATH="." .\/mxmldoc/g'
|
41 |
|
)
|
42 |
|
sed "${mysedopts[@]}" -i Makefile.in || die
|
43 |
|
fi
|
44 |
|
|
45 |
33 |
eautoconf
|
46 |
34 |
}
|
47 |
35 |
|
48 |
36 |
src_configure() {
|
49 |
37 |
local myeconfargs=(
|
|
38 |
AR="$(tc-getAR)"
|
|
39 |
$(use_enable static-libs static)
|
50 |
40 |
$(use_enable threads)
|
51 |
41 |
--with-docdir=/usr/share/doc/"${PF}"
|
|
42 |
--with-dsoflags="${LDFLAGS}"
|
|
43 |
--with-ldflags="${LDFLAGS}"
|
|
44 |
|
52 |
45 |
)
|
53 |
46 |
|
54 |
47 |
econf "${myeconfargs[@]}"
|
55 |
48 |
}
|
56 |
49 |
|
|
50 |
src_compile() {
|
|
51 |
default
|
|
52 |
use test && emake testmxml
|
|
53 |
}
|
|
54 |
|
57 |
55 |
src_test() {
|
58 |
|
emake testmxml
|
|
56 |
emake test
|
59 |
57 |
}
|
60 |
58 |
|
61 |
59 |
src_install() {
|