make the package a package
This commit is contained in:
parent
914faa6596
commit
aed1337137
7 changed files with 58 additions and 1 deletions
8
pygomx-module/.gitignore
vendored
Normal file
8
pygomx-module/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
*.egg-info
|
||||||
|
*.so
|
||||||
|
*.h
|
||||||
|
*.c
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
1
pygomx-module/MANIFEST.in
Normal file
1
pygomx-module/MANIFEST.in
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
include *.so
|
||||||
26
pygomx-module/Makefile
Normal file
26
pygomx-module/Makefile
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
SOURCE_GO=$(shell find ../libmxclient/ -iname "*.go")
|
||||||
|
|
||||||
|
.PHONY:
|
||||||
|
all: _pygomx.o libmxclient.h
|
||||||
|
mkdir -p build/lib
|
||||||
|
cp *.so build/lib
|
||||||
|
|
||||||
|
_pygomx.o: libmxclient.h build_ffi.py
|
||||||
|
python3 build_ffi.py
|
||||||
|
|
||||||
|
libmxclient.h: ../libmxclient/go.mod ../libmxclient/go.sum $(SOURCE_GO)
|
||||||
|
cd ../libmxclient/ && \
|
||||||
|
CGO_ENABLED=1 go build -buildmode=c-archive -o ../pygomx-module/libmxclient.a .
|
||||||
|
|
||||||
|
.PHONY:
|
||||||
|
clean:
|
||||||
|
-rm _pygomx.*
|
||||||
|
-rm libmxclient.*
|
||||||
|
-rm -r dist/
|
||||||
|
-rm -r build/
|
||||||
|
-rm -r pygomx_module.egg-info
|
||||||
|
|
||||||
|
.PHONY:
|
||||||
|
install: all
|
||||||
|
python setup.py bdist_wheel
|
||||||
|
python setup.py install
|
||||||
14
pygomx-module/README.txt
Normal file
14
pygomx-module/README.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
pygomx-module
|
||||||
|
=============
|
||||||
|
|
||||||
|
python package with the pygomx binaries
|
||||||
|
|
||||||
|
|
||||||
|
build wheel:
|
||||||
|
|
||||||
|
make
|
||||||
|
python setup.py bdist_wheel
|
||||||
|
|
||||||
|
install:
|
||||||
|
|
||||||
|
python setup.py install
|
||||||
|
|
@ -8,7 +8,9 @@ ffibuilder.set_source(
|
||||||
source=""" //passed to the real C compiler
|
source=""" //passed to the real C compiler
|
||||||
#include "libmxclient.h"
|
#include "libmxclient.h"
|
||||||
""",
|
""",
|
||||||
libraries=["mxclient"],
|
libraries=["mxclient", "olm"],
|
||||||
|
library_dirs=["."],
|
||||||
|
include_dirs=["."],
|
||||||
)
|
)
|
||||||
|
|
||||||
ffibuilder.cdef(
|
ffibuilder.cdef(
|
||||||
|
|
|
||||||
3
pygomx-module/requirements.txt
Normal file
3
pygomx-module/requirements.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
cffi
|
||||||
|
setuptools>=80
|
||||||
|
wheel
|
||||||
3
pygomx-module/setup.py
Normal file
3
pygomx-module/setup.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(name="pygomx-module", version="0.0.1", py_modules=["_pygomx"])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue