File: lib_build.py

package info (click to toggle)
python-xattr 0.10.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: python: 824; ansic: 489; sh: 32; makefile: 17
file content (17 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
import os
from cffi import FFI

PATH = os.path.dirname(__file__)

with open(os.path.join(PATH, 'lib_build.h')) as hf:
    c_header = hf.read()
with open(os.path.join(PATH, 'lib_build.c')) as cf:
    c_source = cf.read()

ffi = FFI()
ffi.cdef(c_header)
ffi.set_source('_lib', c_source)

if __name__ == '__main__':
    ffi.compile()