1 |
From: "Anthony G. Basile" <blueness@g.o> |
2 |
|
3 |
Currently portage doesn't include any custom modules written in C/C++. |
4 |
This commit introduces stub code for building such modules in setup.py. |
5 |
|
6 |
Signed-off-by: Anthony G. Basile <blueness@g.o> |
7 |
--- |
8 |
setup.py | 11 ++++++++++- |
9 |
1 file changed, 10 insertions(+), 1 deletion(-) |
10 |
|
11 |
diff --git a/setup.py b/setup.py |
12 |
index 75c4bcb..25429bc 100755 |
13 |
--- a/setup.py |
14 |
+++ b/setup.py |
15 |
@@ -4,7 +4,7 @@ |
16 |
|
17 |
from __future__ import print_function |
18 |
|
19 |
-from distutils.core import setup, Command |
20 |
+from distutils.core import setup, Command, Extension |
21 |
from distutils.command.build import build |
22 |
from distutils.command.build_scripts import build_scripts |
23 |
from distutils.command.clean import clean |
24 |
@@ -30,6 +30,9 @@ import sys |
25 |
# TODO: |
26 |
# - smarter rebuilds of docs w/ 'install_docbook' and 'install_epydoc'. |
27 |
|
28 |
+# Dictionary of scripts. The structure is |
29 |
+# key = location in filesystem to install the scripts |
30 |
+# value = list of scripts, path relative to top source directory |
31 |
x_scripts = { |
32 |
'bin': [ |
33 |
'bin/ebuild', 'bin/egencache', 'bin/emerge', 'bin/emerge-webrsync', |
34 |
@@ -41,6 +44,10 @@ x_scripts = { |
35 |
], |
36 |
} |
37 |
|
38 |
+# Dictionary custom modules written in C/C++ here. The structure is |
39 |
+# key = module name |
40 |
+# value = list of C/C++ source code, path relative to top source directory |
41 |
+x_c_helpers = {} |
42 |
|
43 |
class x_build(build): |
44 |
""" Build command with extra build_man call. """ |
45 |
@@ -636,6 +643,8 @@ setup( |
46 |
['$sysconfdir/portage/repo.postsync.d', ['cnf/repo.postsync.d/example']], |
47 |
], |
48 |
|
49 |
+ ext_modules = [Extension(name=n, sources=m) for n, m in x_c_helpers.items()], |
50 |
+ |
51 |
cmdclass = { |
52 |
'build': x_build, |
53 |
'build_man': build_man, |
54 |
-- |
55 |
2.7.3 |