From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- dev-python/pyplusplus/Manifest | 9 ++ .../files/pyplusplus-1.0.0_p20131206-numpy.patch | 179 +++++++++++++++++++++ dev-python/pyplusplus/metadata.xml | 18 +++ dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild | 38 +++++ .../pyplusplus/pyplusplus-1.0.0_p20131206.ebuild | 43 +++++ dev-python/pyplusplus/pyplusplus-9999.ebuild | 38 +++++ 6 files changed, 325 insertions(+) create mode 100644 dev-python/pyplusplus/Manifest create mode 100644 dev-python/pyplusplus/files/pyplusplus-1.0.0_p20131206-numpy.patch create mode 100644 dev-python/pyplusplus/metadata.xml create mode 100644 dev-python/pyplusplus/pyplusplus-1.0.0-r1.ebuild create mode 100644 dev-python/pyplusplus/pyplusplus-1.0.0_p20131206.ebuild create mode 100644 dev-python/pyplusplus/pyplusplus-9999.ebuild (limited to 'dev-python/pyplusplus') diff --git a/dev-python/pyplusplus/Manifest b/dev-python/pyplusplus/Manifest new file mode 100644 index 000000000000..fccaf07a35ac --- /dev/null +++ b/dev-python/pyplusplus/Manifest @@ -0,0 +1,9 @@ +AUX pyplusplus-1.0.0_p20131206-numpy.patch 9236 SHA256 bd2588aac38063e2de5c4409d5e0547f336c1ee4bf53bee1d63dc76b26c0e0b7 SHA512 173655e30525ad60b40a1fb42ca4179aa975622c02545c563658303c0cc56f48c6d0358104d91248cdf27d9dafeef340d4d491556af33fee56848ada21db4e97 WHIRLPOOL 64add1e8a27f860ef2a6990148b3e3ebfd57cc76c0506a955e37566819c015f8b3e3bd4fb27a7b3aebee0d85ba8bf7a00f1eeb67e48af354b788ce62563e2be6 +DIST pyplusplus-1.0.0.zip 7886416 SHA256 dc749514642846d85de148735b44c5f5e03dc0b62feceb0727698f4069d3c963 SHA512 04a9d6f06d8d22da9ac3b4ec1efdf001f0e4a2453ff5d70d6a15b808d7247ace630c4064ab2476a28ed3dede9cdb867c0650810a0c72a0a6474912fc7ef65812 WHIRLPOOL ab12d4c2432155226e66081f72007406c71da11aae5f7e2e4bf80e3e28680cef5ec0370a8fc442f86ed14793bc340f85d203903f348982d355f48f4a52c4f89a +DIST pyplusplus-1.0.0_p20131206.tar.xz 2984232 SHA256 bcec544fc4520a3f37dc672dfb5c3611ed973ac34912eff5f5c67267680154ba SHA512 5cdf158477d6b93d1b579383657241c48d59ac17fd890016ac68d3b9ca8453726dabb8a7913f6139e24e93c691ead85adb99a6b20aa031603c6471df04fcfea6 WHIRLPOOL ef8d5d193ab334a82a3b364bf525efd3fd588e07993de525cad705aa175041291ffabfd115f8863952a00d9424a802f4c4cb5d09c3837ef67c860d821c212730 +EBUILD pyplusplus-1.0.0-r1.ebuild 930 SHA256 e8aa2d8415a4e91a1ce9943275615a9f574475d462088c3adefa0d762d5e6b1c SHA512 c3cd3c7ebb0001d29bc10b8e5294e746c87091daf2e98205aac94c4902fcfaf693172605082e39c172585baef2c86be4033f7b9d6b081e5ee8e0fbbf8dedfba8 WHIRLPOOL 86189f0b03a721ff4d987bb07b39e77fd10b95eab2a45cfffcca0c24e8c6aa5c41521c3ee673d4b16a3029d938876b542ff2f1468be17f8ee49aab3a6b41d57a +EBUILD pyplusplus-1.0.0_p20131206.ebuild 1034 SHA256 345a3f280c50fe418da3cf576f3fe62e681e9f88000df2f17ff4f1c66445e4aa SHA512 2d60bf563bff733a9cfd5027bc100edf459b1d366f3ac71d6d32025be0c106e8333dbbb98d54a305dde717416836ae25043ddf03567e583159325edf27b656ad WHIRLPOOL 780d4458232dc627b1d8a097c9c2ffe1759bacfc3ce7c8847cd13949fae770edafc2084df91ec098866fad83c18272a30eca09a516b4291b24682dbeb4dc8ec0 +EBUILD pyplusplus-9999.ebuild 911 SHA256 672c396a92995cc9997b041bd9c8f526a3786e49ef8f222c9542bebac4f64b90 SHA512 2e34f2d25bcdeabd43ffd16c352d66eb1e91f5fa88084de4abcf4a958609d4c35da83137a1a9860204a32b9d9a11c69c3fc4df7134166b932dfbbe74cc4fc92a WHIRLPOOL d7fc0b4890f35038a966e0e7253c3bd2b9342671902b698389eb86c741e3731c703a4b1b49737d2aecdd5ce123dd46835688de787cd0048347e6917f38f3bd89 +MISC ChangeLog 3162 SHA256 d48348d3488c2dc0586a0e204ee1af2e0d7a32eb51b9020fb98bc840fed6b4d5 SHA512 8888f8f4a1ac153aad13249763e254da5ccf5b3cee952296237f388adb7af98d7853a21102ee0bf5feb4d4bb119b2f368ab451e65efa611f0c3ee4ac6a38d840 WHIRLPOOL 16e826f1f8fcfd617264fbfb6ad34a5a575b1dcb0e559786ac653541170b9ecc5c36426e22a5ced6aa90a67d48f350a4060e9bdc7bc8debe7985905fcaba60b3 +MISC ChangeLog-2015 1903 SHA256 6d8d59262c0b1c3304df22b3df1dd5ab4b012d0eba4584ee8942ef4bf3625c08 SHA512 669ee2094a16a46a87bd2f02256ed1e9e901e0928bbfbe444a29beb62b2f851518d738fa1fe5798c809ce291eae10c2a90bc542e6734eaeefe0549be432c82de WHIRLPOOL 805e3f505f4f10a5c257dfcad6c69c88b6f9f7c1ac339128d1005228bc375b9f7d889288ddf2da6a3e45da9623b372edef036316539c763c184a68c785a61b4d +MISC metadata.xml 659 SHA256 b57f81f82d306a0e74b6b21b039e9aba20fdb94d1f49457a8bb9cb88c53b264b SHA512 d78333a1d7795b1d5f7b8e7e498235051e182993ce3db67133dfc098d6f25fe60b4ea7eda37e393d7253f444f42b18719b9e3ef41604c81b84cfbb626ae61692 WHIRLPOOL 54fb904676b8c7feabef41e639d277d04668bd2ae29e5b067a5250bdf7d3262c35964094cb9f35022d6e703cd149fa9e27bd3d69069d800d7b72ea3f4c8a57c6 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 @@ + + + + + heroxbd@gentoo.org + Benda Xu + + pyplusplus is an object-oriented framework for creating a code generator for boost.python library. + + Install indexing_suite_v2 to enhance boost python + + Generate code for dev-libs/boost-numpy to accelerate arrays + + + + pygccxml + + 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 +} -- cgit v1.2.3