Skip to content

Commit

Permalink
Fix /usr loading
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jul 3, 2024
1 parent ce3fc08 commit 1650767
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
25 changes: 14 additions & 11 deletions pyqrack/qrack_system/qrack_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,25 @@ def __init__(self):
try:
self.qrack_lib = CDLL(shared_lib_path)
except Exception as e:
if _platform == "win32":
shared_lib_path = "C:/Program Files/libqrack*/lib/qrack_pinvoke.lib"
elif _platform == "darwin":
shared_lib_path = "/usr/local/lib/qrack/libqrack_pinvoke.dylib"
else:
shared_lib_path = "/usr/local/lib/qrack/libqrack_pinvoke.so"

try:
self.qrack_lib = CDLL(shared_lib_path)
except Exception as e:
if _platform == "win32":
shared_lib_path = "C:/Program Files/libqrack*/lib/qrack_pinvoke.lib"
shared_lib_path = "C:/Program Files (x86)/libqrack*/lib/qrack_pinvoke.lib"
elif _platform == "darwin":
shared_lib_path = "/usr/local/lib/qrack/libqrack_pinvoke.dylib"
shared_lib_path = "/usr/lib/qrack/libqrack_pinvoke.dylib"
else:
shared_lib_path = "/usr/local/lib/qrack/libqrack_pinvoke.so"
self.qrack_lib = CDLL(shared_lib_path)
except Exception as e:
shared_lib_path = "/usr/lib/qrack/libqrack_pinvoke.so"

try:
if _platform == "win32":
raise e
elif _platform == "darwin":
shared_lib_path = "/usr/lib/qrack/libqrack_pinvoke.dylib"
else:
shared_lib_path = "/usr/lib/qrack/libqrack_pinvoke.so"
self.qrack_lib = CDLL(shared_lib_path)
except Exception as e:
print(e)

Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup


VERSION = "1.29.8"
VERSION = "1.29.9"

# Read long description from README.
README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
Expand Down Expand Up @@ -33,6 +33,13 @@
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.3",
"Programming Language :: Python :: 2.4",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
Expand Down

0 comments on commit 1650767

Please sign in to comment.