Lines 25-30
import os
Link Here
|
25 |
import os.path |
25 |
import os.path |
26 |
import platform |
26 |
import platform |
27 |
import re |
27 |
import re |
|
|
28 |
import setuptools |
28 |
import subprocess |
29 |
import subprocess |
29 |
import sys |
30 |
import sys |
30 |
|
31 |
|
Lines 46-66
x_scripts = {
Link Here
|
46 |
], |
47 |
], |
47 |
} |
48 |
} |
48 |
|
49 |
|
49 |
# Dictionary custom modules written in C/C++ here. The structure is |
50 |
# Disable helper modules on PyPI build |
50 |
# key = module name |
51 |
# |
51 |
# value = list of C/C++ source code, path relative to top source directory |
52 |
#def x_c_helpers(): |
52 |
x_c_helpers = { |
53 |
# if platform.system() == 'Linux': |
53 |
'portage.util.libc' : [ |
54 |
# ext_modules = [ |
54 |
'src/portage_util_libc.c', |
55 |
# Extension( |
55 |
], |
56 |
# name='portage.util.libc', |
56 |
} |
57 |
# sources=[ 'src/portage_util_libc.c' ], |
57 |
|
58 |
# extra_compile_args=[ |
58 |
if platform.system() == 'Linux': |
59 |
# '-D_FILE_OFFSET_BITS=64', |
59 |
x_c_helpers.update({ |
60 |
# '-D_LARGEFILE_SOURCE', |
60 |
'portage.util.file_copy.reflink_linux': [ |
61 |
# '-D_LARGEFILE64_SOURCE' |
61 |
'src/portage_util_file_copy_reflink_linux.c', |
62 |
# ] |
62 |
], |
63 |
# ), |
63 |
}) |
64 |
# Extension( |
|
|
65 |
# name='portage.util.file_copy.reflink_linux', |
66 |
# sources=[ 'src/portage_util_libc.c' ], |
67 |
# extra_compile_args=[ |
68 |
# '-D_FILE_OFFSET_BITS=64', |
69 |
# '-D_LARGEFILE_SOURCE', |
70 |
# '-D_LARGEFILE64_SOURCE' |
71 |
# ] |
72 |
# ) |
73 |
# ], |
74 |
# else: |
75 |
# ext_modules = [ |
76 |
# Extension( |
77 |
# name='portage.util.libc', |
78 |
# sources='src/portage_util_libc.c', |
79 |
# extra_compile_args=[ |
80 |
# '-D_FILE_OFFSET_BITS=64', |
81 |
# '-D_LARGEFILE_SOURCE', |
82 |
# '-D_LARGEFILE64_SOURCE' |
83 |
# ] |
84 |
# ) |
85 |
# ] |
86 |
# return ext_modules |
64 |
|
87 |
|
65 |
|
88 |
|
66 |
class x_build(build): |
89 |
class x_build(build): |
Lines 660-666
class build_ext(_build_ext):
Link Here
|
660 |
_build_ext.run(self) |
683 |
_build_ext.run(self) |
661 |
|
684 |
|
662 |
|
685 |
|
663 |
setup( |
686 |
setuptools.setup( |
664 |
name = 'portage', |
687 |
name = 'portage', |
665 |
version = '2.3.78', |
688 |
version = '2.3.78', |
666 |
url = 'https://wiki.gentoo.org/wiki/Project:Portage', |
689 |
url = 'https://wiki.gentoo.org/wiki/Project:Portage', |
Lines 683-692
setup(
Link Here
|
683 |
['$sysconfdir/portage/repo.postsync.d', ['cnf/repo.postsync.d/example']], |
706 |
['$sysconfdir/portage/repo.postsync.d', ['cnf/repo.postsync.d/example']], |
684 |
], |
707 |
], |
685 |
|
708 |
|
686 |
ext_modules = [Extension(name=n, sources=m, |
709 |
# ext_modules = x_c_helpers(), |
687 |
extra_compile_args=['-D_FILE_OFFSET_BITS=64', |
|
|
688 |
'-D_LARGEFILE_SOURCE', '-D_LARGEFILE64_SOURCE']) |
689 |
for n, m in x_c_helpers.items()], |
690 |
|
710 |
|
691 |
cmdclass = { |
711 |
cmdclass = { |
692 |
'build': x_build, |
712 |
'build': x_build, |
693 |
- |
|
|