Added an extension for libfastsolver and fix for loading so in Debian
This commit is contained in:
parent
7ad1725235
commit
976a2faa68
12
setup.py
12
setup.py
|
@ -12,7 +12,7 @@ from src.version import softwareVersion
|
||||||
EXTRAS_REQUIRE = {
|
EXTRAS_REQUIRE = {
|
||||||
'gir': ['pygobject'],
|
'gir': ['pygobject'],
|
||||||
'notify2': ['notify2'],
|
'notify2': ['notify2'],
|
||||||
'pyopencl': ['pyopencl', 'numpy'],
|
'opencl': ['pyopencl', 'numpy'],
|
||||||
'prctl': ['python_prctl'], # Named threads
|
'prctl': ['python_prctl'], # Named threads
|
||||||
'qrcode': ['qrcode'],
|
'qrcode': ['qrcode'],
|
||||||
'sound;platform_system=="Windows"': ['winsound'],
|
'sound;platform_system=="Windows"': ['winsound'],
|
||||||
|
@ -50,6 +50,15 @@ if __name__ == "__main__":
|
||||||
with open(os.path.join(here, 'README.md')) as f:
|
with open(os.path.join(here, 'README.md')) as f:
|
||||||
README = f.read()
|
README = f.read()
|
||||||
|
|
||||||
|
libfastsolver = Extension(
|
||||||
|
'pybitmessage.workprover.fastsolver.libfastsolver',
|
||||||
|
sources=[
|
||||||
|
'src/workprover/fastsolver/common.c',
|
||||||
|
'src/workprover/fastsolver/pthread.c'],
|
||||||
|
include_dirs=['src/workprover/fastsolver'],
|
||||||
|
libraries=['pthread', 'crypto'],
|
||||||
|
)
|
||||||
|
|
||||||
installRequires = []
|
installRequires = []
|
||||||
packages = [
|
packages = [
|
||||||
'pybitmessage',
|
'pybitmessage',
|
||||||
|
@ -116,6 +125,7 @@ if __name__ == "__main__":
|
||||||
('share/icons/hicolor/24x24/apps/',
|
('share/icons/hicolor/24x24/apps/',
|
||||||
['desktop/icons/24x24/pybitmessage.png'])
|
['desktop/icons/24x24/pybitmessage.png'])
|
||||||
],
|
],
|
||||||
|
ext_modules=[libfastsolver],
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
entry_points={
|
entry_points={
|
||||||
'bitmessage.gui.menu': [
|
'bitmessage.gui.menu': [
|
||||||
|
|
|
@ -21,6 +21,17 @@ def loadFastSolver(codePath):
|
||||||
except:
|
except:
|
||||||
raise FastSolverError()
|
raise FastSolverError()
|
||||||
|
|
||||||
|
# dh_python renames so
|
||||||
|
if platform.dist()[0] in ('debian', 'ubuntu'):
|
||||||
|
import glob
|
||||||
|
try:
|
||||||
|
return ctypes.CDLL(glob.glob(os.path.join(
|
||||||
|
codePath, "fastsolver",
|
||||||
|
"libfastsolver.{}*.so".format(platform.machine())
|
||||||
|
))[0])
|
||||||
|
except (OSError, IndexError):
|
||||||
|
pass
|
||||||
|
|
||||||
makePath = os.path.join(codePath, "fastsolver")
|
makePath = os.path.join(codePath, "fastsolver")
|
||||||
path = os.path.join(codePath, "fastsolver/libfastsolver.so")
|
path = os.path.join(codePath, "fastsolver/libfastsolver.so")
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user