##// END OF EJS Templates
cffi: put compiled modules into mercurial.cffi package...
Yuya Nishihara -
r32506:2dcb3d52 default
parent child Browse files
Show More
@@ -4,7 +4,7 b' import cffi'
4 import os
4 import os
5
5
6 ffi = cffi.FFI()
6 ffi = cffi.FFI()
7 ffi.set_source("_bdiff_cffi",
7 ffi.set_source("mercurial.cffi._bdiff",
8 open(os.path.join(os.path.join(os.path.dirname(__file__), '..'),
8 open(os.path.join(os.path.join(os.path.dirname(__file__), '..'),
9 'bdiff.c')).read(), include_dirs=['mercurial'])
9 'bdiff.c')).read(), include_dirs=['mercurial'])
10 ffi.cdef("""
10 ffi.cdef("""
@@ -6,7 +6,7 b' import os'
6 ffi = cffi.FFI()
6 ffi = cffi.FFI()
7 mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), '..',
7 mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), '..',
8 'mpatch.c'))
8 'mpatch.c'))
9 ffi.set_source("_mpatch_cffi", open(mpatch_c).read(),
9 ffi.set_source("mercurial.cffi._mpatch", open(mpatch_c).read(),
10 include_dirs=["mercurial"])
10 include_dirs=["mercurial"])
11 ffi.cdef("""
11 ffi.cdef("""
12
12
@@ -3,7 +3,7 b' from __future__ import absolute_import'
3 import cffi
3 import cffi
4
4
5 ffi = cffi.FFI()
5 ffi = cffi.FFI()
6 ffi.set_source("_osutil_cffi", """
6 ffi.set_source("mercurial.cffi._osutil", """
7 #include <sys/attr.h>
7 #include <sys/attr.h>
8 #include <sys/vnode.h>
8 #include <sys/vnode.h>
9 #include <unistd.h>
9 #include <unistd.h>
@@ -96,7 +96,7 b' def fixws(text, allws):'
96
96
97 if modulepolicy not in policynocffi:
97 if modulepolicy not in policynocffi:
98 try:
98 try:
99 from _bdiff_cffi import ffi, lib
99 from ..cffi._bdiff import ffi, lib
100 except ImportError:
100 except ImportError:
101 if modulepolicy == 'cffi': # strict cffi import
101 if modulepolicy == 'cffi': # strict cffi import
102 raise
102 raise
@@ -130,7 +130,7 b' def patchedsize(orig, delta):'
130
130
131 if modulepolicy not in policynocffi:
131 if modulepolicy not in policynocffi:
132 try:
132 try:
133 from _mpatch_cffi import ffi, lib
133 from ..cffi._mpatch import ffi, lib
134 except ImportError:
134 except ImportError:
135 if modulepolicy == 'cffi': # strict cffi import
135 if modulepolicy == 'cffi': # strict cffi import
136 raise
136 raise
@@ -71,7 +71,7 b' def listdirpure(path, stat=False, skip=N'
71 ffi = None
71 ffi = None
72 if modulepolicy not in policynocffi and pycompat.sysplatform == 'darwin':
72 if modulepolicy not in policynocffi and pycompat.sysplatform == 'darwin':
73 try:
73 try:
74 from _osutil_cffi import ffi, lib
74 from ..cffi._osutil import ffi, lib
75 except ImportError:
75 except ImportError:
76 if modulepolicy == 'cffi': # strict cffi import
76 if modulepolicy == 'cffi': # strict cffi import
77 raise
77 raise
@@ -582,6 +582,7 b" cmdclass = {'build': hgbuild,"
582
582
583 packages = ['mercurial',
583 packages = ['mercurial',
584 'mercurial.cext',
584 'mercurial.cext',
585 'mercurial.cffi',
585 'mercurial.hgweb',
586 'mercurial.hgweb',
586 'mercurial.httpclient',
587 'mercurial.httpclient',
587 'mercurial.pure',
588 'mercurial.pure',
General Comments 0
You need to be logged in to leave comments. Login now