From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-portage-dev+bounces-5734-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 44572138262 for <garchives@archives.gentoo.org>; Thu, 19 May 2016 12:43:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 693C5224044; Thu, 19 May 2016 12:43:48 +0000 (UTC) Received: from virtual.dyc.edu (mail.virtual.dyc.edu [67.222.116.22]) by pigeon.gentoo.org (Postfix) with ESMTP id EF9D621C039 for <gentoo-portage-dev@lists.gentoo.org>; Thu, 19 May 2016 12:43:47 +0000 (UTC) Received: from opensource.dyc.edu (unknown [67.222.116.23]) by virtual.dyc.edu (Postfix) with ESMTP id 6915C7E0018; Thu, 19 May 2016 08:43:47 -0400 (EDT) Received: by opensource.dyc.edu (Postfix, from userid 1001) id BAE372B0010F; Thu, 19 May 2016 08:43:46 -0400 (EDT) From: "Anthony G. Basile" <basile@opensource.dyc.edu> To: gentoo-portage-dev@lists.gentoo.org Cc: "Anthony G. Basile" <blueness@gentoo.org> Subject: [gentoo-portage-dev] [PATCH 1/2] setup.py: add stub for building custom modules in C/C++ Date: Thu, 19 May 2016 08:43:37 -0400 Message-Id: <1463661818-6940-1-git-send-email-basile@opensource.dyc.edu> X-Mailer: git-send-email 1.7.6.1 Precedence: bulk List-Post: <mailto:gentoo-portage-dev@lists.gentoo.org> List-Help: <mailto:gentoo-portage-dev+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-portage-dev+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-portage-dev+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-portage-dev.gentoo.org> X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: 425e62f0-057d-49be-b2ac-76116af0dc8c X-Archives-Hash: b3836bf3cf155415c8c6252e0cac6a0e From: "Anthony G. Basile" <blueness@gentoo.org> Currently portage doesn't include any custom modules written in C/C++. This commit introduces stub code for building such modules in setup.py. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 75c4bcb..25429bc 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from __future__ import print_function -from distutils.core import setup, Command +from distutils.core import setup, Command, Extension from distutils.command.build import build from distutils.command.build_scripts import build_scripts from distutils.command.clean import clean @@ -30,6 +30,9 @@ import sys # TODO: # - smarter rebuilds of docs w/ 'install_docbook' and 'install_epydoc'. +# Dictionary of scripts. The structure is +# key = location in filesystem to install the scripts +# value = list of scripts, path relative to top source directory x_scripts = { 'bin': [ 'bin/ebuild', 'bin/egencache', 'bin/emerge', 'bin/emerge-webrsync', @@ -41,6 +44,10 @@ x_scripts = { ], } +# Dictionary custom modules written in C/C++ here. The structure is +# key = module name +# value = list of C/C++ source code, path relative to top source directory +x_c_helpers = {} class x_build(build): """ Build command with extra build_man call. """ @@ -636,6 +643,8 @@ setup( ['$sysconfdir/portage/repo.postsync.d', ['cnf/repo.postsync.d/example']], ], + ext_modules = [Extension(name=n, sources=m) for n, m in x_c_helpers.items()], + cmdclass = { 'build': x_build, 'build_man': build_man, -- 2.7.3