From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-portage-dev+bounces-5785-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 9831E13828B for <garchives@archives.gentoo.org>; Fri, 27 May 2016 14:27:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EE02F1423A; Fri, 27 May 2016 14:27:01 +0000 (UTC) Received: from virtual.dyc.edu (mail.virtual.dyc.edu [67.222.116.22]) by pigeon.gentoo.org (Postfix) with ESMTP id 5413214234 for <gentoo-portage-dev@lists.gentoo.org>; Fri, 27 May 2016 14:27:01 +0000 (UTC) Received: from opensource.dyc.edu (unknown [67.222.116.23]) by virtual.dyc.edu (Postfix) with ESMTP id CC6C87E0018; Fri, 27 May 2016 10:27:00 -0400 (EDT) Received: by opensource.dyc.edu (Postfix, from userid 1001) id 461EB2B00110; Fri, 27 May 2016 10:26:50 -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 2/3] setup.py: add stub for building custom modules in C/C++ Date: Fri, 27 May 2016 10:26:43 -0400 Message-Id: <1464359204-21987-2-git-send-email-basile@opensource.dyc.edu> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1464359204-21987-1-git-send-email-basile@opensource.dyc.edu> References: <1464359204-21987-1-git-send-email-basile@opensource.dyc.edu> 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: 43a830a6-2a5d-48a4-b1c5-f6ed1446ea34 X-Archives-Hash: b43797ace744f5c4a902a41ddcb08468 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