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: Sun, 22 May 2016 13:04:39 -0400 [thread overview]
Message-ID: <1463936680-16072-1-git-send-email-basile@opensource.dyc.edu> (raw)
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
next reply other threads:[~2016-05-22 17:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-22 17:04 Anthony G. Basile [this message]
2016-05-22 17:04 ` [gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to help check locale Anthony G. Basile
2016-05-23 6:44 ` Michał Górny
2016-05-23 12:08 ` Anthony G. Basile
2016-05-23 14:25 ` Michał Górny
2016-05-27 14:40 ` Anthony G. Basile
2016-05-27 15:15 ` Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2016-05-19 12:43 [gentoo-portage-dev] [PATCH 1/2] setup.py: add stub for building custom modules in C/C++ Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463936680-16072-1-git-send-email-basile@opensource.dyc.edu \
--to=basile@opensource.dyc.edu \
--cc=blueness@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox