dev-libs/libxslt: stable 1.1.30-r2 for ppc64, bug #635938
[gentoo.git] / dev-libs / libxslt / libxslt-1.1.30.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6 PYTHON_REQ_USE="xml"
7
8 inherit autotools ltprune python-r1 toolchain-funcs multilib-minimal
9
10 DESCRIPTION="XSLT libraries and tools"
11 HOMEPAGE="http://www.xmlsoft.org/"
12 SRC_URI="ftp://xmlsoft.org/${PN}/${P}.tar.gz"
13
14 LICENSE="MIT"
15 SLOT="0"
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"
17
18 IUSE="crypt debug examples python static-libs"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
20
21 RDEPEND="
22         >=dev-libs/libxml2-2.9.1-r5:2[${MULTILIB_USEDEP}]
23         crypt?  ( >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] )
24         python? (
25                 ${PYTHON_DEPS}
26                 dev-libs/libxml2:2[python,${PYTHON_USEDEP}] )
27 "
28 DEPEND="${RDEPEND}"
29
30 MULTILIB_CHOST_TOOLS=(
31         /usr/bin/xslt-config
32 )
33
34 MULTILIB_WRAPPED_HEADERS=(
35         /usr/include/libxslt/xsltconfig.h
36 )
37
38 src_prepare() {
39         default
40
41         DOCS=( AUTHORS ChangeLog FEATURES NEWS README TODO )
42
43         # https://bugzilla.gnome.org/show_bug.cgi?id=684621
44         eapply "${FILESDIR}"/${PN}.m4-${PN}-1.1.26.patch
45
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
50
51         mv configure.{in,ac} || die
52
53         eautoreconf
54         # If eautoreconf'd with new autoconf, then epunt_cxx is not necessary
55         # and it is propably otherwise too if upstream generated with new
56         # autoconf
57 #       epunt_cxx
58         # But Prefix always needs elibtoolize if not eautoreconf'd.
59 #       elibtoolize
60 }
61
62 multilib_src_configure() {
63         libxslt_configure() {
64                 ECONF_SOURCE="${S}" econf \
65                         --with-html-dir="${EPREFIX}"/usr/share/doc/${PF} \
66                         --with-html-subdir=html \
67                         $(use_with crypt crypto) \
68                         $(use_with debug) \
69                         $(use_with debug mem-debug) \
70                         $(use_enable static-libs static) \
71                         "$@"
72         }
73
74         libxslt_py_configure() {
75                 mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
76                 run_in_build_dir libxslt_configure --with-python
77         }
78
79         libxslt_configure --without-python # build python bindings separately
80
81         if multilib_is_native_abi && use python; then
82                 python_foreach_impl libxslt_py_configure
83         fi
84 }
85
86 multilib_src_compile() {
87         default
88         multilib_is_native_abi && use python && libxslt_foreach_py_emake all
89 }
90
91 multilib_src_test() {
92         default
93         multilib_is_native_abi && use python && libxslt_foreach_py_emake test
94 }
95
96 multilib_src_install() {
97         # "default" does not work here - docs are installed by multilib_src_install_all
98         emake DESTDIR="${D}" install
99
100         if multilib_is_native_abi && use python; then
101                 libxslt_foreach_py_emake \
102                         DESTDIR="${D}" \
103                         docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
104                         EXAMPLE_DIR="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
105                         install
106                 python_foreach_impl python_optimize
107         fi
108 }
109
110 multilib_src_install_all() {
111         einstalldocs
112
113         if ! use examples; then
114                 rm -rf "${ED}"/usr/share/doc/${PF}/examples
115                 rm -rf "${ED}"/usr/share/doc/${PF}/python/examples
116         fi
117
118         prune_libtool_files --modules
119 }
120
121 libxslt_foreach_py_emake() {
122         libxslt_py_emake() {
123                 pushd "${BUILD_DIR}/python" > /dev/null || die
124                 emake "$@"
125                 popd > /dev/null
126         }
127         local native_builddir=${BUILD_DIR}
128         python_foreach_impl libxslt_py_emake top_builddir="${native_builddir}" "$@"
129 }