summaryrefslogtreecommitdiff
path: root/dev-python/pyplusplus
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/pyplusplus
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/pyplusplus')
-rw-r--r--dev-python/pyplusplus/Manifest7
-rw-r--r--dev-python/pyplusplus/files/pyplusplus-1.0.0_p20131206-numpy.patch179
-rw-r--r--dev-python/pyplusplus/metadata.xml18
-rw-r--r--dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild38
-rw-r--r--dev-python/pyplusplus/pyplusplus-1.0.0_p20131206.ebuild43
-rw-r--r--dev-python/pyplusplus/pyplusplus-9999.ebuild38
6 files changed, 323 insertions, 0 deletions
diff --git a/dev-python/pyplusplus/Manifest b/dev-python/pyplusplus/Manifest
new file mode 100644
index 000000000000..22e1d3fbb051
--- /dev/null
+++ b/dev-python/pyplusplus/Manifest
@@ -0,0 +1,7 @@
+AUX pyplusplus-1.0.0_p20131206-numpy.patch 9236 BLAKE2B 8a905f16fc5ae100b86dc31c6a11ac0d1bf760ce9e23e47cbd5c738f515b85b3df87edd5fe454121eac43ac2660978df46559b54f7fdf0f0629eab20ca128ae6 SHA512 173655e30525ad60b40a1fb42ca4179aa975622c02545c563658303c0cc56f48c6d0358104d91248cdf27d9dafeef340d4d491556af33fee56848ada21db4e97
+DIST pyplusplus-1.0.0.zip 7886416 BLAKE2B 38036de22b5f63f84ecee419474b30193e27abf884d1f3fa7aa5f6cb3815d5a32d480ba92c15046601e6578eb078b0e9705764f1cf2fbe4ecb693bf1345714be SHA512 04a9d6f06d8d22da9ac3b4ec1efdf001f0e4a2453ff5d70d6a15b808d7247ace630c4064ab2476a28ed3dede9cdb867c0650810a0c72a0a6474912fc7ef65812
+DIST pyplusplus-1.0.0_p20131206.tar.xz 2984232 BLAKE2B 0067e803544fc54c946e352943ca91de84f3ec8f8af0ef952b886b5b857e219b63779a2d3134ff9616ff7db688cfc8df043b97ecdae7b5667b9f771a53888777 SHA512 5cdf158477d6b93d1b579383657241c48d59ac17fd890016ac68d3b9ca8453726dabb8a7913f6139e24e93c691ead85adb99a6b20aa031603c6471df04fcfea6
+EBUILD pyplusplus-1.0.0-r1.ebuild 930 BLAKE2B 08d320a3c96bec9fa633596b300fb0169899a6370862d65376d9c40f3475e8b3b3bc7d62adc85a469ca924b37a04e04b9f3ad4dd55b4ae37542a4d81975861c5 SHA512 c3cd3c7ebb0001d29bc10b8e5294e746c87091daf2e98205aac94c4902fcfaf693172605082e39c172585baef2c86be4033f7b9d6b081e5ee8e0fbbf8dedfba8
+EBUILD pyplusplus-1.0.0_p20131206.ebuild 1034 BLAKE2B 9206e1c8a22f05dc0b23b3e8e4aefe37054f92681b7c121eecdff5741700d0ebe2052f81cec1ce21d6d9ce65ec9bb8aaa2c990cc749550edb8987221f3d0aaaf SHA512 2d60bf563bff733a9cfd5027bc100edf459b1d366f3ac71d6d32025be0c106e8333dbbb98d54a305dde717416836ae25043ddf03567e583159325edf27b656ad
+EBUILD pyplusplus-9999.ebuild 911 BLAKE2B 739340d0f36d933c7e69f3320461e70ce301141a7f473ee699f83b54d118fbda800122ede7eed2153adc23a89ed0d93b0041641c050ccadf1e051e92dc18c48b SHA512 2e34f2d25bcdeabd43ffd16c352d66eb1e91f5fa88084de4abcf4a958609d4c35da83137a1a9860204a32b9d9a11c69c3fc4df7134166b932dfbbe74cc4fc92a
+MISC metadata.xml 659 BLAKE2B 58c548f3ebadf970bb58afc20e15dd88d74d7093e29b27df0862a3a30c5b91bbb7427f4cb23497246a9f6ee54a217defccb9853d72ca3a25c63f0f52332599eb SHA512 d78333a1d7795b1d5f7b8e7e498235051e182993ce3db67133dfc098d6f25fe60b4ea7eda37e393d7253f444f42b18719b9e3ef41604c81b84cfbb626ae61692
diff --git a/dev-python/pyplusplus/files/pyplusplus-1.0.0_p20131206-numpy.patch b/dev-python/pyplusplus/files/pyplusplus-1.0.0_p20131206-numpy.patch
new file mode 100644
index 000000000000..bf33f3810948
--- /dev/null
+++ b/dev-python/pyplusplus/files/pyplusplus-1.0.0_p20131206-numpy.patch
@@ -0,0 +1,179 @@
+generate code for Boost.NumPy[1] to accelerate c 1D array handling
+
+Upstream: https://sourceforge.net/p/pygccxml/patches/2/
+
+Index: pyplusplus/code_creators/__init__.py
+===================================================================
+--- pyplusplus/code_creators/__init__.py.orig
++++ pyplusplus/code_creators/__init__.py
+@@ -110,6 +110,8 @@ from member_variable import bit_field_t
+ from member_variable import bit_field_wrapper_t
+ from member_variable import array_mv_t
+ from member_variable import array_mv_wrapper_t
++from member_variable import array_numpy_t
++from member_variable import array_numpy_wrapper_t
+ from member_variable import mem_var_ref_t
+ from member_variable import mem_var_ref_wrapper_t
+ from member_variable import member_variable_addressof_t
+Index: pyplusplus/code_creators/code_creator.py
+===================================================================
+--- pyplusplus/code_creators/code_creator.py.orig
++++ pyplusplus/code_creators/code_creator.py
+@@ -126,6 +126,7 @@ class code_creator_t(object):
+ files = []
+ if self.code_generator == self.CODE_GENERATOR_TYPES.BOOST_PYTHON:
+ files.append( "boost/python.hpp" )
++ files.append( "boost/numpy.hpp" )
+ files.append( code_repository.named_tuple.file_name )
+ else:
+ files.append( code_repository.ctypes_utils.file_name )
+Index: pyplusplus/code_creators/member_variable.py
+===================================================================
+--- pyplusplus/code_creators/member_variable.py.orig
++++ pyplusplus/code_creators/member_variable.py
+@@ -507,7 +507,95 @@ class array_mv_wrapper_t( code_creator.c
+ def _get_system_files_impl( self ):
+ return [code_repository.array_1.file_name]
+
++class array_numpy_t( member_variable_base_t ):
++ """
++ Creates boost.python code that exposes array member variable via boost.numpy.
++ """
++ def __init__(self, variable, wrapper ):
++ member_variable_base_t.__init__( self, variable=variable, wrapper=wrapper )
++ self.works_on_instance = False
++
++ def _create_body( self ):
++ answer = []
++ doc = ''
++ if self.declaration.type_qualifiers.has_static:
++ answer.append( self.parent.class_var_name + '.add_static_property' )
++ else:
++ if self.documentation:
++ doc = self.documentation
++ answer.append( self.parent.class_var_name + '.add_property' )
++ answer.append('( "%s", &%s );' % (self.declaration.name, self.wrapper.wrapper_creator_full_name ))
++ if doc:
++ answer.append( os.linesep )
++ answer.append( self.PARAM_SEPARATOR )
++ answer.append( doc )
++ return ''.join( answer )
++
++ def _create_impl( self ):
++ answer = []
++ answer.append( '{ //%s, type=%s' % ( self.declaration, self.declaration.type ) )
++ answer.append( os.linesep )
++ answer.append( self.indent( self._create_body() ) )
++ answer.append( os.linesep )
++ answer.append( '}' )
++ return ''.join( answer )
++
++ def _get_system_files_impl( self ):
++ return []
+
++class array_numpy_wrapper_t( code_creator.code_creator_t
++ , declaration_based.declaration_based_t ):
++ """registers array class"""
++ def __init__(self, variable ):
++ code_creator.code_creator_t.__init__( self )
++ declaration_based.declaration_based_t.__init__( self, declaration=variable)
++ self.py_class_type = declarations.reference_t(declarations.const_t(declarations.dummy_type_t( "bp::object" )))
++
++ @property
++ def wrapped_class_type( self ):
++ wrapped_cls_type = declarations.declarated_t( self.declaration.parent )
++ if declarations.is_const( self.declaration.type ):
++ wrapped_cls_type = declarations.const_t( wrapped_cls_type )
++ return declarations.reference_t( wrapped_cls_type )
++
++ @property
++ def wrapper_creator_name(self):
++ return '_'.join( ['pyplusplus', self.declaration.name, 'wrapper'] )
++
++ @property
++ def wrapper_creator_full_name(self):
++ return '::'.join( [self.parent.full_name, self.wrapper_creator_name] )
++
++ def _create_impl( self ):
++ if self.declaration.type_qualifiers.has_static:
++ tmpl = [ "static %(wrapper_type)s %(wrapper_creator_name)s( ){" ]
++ tmpl.append( self.indent( "return bn::from_data( %(parent_class_type)s::%(mem_var_ref)s," ) )
++ else:
++ tmpl = [ "static %(wrapper_type)s %(wrapper_creator_name)s( %(py_class_type)s inst ){" ]
++ tmpl.append( self.indent( "return bn::from_data(bp::extract< %(wrapped_class_type)s >(inst)().%(mem_var_ref)s," ) )
++ owner = "bp::object()"
++
++ tmpl.append( self.indent(self.indent("bn::dtype::get_builtin< %(item_type)s >(), bp::make_tuple(%(array_size)s),")) )
++ tmpl.append( self.indent(self.indent("bp::make_tuple(sizeof(%(item_type)s)), %(owner)s);")) )
++ tmpl.append( "}" )
++
++ tmpl = os.linesep.join( tmpl )
++
++ return tmpl % {
++ 'wrapper_type' : "bn::ndarray"
++ , 'parent_class_type' : self.parent.declaration.partial_decl_string
++ , 'wrapper_creator_name' : self.wrapper_creator_name
++ , 'wrapped_class_type' : self.wrapped_class_type.decl_string
++ , 'mem_var_ref' : self.declaration.name
++ , 'py_class_type' : self.py_class_type.decl_string
++ , 'item_type' : declarations.array_item_type( self.declaration.type ).decl_string
++ , 'array_size': declarations.array_size( self.declaration.type )
++ , 'owner': owner
++ }
++
++ def _get_system_files_impl( self ):
++ return []
++
+ class mem_var_ref_t( member_variable_base_t ):
+ """
+ creates get/set accessors for class member variable, that has type reference.
+Index: pyplusplus/code_creators/module_body.py
+===================================================================
+--- pyplusplus/code_creators/module_body.py.orig
++++ pyplusplus/code_creators/module_body.py
+@@ -18,6 +18,7 @@ class module_body_t(compound.compound_t)
+ def _create_impl(self):
+ result = []
+ result.append( "BOOST_PYTHON_MODULE(%s){" % self.name )
++ result.append( "bn::initialize();" )
+ result.append( compound.compound_t.create_internal_code( self.creators ) )
+ result.append( "}" )
+ return os.linesep.join( result )
+Index: pyplusplus/creators_factory/bpcreator.py
+===================================================================
+--- pyplusplus/creators_factory/bpcreator.py.orig
++++ pyplusplus/creators_factory/bpcreator.py
+@@ -76,10 +76,14 @@ class bpcreator_t( declarations.decl_vis
+ global_ns = declarations.get_global_namespace(decls)
+
+ self.__extmodule = code_creators.bpmodule_t( global_ns )
+- if boost_python_ns_name:
+- bp_ns_alias = code_creators.namespace_alias_t( alias=boost_python_ns_name
+- , full_namespace_name='::boost::python' )
+- self.__extmodule.adopt_creator( bp_ns_alias )
++
++ # alias of boost::numpy is hard-coded here, as it will be merged into boost::python.
++ for ns_name, full_ns_name in {boost_python_ns_name: '::boost::python'
++ , 'bn': '::boost::numpy'}.iteritems():
++ if ns_name:
++ ns_alias = code_creators.namespace_alias_t( alias=ns_name
++ , full_namespace_name=full_ns_name )
++ self.__extmodule.adopt_creator( ns_alias )
+
+ self.__module_body = code_creators.module_body_t( name=module_name )
+
+@@ -723,8 +727,12 @@ class bpcreator_t( declarations.decl_vis
+ wrapper = code_creators.bit_field_wrapper_t( variable=self.curr_decl )
+ maker = code_creators.bit_field_t( variable=self.curr_decl, wrapper=wrapper )
+ elif declarations.is_array( self.curr_decl.type ):
+- wrapper = code_creators.array_mv_wrapper_t( variable=self.curr_decl )
+- maker = code_creators.array_mv_t( variable=self.curr_decl, wrapper=wrapper )
++ if declarations.is_arithmetic(declarations.array_item_type( self.curr_decl.type )):
++ wrapper = code_creators.array_numpy_wrapper_t( variable=self.curr_decl )
++ maker = code_creators.array_numpy_t( variable=self.curr_decl, wrapper=wrapper )
++ else:
++ wrapper = code_creators.array_mv_wrapper_t( variable=self.curr_decl )
++ maker = code_creators.array_mv_t( variable=self.curr_decl, wrapper=wrapper )
+ elif declarations.is_pointer( self.curr_decl.type ):
+ wrapper = code_creators.member_variable_wrapper_t( variable=self.curr_decl )
+ maker = code_creators.member_variable_t( variable=self.curr_decl, wrapper=wrapper )
diff --git a/dev-python/pyplusplus/metadata.xml b/dev-python/pyplusplus/metadata.xml
new file mode 100644
index 000000000000..bccf49925aac
--- /dev/null
+++ b/dev-python/pyplusplus/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>heroxbd@gentoo.org</email>
+ <name>Benda Xu</name>
+ </maintainer>
+ <longdescription>pyplusplus is an object-oriented framework for creating a code generator for boost.python library.</longdescription>
+ <use>
+ <flag name="indexing"> Install indexing_suite_v2 to enhance boost python
+ </flag>
+ <flag name="numpy"> Generate code for <pkg>dev-libs/boost-numpy </pkg> to accelerate arrays
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">pygccxml</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild b/dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..5dd33d23d6df
--- /dev/null
+++ b/dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Object-oriented framework for creating a code generator for Boost.Python library"
+HOMEPAGE="http://www.language-binding.net/"
+SRC_URI="mirror://sourceforge/pygccxml/${P}.zip"
+
+LICENSE="freedist Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples +indexing"
+
+DEPEND="app-arch/unzip"
+RDEPEND="=dev-python/pygccxml-1.0.0[${PYTHON_USEDEP}]"
+
+S=${WORKDIR}/Py++-${PV}
+
+python_test() {
+ "${PYTHON}" unittests/test_all.py || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/documentation/apidocs/. )
+ use examples && local EXAMPLES=( examples/. )
+
+ if use indexing; then
+ insinto /usr/include/boost/python/suite/indexing
+ doins indexing_suite_v2/indexing/*.hpp
+ fi
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/pyplusplus/pyplusplus-1.0.0_p20131206.ebuild b/dev-python/pyplusplus/pyplusplus-1.0.0_p20131206.ebuild
new file mode 100644
index 000000000000..b6ee0e3bb1ab
--- /dev/null
+++ b/dev-python/pyplusplus/pyplusplus-1.0.0_p20131206.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Object-oriented framework for creating a code generator for Boost.Python library"
+HOMEPAGE="http://www.language-binding.net/"
+
+if [[ ${PV} == 9999 ]]; then
+ ESVN_REPO_URI="https://svn.code.sf.net/p/pygccxml/svn/${PN}_dev"
+ inherit subversion
+ S=${WORKDIR}/${PN}_dev
+else
+ SRC_URI="https://dev.gentoo.org/~heroxbd/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="freedist Boost-1.0"
+SLOT="0"
+IUSE="examples numpy"
+
+DEPEND="app-arch/unzip
+ numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )"
+RDEPEND="dev-python/pygccxml[${PYTHON_USEDEP}]"
+
+src_prepare() {
+ use numpy && epatch --binary "${FILESDIR}"/${PN}-1.0.0_p20131206-numpy.patch
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ "${PYTHON}" unittests/test_all.py || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use examples && local EXAMPLES=( examples/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/pyplusplus/pyplusplus-9999.ebuild b/dev-python/pyplusplus/pyplusplus-9999.ebuild
new file mode 100644
index 000000000000..cc93c46965c5
--- /dev/null
+++ b/dev-python/pyplusplus/pyplusplus-9999.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Object-oriented framework for creating a code generator for Boost.Python library"
+HOMEPAGE="http://www.language-binding.net/"
+
+if [[ ${PV} == 9999 ]]; then
+ ESVN_REPO_URI="https://svn.code.sf.net/p/pygccxml/svn/${PN}_dev"
+ inherit subversion
+ S=${WORKDIR}/${PN}_dev
+else
+ SRC_URI="https://dev.gentoo.org/~heroxbd/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="freedist Boost-1.0"
+SLOT="0"
+IUSE="examples numpy"
+
+DEPEND="app-arch/unzip
+ numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )"
+RDEPEND="dev-python/pygccxml[${PYTHON_USEDEP}]"
+
+python_test() {
+ "${PYTHON}" unittests/test_all.py || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use examples && local EXAMPLES=( examples/. )
+
+ distutils-r1_python_install_all
+}