summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authortsarna <tsarna>1999-12-30 21:37:02 +0000
committertsarna <tsarna>1999-12-30 21:37:02 +0000
commit4a33a6bc8364e71a3fe11369f61e2ec7e2527475 (patch)
tree91cb703e9969af15b61778b122b97e83dc416237 /lang
parent229586148a8822dd52132a962988b162f208a881 (diff)
downloadpkgsrc-4a33a6bc8364e71a3fe11369f61e2ec7e2527475.tar.gz
Extension Classes for Python, pulled from Zope 2.1.1 as they (and
especially Acquisition) can be quite useful in their own right. EC fixes a wart in CPython: Python classes can't use C-implemented types as base classes. EC-based C classes can be subclassed by python, and in fact python classes can use pure mixin EC C classes so that you can have speed critical methods of a class in C and the rest in Python. EC also provides a mixin called Acquisition, which provides a kind of contextual inheritance. If an object can't find the data/method in itself or by looking up it's list of base classes, it will then try to acquire the thing up through its containers (or other context).
Diffstat (limited to 'lang')
-rw-r--r--lang/py-extclass/Makefile42
-rw-r--r--lang/py-extclass/files/md53
-rw-r--r--lang/py-extclass/pkg/COMMENT1
-rw-r--r--lang/py-extclass/pkg/DESCR17
-rw-r--r--lang/py-extclass/pkg/PLIST29
5 files changed, 92 insertions, 0 deletions
diff --git a/lang/py-extclass/Makefile b/lang/py-extclass/Makefile
new file mode 100644
index 00000000000..d778b2d96b3
--- /dev/null
+++ b/lang/py-extclass/Makefile
@@ -0,0 +1,42 @@
+# $NetBSD: Makefile,v 1.1.1.1 1999/12/30 21:37:02 tsarna Exp $
+#
+
+DISTNAME= Zope-2.1.1-src
+PKGNAME= py-extclass-2.1.1
+CATEGORIES= www
+MASTER_SITES= http://www.zope.org/Products/Zope/2.1.1/
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= tsarna@netbsd.org
+HOMEPAGE= http://www.digicool.com/releases/ExtensionClass
+
+DEPENDS+= python-1.5.2:../../lang/python
+
+ALL_TARGET= default
+PYTHON_LIBDIR= ${LOCALBASE}/lib/python1.5/site-packages
+PYTHON_CONFIGDIR= ${LOCALBASE}/lib/python1.5/config
+EXTRACT_ELEMENTS= Zope-2.1.1-src/lib/Components/ExtensionClass
+
+WRKSRC= ${WRKDIR}/Zope-2.1.1-src/lib/Components/ExtensionClass
+
+do-configure:
+ ( cd ${WRKSRC} ;\
+ ${CP} ${PYTHON_CONFIGDIR}/Makefile.pre.in . ;\
+ ${MAKE} -f Makefile.pre.in boot)
+
+post-build:
+ (cd ${WRKSRC}; ${LOCALBASE}/bin/python ${PREFIX}/lib/python1.5/compileall.py .)
+ (cd ${WRKSRC}; ${LOCALBASE}/bin/python -O ${PREFIX}/lib/python1.5/compileall.py .)
+
+do-install:
+ (cd ${WRKSRC}; ${INSTALL_DATA} ExtensionClass.h \
+ ${LOCALBASE}/include/python1.5 ; \
+ ${INSTALL_SCRIPT} Xaq.py* ComputedAttribute.py* ${PYTHON_LIBDIR} ; \
+ ${INSTALL_PROGRAM} *.so ${PYTHON_LIBDIR} ; \
+ ${INSTALL_SCRIPT_DIR} ${PYTHON_LIBDIR}/extclass_test ; \
+ ${INSTALL_SCRIPT} test_*.py* ${PYTHON_LIBDIR}/extclass_test ; \
+ ${INSTALL_DATA_DIR} ${PYTHON_LIBDIR}/extclass_doc ; \
+ ${INSTALL_DATA} *.txt *.stx ${PYTHON_LIBDIR}/extclass_doc)
+
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/py-extclass/files/md5 b/lang/py-extclass/files/md5
new file mode 100644
index 00000000000..65b213d151d
--- /dev/null
+++ b/lang/py-extclass/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 1999/12/30 21:37:02 tsarna Exp $
+
+MD5 (Zope-2.1.1-src.tgz) = 170e9304b2b2ee271eb0f8a0aa768fc9
diff --git a/lang/py-extclass/pkg/COMMENT b/lang/py-extclass/pkg/COMMENT
new file mode 100644
index 00000000000..936b66ac844
--- /dev/null
+++ b/lang/py-extclass/pkg/COMMENT
@@ -0,0 +1 @@
+Python-extensible C "classes" and Acquisition for Python
diff --git a/lang/py-extclass/pkg/DESCR b/lang/py-extclass/pkg/DESCR
new file mode 100644
index 00000000000..0ef5da230f6
--- /dev/null
+++ b/lang/py-extclass/pkg/DESCR
@@ -0,0 +1,17 @@
+ExtensionClasses is a lightweight mechanism has been developed for
+making Python extension types more class-like. Classes can be developed
+in an extension language, such as C or C++, and these classes can be
+treated like other python classes. They can be sub-classed in python,
+they provide access to method documentation strings, and they can be
+used to directly create new instances.
+
+Extension classes provide additional extensions to class and instance
+semantics, including A protocol for accessing subobjects "in the context
+of" their containers. This is used to implement custom method types and
+environmental acquisition*. A protocol for overriding method call
+semantics. This is used to implement "synchonized" classes and could be
+used to implement argument type checking. A protocol for class
+initialization that supports execution of a special __class_init__
+method after a class has been initialized.
+
+(* see http://www.digicool.com/releases/ExtensionClass/Acquisition.html)
diff --git a/lang/py-extclass/pkg/PLIST b/lang/py-extclass/pkg/PLIST
new file mode 100644
index 00000000000..41449d5bf09
--- /dev/null
+++ b/lang/py-extclass/pkg/PLIST
@@ -0,0 +1,29 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 1999/12/30 21:37:02 tsarna Exp $
+include/python1.5/ExtensionClass.h
+lib/python1.5/site-packages/Acquisition.so
+lib/python1.5/site-packages/ComputedAttribute.so
+lib/python1.5/site-packages/ComputedAttribute.py
+lib/python1.5/site-packages/ComputedAttribute.pyc
+lib/python1.5/site-packages/ComputedAttribute.pyo
+lib/python1.5/site-packages/ExtensionClass.so
+lib/python1.5/site-packages/MethodObject.so
+lib/python1.5/site-packages/Missing.so
+lib/python1.5/site-packages/MultiMapping.so
+lib/python1.5/site-packages/Record.so
+lib/python1.5/site-packages/Sync.so
+lib/python1.5/site-packages/ThreadLock.so
+lib/python1.5/site-packages/Xaq.py
+lib/python1.5/site-packages/Xaq.pyc
+lib/python1.5/site-packages/Xaq.pyo
+lib/python1.5/site-packages/extclass_doc/COPYRIGHT.txt
+lib/python1.5/site-packages/extclass_doc/Acquisition.stx
+lib/python1.5/site-packages/extclass_doc/ExtensionClass.stx
+lib/python1.5/site-packages/extclass_doc/MultiMapping.stx
+lib/python1.5/site-packages/extclass_test/test_Sync.py
+lib/python1.5/site-packages/extclass_test/test_ThreadLock.py
+lib/python1.5/site-packages/extclass_test/test_acquisition.py
+lib/python1.5/site-packages/extclass_test/test_add.py
+lib/python1.5/site-packages/extclass_test/test_binding.py
+lib/python1.5/site-packages/extclass_test/test_explicit_acquisition.py
+lib/python1.5/site-packages/extclass_test/test_func_attr.py
+lib/python1.5/site-packages/extclass_test/test_method_hook.py