dropbox / djinni

A tool for generating cross-language type declarations and interface bindings.
Apache License 2.0
2.88k stars 488 forks source link

Minimal example for python-out on linux #384

Open jhennrich opened 6 years ago

jhennrich commented 6 years ago

Please provide a minimal example or at least some explanation how to use the python-branch on other systems than OSX. I have zero experience with OSX and no device available to run the examples. I ran the run_djinni.sh script which generated the python, cffi and cwrapper files. But I am not sure how to replace the Make target ./build_py/cffi/libtextsort_py.dylib. Can you please point me in the right direction?

artwyman commented 6 years ago

Yeah, unfortunately the Python functionality was an experiment which never got fully productized or integrated with the rest of Djinni. That's why it's still on a branch, and also why the build is very manual and platform-specific. I'd love to see it improved, but haven't had time to tackle it myself.

The generated Python code is based on CFFI, so that's where I'd suggest you look for guidance. Examples of builds for other CFFI modules should be applicable to a Djinni-generated module, and you can probably find better and more portable ways to package the code than we use in our example and tests.

To answer your specific question about the dylib, that's a dynamic library which contains the generated C++ code and bridging layer. On Linux I'd assume there should be a .so which serves a similar purpose.