summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-04-29 19:41:54 +0200
committerArmin Rigo <arigo@tunes.org>2015-04-29 19:41:54 +0200
commita4d41f8de4a44ee07f52ed71b8fe150e7f009eb7 (patch)
tree13cc17f33cdaca9c4f54c7416932bf10358f739f /demo
parentb68ddf1a0565bb6f5f97bb48b4f5bf09f3ae5498 (diff)
downloadcffi-a4d41f8de4a44ee07f52ed71b8fe150e7f009eb7.tar.gz
Add the setup.py corresponding to the demo
Diffstat (limited to 'demo')
-rw-r--r--demo/bsdopendirtype_setup.py33
1 files changed, 12 insertions, 21 deletions
diff --git a/demo/bsdopendirtype_setup.py b/demo/bsdopendirtype_setup.py
index cfe3611..ee0a594 100644
--- a/demo/bsdopendirtype_setup.py
+++ b/demo/bsdopendirtype_setup.py
@@ -1,22 +1,13 @@
-from cffi import FFI
+from setuptools import setup
-ffi = FFI()
-ffi.csource("_bsdopendirtype", """
- #include <sys/types.h>
- #include <dirent.h>
-""")
-ffi.cdef("""
- typedef ... DIR;
- struct dirent {
- unsigned char d_type; /* type of file */
- char d_name[]; /* filename */
- ...;
- };
- DIR *opendir(const char *name);
- int closedir(DIR *dirp);
- struct dirent *readdir(DIR *dirp);
- static const int DT_BLK, DT_CHR, DT_DIR, DT_FIFO, DT_LNK, DT_REG, DT_SOCK;
-""")
-
-if __name__ == '__main__':
- ffi.recompile()
+setup(
+ name="example",
+ version="0.1",
+ py_modules=["bsdopendirtype"],
+ setup_requires=["cffi>=1.0"],
+ cffi_modules=[
+ "bsdopendirtype_build:ffi",
+ ],
+ install_requires=["cffi>=1.0"], # should maybe be "cffi-backend" only?
+ zip_safe=False,
+)