OLD | NEW |
(Empty) | |
| 1 # Copyright 1999-2011 Gentoo Foundation |
| 2 # Distributed under the terms of the GNU General Public License v2 |
| 3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.7.8.ebuild,v 1.9 2
011/02/26 17:17:33 arfrever Exp $ |
| 4 |
| 5 EAPI="3" |
| 6 PYTHON_DEPEND="python? 2" |
| 7 PYTHON_USE_WITH="-build xml" |
| 8 PYTHON_USE_WITH_OPT="python" |
| 9 SUPPORT_PYTHON_ABIS="1" |
| 10 RESTRICT_PYTHON_ABIS="3.* *-jython" |
| 11 |
| 12 inherit libtool flag-o-matic eutils python autotools prefix |
| 13 |
| 14 DESCRIPTION="Version 2 of the library to manipulate XML files" |
| 15 HOMEPAGE="http://www.xmlsoft.org/" |
| 16 |
| 17 LICENSE="MIT" |
| 18 SLOT="2" |
| 19 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-
aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-i
nterix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68
k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" |
| 20 IUSE="debug doc examples icu ipv6 python readline test" |
| 21 |
| 22 XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite" |
| 23 XSTS_NAME_1="xmlschema2002-01-16" |
| 24 XSTS_NAME_2="xmlschema2004-01-14" |
| 25 XSTS_TARBALL_1="xsts-2002-01-16.tar.gz" |
| 26 XSTS_TARBALL_2="xsts-2004-01-14.tar.gz" |
| 27 |
| 28 SRC_URI="ftp://xmlsoft.org/${PN}/${P}.tar.gz |
| 29 test? ( |
| 30 ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1} |
| 31 ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2} )" |
| 32 |
| 33 RDEPEND="sys-libs/zlib |
| 34 icu? ( dev-libs/icu ) |
| 35 readline? ( sys-libs/readline )" |
| 36 |
| 37 DEPEND="${RDEPEND} |
| 38 hppa? ( >=sys-devel/binutils-2.15.92.0.2 )" |
| 39 |
| 40 pkg_setup() { |
| 41 if use python; then |
| 42 python_pkg_setup |
| 43 fi |
| 44 } |
| 45 |
| 46 src_unpack() { |
| 47 # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR, |
| 48 # as they are needed as tarballs in ${S}/xstc instead and not unpacked |
| 49 unpack ${P}.tar.gz |
| 50 cd "${S}" |
| 51 |
| 52 if use test; then |
| 53 cp "${DISTDIR}/${XSTS_TARBALL_1}" \ |
| 54 "${DISTDIR}/${XSTS_TARBALL_2}" \ |
| 55 "${S}"/xstc/ \ |
| 56 || die "Failed to install test tarballs" |
| 57 fi |
| 58 } |
| 59 |
| 60 src_prepare() { |
| 61 # Patches needed for prefix support |
| 62 epatch "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch |
| 63 epatch "${FILESDIR}"/${PN}-2.7.2-winnt.patch |
| 64 |
| 65 eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c |
| 66 |
| 67 epunt_cxx |
| 68 |
| 69 # Reactivate the shared library versionning script |
| 70 epatch "${FILESDIR}/${P}-reactivate-script.patch" |
| 71 |
| 72 # Fix a potential memory access error |
| 73 epatch "${FILESDIR}/${P}-xpath-memory.patch" |
| 74 |
| 75 # Fix a potential freeing error in XPath |
| 76 epatch "${FILESDIR}/${P}-xpath-freeing.patch" |
| 77 epatch "${FILESDIR}/${P}-xpath-freeing2.patch" |
| 78 |
| 79 epatch "${FILESDIR}/${P}-disable_static_modules.patch" |
| 80 |
| 81 # Please do not remove, as else we get references to PORTAGE_TMPDIR |
| 82 # in /usr/lib/python?.?/site-packages/libxml2mod.la among things. |
| 83 # We now need to run eautoreconf at the end to prevent maintainer mode. |
| 84 # elibtoolize |
| 85 |
| 86 # Python bindings are built/tested/installed manually. |
| 87 sed -e "s/@PYTHON_SUBDIR@//" -i Makefile.am || die "sed failed" |
| 88 |
| 89 eautoreconf |
| 90 } |
| 91 |
| 92 src_configure() { |
| 93 # USE zlib support breaks gnome2 |
| 94 # (libgnomeprint for instance fails to compile with |
| 95 # fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002). |
| 96 |
| 97 # The meaning of the 'debug' USE flag does not apply to the --with-debug |
| 98 # switch (enabling the libxml2 debug module). See bug #100898. |
| 99 |
| 100 # --with-mem-debug causes unusual segmentation faults (bug #105120). |
| 101 |
| 102 local myconf="--with-html-subdir=${PF}/html |
| 103 --docdir=${EPREFIX}/usr/share/doc/${PF} |
| 104 $(use_with debug run-debug) |
| 105 $(use_with icu) |
| 106 $(use_with python) |
| 107 $(use_with readline) |
| 108 $(use_with readline history) |
| 109 $(use_enable ipv6)" |
| 110 |
| 111 # filter seemingly problematic CFLAGS (#26320) |
| 112 filter-flags -fprefetch-loop-arrays -funroll-loops |
| 113 |
| 114 econf ${myconf} |
| 115 } |
| 116 |
| 117 src_compile() { |
| 118 default |
| 119 |
| 120 if use python; then |
| 121 python_copy_sources python |
| 122 building() { |
| 123 emake PYTHON_INCLUDES="${EPREFIX}$(python_get_includedir
)" \ |
| 124 PYTHON_SITE_PACKAGES="${EPREFIX}$(python_get_sit
edir)" |
| 125 } |
| 126 python_execute_function -s --source-dir python building |
| 127 fi |
| 128 } |
| 129 |
| 130 src_test() { |
| 131 default |
| 132 |
| 133 if use python; then |
| 134 testing() { |
| 135 emake test |
| 136 } |
| 137 python_execute_function -s --source-dir python testing |
| 138 fi |
| 139 } |
| 140 |
| 141 src_install() { |
| 142 emake DESTDIR="${D}" \ |
| 143 EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples \ |
| 144 install || die "Installation failed" |
| 145 |
| 146 # on windows, xmllint is installed by interix libxml2 in parent prefix. |
| 147 # this is the version to use. the native winnt version does not support |
| 148 # symlinks, which makes repoman fail if the portage tree is linked in |
| 149 # from another location (which is my default). -- mduft |
| 150 if [[ ${CHOST} == *-winnt* ]]; then |
| 151 rm -rf "${ED}"/usr/bin/xmllint |
| 152 rm -rf "${ED}"/usr/bin/xmlcatalog |
| 153 fi |
| 154 |
| 155 if use python; then |
| 156 installation() { |
| 157 emake DESTDIR="${D}" \ |
| 158 PYTHON_SITE_PACKAGES="${EPREFIX}$(python_get_sit
edir)" \ |
| 159 docsdir="${EPREFIX}"/usr/share/doc/${PF}/python
\ |
| 160 exampledir="${EPREFIX}"/usr/share/doc/${PF}/pyth
on/examples \ |
| 161 install |
| 162 } |
| 163 python_execute_function -s --source-dir python installation |
| 164 |
| 165 python_clean_installation_image |
| 166 fi |
| 167 |
| 168 rm -rf "${ED}"/usr/share/doc/${P} |
| 169 dodoc AUTHORS ChangeLog Copyright NEWS README* TODO* || die "dodoc faile
d" |
| 170 |
| 171 if ! use python; then |
| 172 rm -rf "${ED}"/usr/share/doc/${PF}/python |
| 173 rm -rf "${ED}"/usr/share/doc/${PN}-python-${PV} |
| 174 fi |
| 175 |
| 176 if ! use doc; then |
| 177 rm -rf "${ED}"/usr/share/gtk-doc |
| 178 rm -rf "${ED}"/usr/share/doc/${PF}/html |
| 179 fi |
| 180 |
| 181 if ! use examples; then |
| 182 rm -rf "${ED}/usr/share/doc/${PF}/examples" |
| 183 rm -rf "${ED}/usr/share/doc/${PF}/python/examples" |
| 184 fi |
| 185 } |
| 186 |
| 187 pkg_postinst() { |
| 188 if use python; then |
| 189 python_mod_optimize drv_libxml2.py libxml2.py |
| 190 fi |
| 191 |
| 192 # We don't want to do the xmlcatalog during stage1, as xmlcatalog will n
ot |
| 193 # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208
887. |
| 194 if [ "${ROOT}" != "/" ] |
| 195 then |
| 196 elog "Skipping XML catalog creation for stage building (bug #208
887)." |
| 197 else |
| 198 # need an XML catalog, so no-one writes to a non-existent one |
| 199 CATALOG="${EROOT}etc/xml/catalog" |
| 200 |
| 201 # we dont want to clobber an existing catalog though, |
| 202 # only ensure that one is there |
| 203 # <obz@gentoo.org> |
| 204 if [ ! -e ${CATALOG} ]; then |
| 205 [ -d "${EROOT}etc/xml" ] || mkdir -p "${EROOT}etc/xml" |
| 206 "${EPREFIX}"/usr/bin/xmlcatalog --create > ${CATALOG} |
| 207 einfo "Created XML catalog in ${CATALOG}" |
| 208 fi |
| 209 fi |
| 210 } |
| 211 |
| 212 pkg_postrm() { |
| 213 if use python; then |
| 214 python_mod_cleanup drv_libxml2.py libxml2.py |
| 215 fi |
| 216 } |
OLD | NEW |