1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
8 inherit autotools ltprune python-r1 toolchain-funcs multilib-minimal
10 DESCRIPTION="XSLT libraries and tools"
11 HOMEPAGE="http://www.xmlsoft.org/"
12 SRC_URI="ftp://xmlsoft.org/${PN}/${P}.tar.gz"
16 KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
18 IUSE="crypt debug examples python static-libs"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
22 >=dev-libs/libxml2-2.9.1-r5:2[${MULTILIB_USEDEP}]
23 crypt? ( >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] )
26 dev-libs/libxml2:2[python,${PYTHON_USEDEP}] )
30 MULTILIB_CHOST_TOOLS=(
34 MULTILIB_WRAPPED_HEADERS=(
35 /usr/include/libxslt/xsltconfig.h
41 DOCS=( AUTHORS ChangeLog FEATURES NEWS README TODO )
43 # https://bugzilla.gnome.org/show_bug.cgi?id=684621
44 eapply "${FILESDIR}"/${PN}.m4-${PN}-1.1.26.patch
46 # Simplify python setup
47 # https://bugzilla.gnome.org/show_bug.cgi?id=758095
48 eapply "${FILESDIR}"/${PN}-1.1.30-simplify-python.patch
49 eapply "${FILESDIR}"/${PN}-1.1.28-disable-static-modules.patch
52 # https://bugs.gentoo.org/630784
53 eapply "${FILESDIR}"/1.1.30-unbreak-xslt-config.patch
55 # Fix build and headers with glibc-2.26, bug 632214
56 eapply "${FILESDIR}"/${PN}-1.1.30-glibc226.patch
58 mv configure.{in,ac} || die
61 # If eautoreconf'd with new autoconf, then epunt_cxx is not necessary
62 # and it is propably otherwise too if upstream generated with new
65 # But Prefix always needs elibtoolize if not eautoreconf'd.
69 multilib_src_configure() {
71 ECONF_SOURCE="${S}" econf \
72 --with-html-dir="${EPREFIX}"/usr/share/doc/${PF} \
73 --with-html-subdir=html \
74 $(use_with crypt crypto) \
76 $(use_with debug mem-debug) \
77 $(use_enable static-libs static) \
81 libxslt_py_configure() {
82 mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
83 run_in_build_dir libxslt_configure --with-python
86 libxslt_configure --without-python # build python bindings separately
88 if multilib_is_native_abi && use python; then
89 python_foreach_impl libxslt_py_configure
93 multilib_src_compile() {
95 multilib_is_native_abi && use python && libxslt_foreach_py_emake all
100 multilib_is_native_abi && use python && libxslt_foreach_py_emake test
103 multilib_src_install() {
104 # "default" does not work here - docs are installed by multilib_src_install_all
105 emake DESTDIR="${D}" install
107 if multilib_is_native_abi && use python; then
108 libxslt_foreach_py_emake \
110 docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
111 EXAMPLE_DIR="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
113 python_foreach_impl python_optimize
117 multilib_src_install_all() {
120 if ! use examples; then
121 rm -rf "${ED}"/usr/share/doc/${PF}/examples
122 rm -rf "${ED}"/usr/share/doc/${PF}/python/examples
125 prune_libtool_files --modules
128 libxslt_foreach_py_emake() {
130 pushd "${BUILD_DIR}/python" > /dev/null || die
134 local native_builddir=${BUILD_DIR}
135 python_foreach_impl libxslt_py_emake top_builddir="${native_builddir}" "$@"