diff options
author | Roy Li <rongqing.li@windriver.com> | 2014-07-15 08:42:38 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-07-22 00:02:01 +0200 |
commit | 743751e20cc266143130fb5bb49efb4c86b9e02b (patch) | |
tree | e7cd520986b81d905ea0efc7fdec07b5a5e54c7c /meta-perl | |
parent | 764c5c07165848a7821cf835925331dc3fa27384 (diff) | |
download | meta-openembedded-743751e20cc266143130fb5bb49efb4c86b9e02b.tar.gz |
libxml-libxml-perl: add recipe
This module is an interface to libxml2, providing XML and HTML parsers \
with DOM, SAX and XMLReader interfaces, a large subset of DOM Layer 3 \
interface and a XML::XPath-like interface to XPath API of libxml2. \
The module is split into several packages which are not described in this \
section; unless stated otherwise, you only need to use XML::LibXML; in \
your programs.
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Acked-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-perl')
4 files changed, 248 insertions, 0 deletions
diff --git a/meta-perl/recipes-perl/libxml/libxml-libxml-perl/disable-libxml2-check.patch b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/disable-libxml2-check.patch new file mode 100644 index 000000000..a8e7cc1bb --- /dev/null +++ b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/disable-libxml2-check.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | Do not use the _libxml_check_lib() on cross-compile | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | xml2 have been added into package's DEPENDS, so not need to use the | ||
6 | _libxml_check_lib() to check it again, and _libxml_check_lib() always | ||
7 | return false on cross-compile environment | ||
8 | |||
9 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
10 | --- | ||
11 | Makefile.PL | 52 ++++++++++++++++++++++++++-------------------------- | ||
12 | 1 file changed, 26 insertions(+), 26 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile.PL b/Makefile.PL | ||
15 | index c0485f1..09c676b 100644 | ||
16 | --- a/Makefile.PL | ||
17 | +++ b/Makefile.PL | ||
18 | @@ -411,32 +411,32 @@ sub _libxml_check_lib { | ||
19 | } | ||
20 | } | ||
21 | |||
22 | -print "Checking for ability to link against xml2..."; | ||
23 | -if ( _libxml_check_lib('xml2') ) { | ||
24 | - print "yes\n"; | ||
25 | -} | ||
26 | -else { | ||
27 | - print "no\n"; | ||
28 | - print "Checking for ability to link against libxml2..."; | ||
29 | - if ( _libxml_check_lib('libxml2')) { | ||
30 | - print "yes\n"; | ||
31 | - } | ||
32 | - else { | ||
33 | - print STDERR <<"DEATH"; | ||
34 | -libxml2, zlib, and/or the Math library (-lm) have not been found. | ||
35 | -Try setting LIBS and INC values on the command line | ||
36 | -Or get libxml2 from | ||
37 | - http://xmlsoft.org/ | ||
38 | -If you install via RPMs, make sure you also install the -devel | ||
39 | -RPMs, as this is where the headers (.h files) are. | ||
40 | - | ||
41 | -Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter | ||
42 | -to see the exact reason why the detection of libxml2 installation | ||
43 | -failed or why Makefile.PL was not able to compile a test program. | ||
44 | -DEATH | ||
45 | - exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors) | ||
46 | - } | ||
47 | -} | ||
48 | +#print "Checking for ability to link against xml2..."; | ||
49 | +#if ( _libxml_check_lib('xml2') ) { | ||
50 | +# print "yes\n"; | ||
51 | +#} | ||
52 | +#else { | ||
53 | +# print "no\n"; | ||
54 | +# print "Checking for ability to link against libxml2..."; | ||
55 | +# if ( _libxml_check_lib('libxml2')) { | ||
56 | +# print "yes\n"; | ||
57 | +# } | ||
58 | +# else { | ||
59 | +# print STDERR <<"DEATH"; | ||
60 | +#libxml2, zlib, and/or the Math library (-lm) have not been found. | ||
61 | +#Try setting LIBS and INC values on the command line | ||
62 | +#Or get libxml2 from | ||
63 | +# http://xmlsoft.org/ | ||
64 | +#If you install via RPMs, make sure you also install the -devel | ||
65 | +#RPMs, as this is where the headers (.h files) are. | ||
66 | +# | ||
67 | +#Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter | ||
68 | +#to see the exact reason why the detection of libxml2 installation | ||
69 | +#failed or why Makefile.PL was not able to compile a test program. | ||
70 | +#DEATH | ||
71 | +# exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors) | ||
72 | +# } | ||
73 | +#} | ||
74 | |||
75 | # -------------------------------------------------------------------------- # | ||
76 | # _NOW_ write the Makefile | ||
77 | -- | ||
78 | 1.7.10.4 | ||
79 | |||
diff --git a/meta-perl/recipes-perl/libxml/libxml-libxml-perl/fix-CATALOG-conditional-compile.patch b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/fix-CATALOG-conditional-compile.patch new file mode 100644 index 000000000..1dd9fb375 --- /dev/null +++ b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/fix-CATALOG-conditional-compile.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | [PATCH] Fix a compile error | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Fix a compile error by conditional using 'catal' since catal | ||
6 | is only defined when LIBXML_CATALOG_ENABLED is enabled. | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | LibXML.xs | 2 ++ | ||
11 | 1 file changed, 2 insertions(+) | ||
12 | |||
13 | diff --git a/LibXML.xs b/LibXML.xs | ||
14 | index 66da04b..45da681 100644 | ||
15 | --- a/LibXML.xs | ||
16 | +++ b/LibXML.xs | ||
17 | @@ -2777,9 +2777,11 @@ _default_catalog( self, catalog ) | ||
18 | xmlCatalogPtr catal = INT2PTR(xmlCatalogPtr,SvIV(SvRV(catalog))); | ||
19 | #endif | ||
20 | INIT: | ||
21 | +#ifdef LIBXML_CATALOG_ENABLED | ||
22 | if ( catal == NULL ) { | ||
23 | croak( "empty catalog\n" ); | ||
24 | } | ||
25 | +#endif | ||
26 | CODE: | ||
27 | warn( "this feature is not implemented" ); | ||
28 | RETVAL = 0; | ||
29 | -- | ||
30 | 1.7.10.4 | ||
31 | |||
diff --git a/meta-perl/recipes-perl/libxml/libxml-libxml-perl/using-DOCB-conditional.patch b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/using-DOCB-conditional.patch new file mode 100644 index 000000000..d255ec753 --- /dev/null +++ b/meta-perl/recipes-perl/libxml/libxml-libxml-perl/using-DOCB-conditional.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | [PATCH] Fix a compile error | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | by conditional using 'XML_DOCB_DOCUMENT_NODE' since it is only | ||
6 | defined when LIBXML_DOCB_ENABLED is enabled in xmlversion.h. | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | LibXML.xs | 9 +- | ||
11 | dom.c | 2 + | ||
12 | perl-libxml-mm.c | 4 + | ||
13 | 4 files changed, 678 insertions(+), 658 deletions(-) | ||
14 | |||
15 | diff --git a/LibXML.xs b/LibXML.xs | ||
16 | index b299ba4..66da04b 100644 | ||
17 | --- a/LibXML.xs | ||
18 | +++ b/LibXML.xs | ||
19 | @@ -5026,7 +5026,9 @@ addChild( self, nNode ) | ||
20 | XSRETURN_UNDEF; | ||
21 | case XML_DOCUMENT_NODE : | ||
22 | case XML_HTML_DOCUMENT_NODE : | ||
23 | +#ifdef LIBXML_DOCB_ENABLED | ||
24 | case XML_DOCB_DOCUMENT_NODE : | ||
25 | +#endif | ||
26 | croak("addChild: HIERARCHY_REQUEST_ERR\n"); | ||
27 | XSRETURN_UNDEF; | ||
28 | case XML_NOTATION_NODE : | ||
29 | @@ -5286,7 +5288,9 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list | ||
30 | if ( nodepath == NULL | ||
31 | && self->type != XML_DOCUMENT_NODE | ||
32 | && self->type != XML_HTML_DOCUMENT_NODE | ||
33 | +#ifdef LIBXML_DOCB_ENABLED | ||
34 | && self->type != XML_DOCB_DOCUMENT_NODE | ||
35 | +#endif | ||
36 | ) { | ||
37 | if (comments) | ||
38 | nodepath = xmlStrdup( (const xmlChar *) "(. | .//node() | .//@* | .//namespace::*)" ); | ||
39 | @@ -5297,7 +5301,10 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list | ||
40 | if ( nodepath != NULL ) { | ||
41 | if ( self->type == XML_DOCUMENT_NODE | ||
42 | || self->type == XML_HTML_DOCUMENT_NODE | ||
43 | - || self->type == XML_DOCB_DOCUMENT_NODE ) { | ||
44 | +#ifdef LIBXML_DOCB_ENABLED | ||
45 | + || self->type == XML_DOCB_DOCUMENT_NODE | ||
46 | +#endif | ||
47 | + ) { | ||
48 | refNode = xmlDocGetRootElement( self->doc ); | ||
49 | } | ||
50 | if (SvOK(xpath_context)) { | ||
51 | diff --git a/dom.c b/dom.c | ||
52 | index 87eb61d..cbd391b 100644 | ||
53 | --- a/dom.c | ||
54 | +++ b/dom.c | ||
55 | @@ -654,7 +654,9 @@ domName(xmlNodePtr node) { | ||
56 | |||
57 | case XML_DOCUMENT_NODE : | ||
58 | case XML_HTML_DOCUMENT_NODE : | ||
59 | +#ifdef LIBXML_DOCB_ENABLED | ||
60 | case XML_DOCB_DOCUMENT_NODE : | ||
61 | +#endif | ||
62 | name = (const xmlChar *) "#document"; | ||
63 | break; | ||
64 | |||
65 | diff --git a/perl-libxml-mm.c b/perl-libxml-mm.c | ||
66 | index d162b06..7ac5436 100644 | ||
67 | --- a/perl-libxml-mm.c | ||
68 | +++ b/perl-libxml-mm.c | ||
69 | @@ -331,7 +331,9 @@ PmmNewNode(xmlNodePtr node) | ||
70 | switch ( node->type ) { | ||
71 | case XML_DOCUMENT_NODE: | ||
72 | case XML_HTML_DOCUMENT_NODE: | ||
73 | +#ifdef LIBXML_DOCB_ENABLED | ||
74 | case XML_DOCB_DOCUMENT_NODE: | ||
75 | +#endif | ||
76 | proxy = (ProxyNodePtr)xmlMalloc(sizeof(struct _DocProxyNode)); | ||
77 | if (proxy != NULL) { | ||
78 | ((DocProxyNodePtr)proxy)->psvi_status = Pmm_NO_PSVI; | ||
79 | @@ -550,7 +552,9 @@ PmmNodeToSv( xmlNodePtr node, ProxyNodePtr owner ) | ||
80 | switch ( node->type ) { | ||
81 | case XML_DOCUMENT_NODE: | ||
82 | case XML_HTML_DOCUMENT_NODE: | ||
83 | +#ifdef LIBXML_DOCB_ENABLED | ||
84 | case XML_DOCB_DOCUMENT_NODE: | ||
85 | +#endif | ||
86 | if ( ((xmlDocPtr)node)->encoding != NULL ) { | ||
87 | SetPmmENCODING(dfProxy, (int)xmlParseCharEncoding( (const char*)((xmlDocPtr)node)->encoding )); | ||
88 | } | ||
89 | -- | ||
90 | 1.7.10.4 | ||
91 | |||
diff --git a/meta-perl/recipes-perl/libxml/libxml-libxml-perl_2.0116.bb b/meta-perl/recipes-perl/libxml/libxml-libxml-perl_2.0116.bb new file mode 100644 index 000000000..2a6dbc280 --- /dev/null +++ b/meta-perl/recipes-perl/libxml/libxml-libxml-perl_2.0116.bb | |||
@@ -0,0 +1,47 @@ | |||
1 | SUMMARY = "Perl interface to the libxml2 library" | ||
2 | DESCRIPTION = "This module is an interface to libxml2, providing XML and HTML parsers \ | ||
3 | with DOM, SAX and XMLReader interfaces, a large subset of DOM Layer 3 \ | ||
4 | interface and a XML::XPath-like interface to XPath API of libxml2. \ | ||
5 | The module is split into several packages which are not described in this \ | ||
6 | section; unless stated otherwise, you only need to use XML::LibXML; in \ | ||
7 | your programs." | ||
8 | |||
9 | HOMEPAGE = "http://search.cpan.org/dist/XML-LibXML-1.99/" | ||
10 | SECTION = "libs" | ||
11 | LICENSE = "Artistic-1.0|GPLv1+" | ||
12 | DEPENDS += "libxml2 \ | ||
13 | libxml-sax-perl-native \ | ||
14 | zlib \ | ||
15 | " | ||
16 | RDEPENDS_${PN} += "libxml2 \ | ||
17 | libxml-sax-perl \ | ||
18 | libxml-sax-base-perl \ | ||
19 | zlib \ | ||
20 | " | ||
21 | |||
22 | SRC_URI = "http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/XML-LibXML-${PV}.tar.gz;name=libxml \ | ||
23 | file://disable-libxml2-check.patch \ | ||
24 | file://fix-CATALOG-conditional-compile.patch \ | ||
25 | file://using-DOCB-conditional.patch \ | ||
26 | " | ||
27 | LIC_FILES_CHKSUM = "file://debian/copyright;md5=75e021e35a906347f46c9ff163653e2a \ | ||
28 | file://LICENSE;md5=97871bde150daeb5e61ad95137ff2446" | ||
29 | SRC_URI[libxml.md5sum] = "a53a743bf053a0cb4afb41513fb8a684" | ||
30 | SRC_URI[libxml.sha256sum] = "b154f2dad3033b30d22ac81b8985b69ad35450b0c552db394cd03bb36845812a" | ||
31 | |||
32 | S = "${WORKDIR}/XML-LibXML-${PV}" | ||
33 | |||
34 | inherit cpan | ||
35 | |||
36 | EXTRA_CPANFLAGS = "INC=-I${STAGING_INCDIR}/libxml2 LIBS=-L${STAGING_LIBDIR}" | ||
37 | |||
38 | BBCLASSEXTEND = "native" | ||
39 | |||
40 | CFLAGS += " -D_GNU_SOURCE " | ||
41 | BUILD_CFLAGS += " -D_GNU_SOURCE " | ||
42 | |||
43 | do_configure_prepend() { | ||
44 | rm -rf ${S}/.pc/* | ||
45 | } | ||
46 | |||
47 | FILES_${PN}-dbg =+ "${libdir}/perl/vendor_perl/*/auto/XML/LibXML/.debug/" | ||