Import py-cElementTree-0 as textproc/py-cElementTree.

The cElementTree module is a C implementation of the ElementTree API, optimized
for fast parsing and low memory use. On typical documents, cElementTree is 15-20
times faster than the Python version of ElementTree, and uses 2-5 times less
memory. On modern hardware, that means that documents in the 50-100 megabyte
range can be manipulated in memory, and that documents in the 0-1 megabyte range
load in zero time (0.0 seconds). This allows you to drastically simplify many
kinds of XML applications.
This commit is contained in:
obache 2010-04-11 12:41:45 +00:00
parent a8840ec099
commit cb46869c1e
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,7 @@
The cElementTree module is a C implementation of the ElementTree API, optimized
for fast parsing and low memory use. On typical documents, cElementTree is 15-20
times faster than the Python version of ElementTree, and uses 2-5 times less
memory. On modern hardware, that means that documents in the 50-100 megabyte
range can be manipulated in memory, and that documents in the 0-1 megabyte range
load in zero time (0.0 seconds). This allows you to drastically simplify many
kinds of XML applications.

View file

@ -0,0 +1,36 @@
# $NetBSD: Makefile,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $
#
PKGNAME= ${PYPKGPREFIX}-cElementTree-0
CATEGORIES= textproc python
MAINTAINER= obache@NetBSD.org
HOMEPAGE= http://www.effbot.org/zone/celementtree.htm
COMMENT= C implementation of Python ElementTree API
PKG_DESTDIR_SUPPORT= user-destdir
PYTHON_VERSIONS_ACCEPTED= 26 25
EXTRACT_ELEMENTS= ${PYSUBDIR}/Modules/_elementtree.c
USE_TOOLS+= patch
PYDISTUTILSPKG= yes
PY_PATCHPLIST= yes
PY_SETUP_SUBST+= EXPATPREFIX=${BUILDLINK_DIR}
PY_SETUP_SUBST+= EXPATRTPREFIX=${BUILDLINK_PREFIX.expat}
PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX:Q}
# ignore errors due to missing files (EXTRACT_ELEMENTS!)
do-patch:
(cd ${WRKSRC}; \
for f in ${PATCHDIR}/patch-*;do \
${PATCH} --batch <$$f || ${TRUE}; \
done)
.include "../../textproc/expat/buildlink3.mk"
.include "../../lang/python/extension.mk"
.include "../../lang/python/srcdist.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -0,0 +1,2 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $
${PYSITELIB}/_elementtree.so

View file

@ -0,0 +1,24 @@
# $NetBSD: setup.py,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $
import distutils
from distutils.core import setup, Extension
expatprefix = '@EXPATPREFIX@'
expatincl = expatprefix + '/include'
expatlib = expatprefix + '/lib'
expatrtprefix = '@EXPATPREFIX@'
expatrtlib = expatrtprefix + '/lib'
setup(
ext_modules = [
Extension(
'_elementtree',
['Modules/_elementtree.c'],
define_macros=[('USE_EXPAT', None)],
include_dirs=[expatincl],
library_dirs=[expatlib],
runtime_library_dirs=[expatrtlib],
libraries=['expat']
)
]
)