From e26d223930a259f1e8183cf3b389e422d6741f73 Mon Sep 17 00:00:00 2001 From: Pacho Ramos Date: Sat, 12 Feb 2011 11:27:22 +0000 Subject: Apply fixes for PREFIX support (bug #317891), thanks a lot to Fabian Groffen for the patch. (Portage version: 2.1.9.39/cvs/Linux x86_64) --- dev-libs/libxml2/ChangeLog | 8 ++- .../libxml2/files/libxml2-2.7.1-catalog_path.patch | 66 ++++++++++++++++++++ dev-libs/libxml2/files/libxml2-2.7.2-winnt.patch | 72 ++++++++++++++++++++++ dev-libs/libxml2/libxml2-2.7.8.ebuild | 41 ++++++++---- 4 files changed, 173 insertions(+), 14 deletions(-) create mode 100644 dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch create mode 100644 dev-libs/libxml2/files/libxml2-2.7.2-winnt.patch (limited to 'dev-libs') diff --git a/dev-libs/libxml2/ChangeLog b/dev-libs/libxml2/ChangeLog index a453920012e3..b60da09cabc5 100644 --- a/dev-libs/libxml2/ChangeLog +++ b/dev-libs/libxml2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-libs/libxml2 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/ChangeLog,v 1.296 2011/02/11 17:30:19 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/ChangeLog,v 1.297 2011/02/12 11:27:21 pacho Exp $ + + 12 Feb 2011; Pacho Ramos + +files/libxml2-2.7.1-catalog_path.patch, +files/libxml2-2.7.2-winnt.patch, + libxml2-2.7.8.ebuild: + Apply fixes for PREFIX support (bug #317891), thanks a lot to Fabian Groffen + for the patch. *libxml2-2.7.8 (11 Feb 2011) diff --git a/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch b/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch new file mode 100644 index 000000000000..25ea47832b0e --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch @@ -0,0 +1,66 @@ +--- catalog.c ++++ catalog.c +@@ -68,10 +68,10 @@ + #define XML_URN_PUBID "urn:publicid:" + #define XML_CATAL_BREAK ((xmlChar *) -1) + #ifndef XML_XML_DEFAULT_CATALOG +-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" ++#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog" + #endif + #ifndef XML_SGML_DEFAULT_CATALOG +-#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog" ++#define XML_SGML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog" + #endif + + #if defined(_WIN32) && defined(_MSC_VER) +@@ -76,7 +76,7 @@ + + #if defined(_WIN32) && defined(_MSC_VER) + #undef XML_XML_DEFAULT_CATALOG +-static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog"; ++static char XML_XML_DEFAULT_CATALOG[256] = "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"; + #if defined(_WIN32_WCE) + /* Windows CE don't have a A variant */ + #define GetModuleHandleA GetModuleHandle +--- xmlcatalog.c ++++ xmlcatalog.c +@@ -43,7 +43,7 @@ + + + #ifndef XML_SGML_DEFAULT_CATALOG +-#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog" ++#define XML_SGML_DEFAULT_CATALOG "@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog" + #endif + + /************************************************************************ +--- runtest.c ++++ runtest.c +@@ -2747,7 +2747,7 @@ + */ + static int + uripMatch(const char * URI) { +- if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog"))) ++ if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"))) + return(0); + /* Verify we received the escaped URL */ + if (strcmp(urip_rcvsURLs[urip_current], URI)) +@@ -2766,7 +2766,7 @@ + */ + static void * + uripOpen(const char * URI) { +- if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog"))) ++ if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"))) + return(NULL); + /* Verify we received the escaped URL */ + if (strcmp(urip_rcvsURLs[urip_current], URI)) +--- xmllint.c ++++ xmllint.c +@@ -103,7 +103,7 @@ + #endif + + #ifndef XML_XML_DEFAULT_CATALOG +-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" ++#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog" + #endif + + typedef enum { diff --git a/dev-libs/libxml2/files/libxml2-2.7.2-winnt.patch b/dev-libs/libxml2/files/libxml2-2.7.2-winnt.patch new file mode 100644 index 000000000000..0121e045c9d1 --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.2-winnt.patch @@ -0,0 +1,72 @@ +diff -ru -x '*.Po' -x '*.Plo' libxml2-2.7.2.orig/dict.c libxml2-2.7.2/dict.c +--- libxml2-2.7.2.orig/dict.c 2008-11-20 11:16:34 +0100 ++++ libxml2-2.7.2/dict.c 2008-11-20 09:50:19 +0100 +@@ -25,7 +25,7 @@ + #else + #ifdef HAVE_INTTYPES_H + #include +-#elif defined(WIN32) ++#elif defined(WIN32) || defined (__PARITY__) + typedef unsigned __int32 uint32_t; + #endif + #endif +diff -ru -x '*.Po' -x '*.Plo' libxml2-2.7.2.orig/include/wsockcompat.h libxml2-2.7.2/include/wsockcompat.h +--- libxml2-2.7.2.orig/include/wsockcompat.h 2008-11-20 11:16:34 +0100 ++++ libxml2-2.7.2/include/wsockcompat.h 2008-11-20 09:50:19 +0100 +@@ -26,7 +26,7 @@ + #endif + #endif + +-#ifdef __MINGW32__ ++#if defined(__MINGW32__) || defined(__PARITY__) + /* Include here to ensure that it doesn't get included later + * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ + #include +diff -ru -x '*.Po' -x '*.Plo' libxml2-2.7.2.orig/nanohttp.c libxml2-2.7.2/nanohttp.c +--- libxml2-2.7.2.orig/nanohttp.c 2008-11-20 11:16:34 +0100 ++++ libxml2-2.7.2/nanohttp.c 2008-11-20 09:50:19 +0100 +@@ -82,6 +82,9 @@ + #define XML_SOCKLEN_T unsigned int + #endif + ++#ifdef __PARITY__ ++# include ++#endif + + #include + #include +diff -ru -x '*.Po' -x '*.Plo' libxml2-2.7.2.orig/xmlIO.c libxml2-2.7.2/xmlIO.c +--- libxml2-2.7.2.orig/xmlIO.c 2008-11-20 10:11:21 +0100 ++++ libxml2-2.7.2/xmlIO.c 2008-11-20 10:54:34 +0100 +@@ -44,6 +44,7 @@ + #include /* for CP_UTF8 */ + #endif + ++#ifndef __PARITY__ + /* Figure a portable way to know if a file is a directory. */ + #ifndef HAVE_STAT + # ifdef HAVE__STAT +@@ -79,6 +80,7 @@ + # endif + # endif + #endif ++#endif /* __PARITY__ */ + + #include + #include +@@ -626,6 +628,7 @@ + { + #ifdef HAVE_STAT + int retval = -1; ++#ifndef __PARITY__ + wchar_t *wPath; + + wPath = __xmlIOWin32UTF8ToWChar(path); +@@ -634,6 +637,7 @@ + retval = _wstat(wPath,info); + xmlFree(wPath); + } ++#endif + /* maybe path in native encoding */ + if(retval < 0) + retval = stat(path,info); diff --git a/dev-libs/libxml2/libxml2-2.7.8.ebuild b/dev-libs/libxml2/libxml2-2.7.8.ebuild index df3402309614..8decb1cb0935 100644 --- a/dev-libs/libxml2/libxml2-2.7.8.ebuild +++ b/dev-libs/libxml2/libxml2-2.7.8.ebuild @@ -1,19 +1,19 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.7.8.ebuild,v 1.1 2011/02/11 17:30:19 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.7.8.ebuild,v 1.2 2011/02/12 11:27:21 pacho Exp $ EAPI="3" SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="3.* *-jython" -inherit libtool flag-o-matic eutils python autotools +inherit libtool flag-o-matic eutils python autotools prefix DESCRIPTION="Version 2 of the library to manipulate XML files" HOMEPAGE="http://www.xmlsoft.org/" LICENSE="MIT" SLOT="2" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +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-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" IUSE="debug doc examples icu ipv6 python readline test" XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite" @@ -56,6 +56,12 @@ src_unpack() { } src_prepare() { + # Patches needed for prefix support + epatch "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch + epatch "${FILESDIR}"/${PN}-2.7.2-winnt.patch + + eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c + epunt_cxx # Reactivate the shared library versionning script @@ -89,9 +95,9 @@ src_configure() { # --with-mem-debug causes unusual segmentation faults (bug #105120). - local myconf="--with-zlib + local myconf="--with-zlib=${EPREFIX}/usr --with-html-subdir=${PF}/html - --docdir=/usr/share/doc/${PF} + --docdir=${EPREFIX}/usr/share/doc/${PF} $(use_with debug run-debug) $(use_with icu) $(use_with python) @@ -111,8 +117,8 @@ src_compile() { if use python; then python_copy_sources python building() { - emake PYTHON_INCLUDES="$(python_get_includedir)" \ - PYTHON_SITE_PACKAGES="$(python_get_sitedir)" + emake PYTHON_INCLUDES="${EPREFIX}$(python_get_includedir)" \ + PYTHON_SITE_PACKAGES="${EPREFIX}$(python_get_sitedir)" } python_execute_function -s --source-dir python building fi @@ -131,15 +137,24 @@ src_test() { src_install() { emake DESTDIR="${D}" \ - EXAMPLES_DIR=/usr/share/doc/${PF}/examples \ + EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples \ install || die "Installation failed" + # on windows, xmllint is installed by interix libxml2 in parent prefix. + # this is the version to use. the native winnt version does not support + # symlinks, which makes repoman fail if the portage tree is linked in + # from another location (which is my default). -- mduft + if [[ ${CHOST} == *-winnt* ]]; then + rm -rf "${ED}"/usr/bin/xmllint + rm -rf "${ED}"/usr/bin/xmlcatalog + fi + if use python; then installation() { emake DESTDIR="${D}" \ - PYTHON_SITE_PACKAGES="$(python_get_sitedir)" \ - docsdir=/usr/share/doc/${PF}/python \ - exampledir=/usr/share/doc/${PF}/python/examples \ + PYTHON_SITE_PACKAGES="${EPREFIX}$(python_get_sitedir)" \ + docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \ + exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \ install } python_execute_function -s --source-dir python installation @@ -173,7 +188,7 @@ pkg_postinst() { # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887. - if [ "${EROOT}" != "/" ] + if [ "${ROOT}" != "/" ] then elog "Skipping XML catalog creation for stage building (bug #208887)." else @@ -185,7 +200,7 @@ pkg_postinst() { # if [ ! -e ${CATALOG} ]; then [ -d "${EROOT}etc/xml" ] || mkdir -p "${EROOT}etc/xml" - /usr/bin/xmlcatalog --create > ${CATALOG} + "${EPREFIX}"/usr/bin/xmlcatalog --create > ${CATALOG} einfo "Created XML catalog in ${CATALOG}" fi fi -- cgit v1.2.3-65-gdbad