I'm writing some bindings for a C library and am not sure how to configure all this for distribution so it is possible to pip install
my package.
Let's say I have the following files:
library.c
library.h
wrapper.py
In order for my wrapper library to work it is necessary to:
- compile library.c and create a shared library
- run
ctypesgen
onlibrary.h
to generate the ctypes code
Here are the commands:
gcc -Wall -fPIC -c library.c
gcc -shared -Wl,-soname,liblibrary.so.1 -o liblibrary.so.1.0 library.o
ctypesgen.py library.h -L ./ -l library -o _library.py
Running setup.py
will also depend on the user having installed ctypesgen
.
I have no idea how to get this all set up so that someone interested in the library can simply pip install library
and have all this happen automagically. Anyone able to help?