diff --git a/pgoapi/lib/libniantichash-freebsd-i386.so b/pgoapi/lib/libniantichash-freebsd-i386.so new file mode 100644 index 00000000..258d65ba Binary files /dev/null and b/pgoapi/lib/libniantichash-freebsd-i386.so differ diff --git a/pgoapi/lib/libniantichash-freebsd-x86-64.so b/pgoapi/lib/libniantichash-freebsd-x86-64.so index 6b1e640d..9b37572b 100644 Binary files a/pgoapi/lib/libniantichash-freebsd-x86-64.so and b/pgoapi/lib/libniantichash-freebsd-x86-64.so differ diff --git a/pgoapi/lib/libniantichash-linux-arm32.so b/pgoapi/lib/libniantichash-linux-arm32.so new file mode 100644 index 00000000..d0cee237 Binary files /dev/null and b/pgoapi/lib/libniantichash-linux-arm32.so differ diff --git a/pgoapi/lib/libniantichash-linux-arm64.so b/pgoapi/lib/libniantichash-linux-arm64.so new file mode 100644 index 00000000..8739b7d2 Binary files /dev/null and b/pgoapi/lib/libniantichash-linux-arm64.so differ diff --git a/pgoapi/lib/libniantichash-linux-i386.so b/pgoapi/lib/libniantichash-linux-i386.so new file mode 100644 index 00000000..9737276b Binary files /dev/null and b/pgoapi/lib/libniantichash-linux-i386.so differ diff --git a/pgoapi/lib/libniantichash-macos-i386.dylib b/pgoapi/lib/libniantichash-macos-i386.dylib new file mode 100644 index 00000000..7ba41ca2 Binary files /dev/null and b/pgoapi/lib/libniantichash-macos-i386.dylib differ diff --git a/pgoapi/lib/libniantichash-windows-i686.dll b/pgoapi/lib/libniantichash-windows-i686.dll new file mode 100644 index 00000000..2e213675 Binary files /dev/null and b/pgoapi/lib/libniantichash-windows-i686.dll differ diff --git a/pgoapi/utilities.py b/pgoapi/utilities.py index a401f159..b8a79655 100755 --- a/pgoapi/utilities.py +++ b/pgoapi/utilities.py @@ -172,30 +172,31 @@ def long_to_bytes(val, endianness='big'): def get_hash_lib_path(): # win32 doesn't mean necessarily 32 bits hash_lib = None + arch = platform.architecture()[0] if sys.platform == "win32" or sys.platform == "cygwin": - if platform.architecture()[0] == '64bit': + if arch == '64bit': hash_lib = "libniantichash-windows-x86-64.dll" else: - hash_lib = "libniantichash-windows-i386.dll" + hash_lib = "libniantichash-windows-i686.dll" elif sys.platform == "darwin": - hash_lib = "libniantichash-macos-x86-64.dylib" - elif os.uname()[4].startswith("arm") and platform.architecture()[0] == '32bit': + if arch == '64bit': + hash_lib = "libniantichash-macos-x86-64.dylib" + else: + hash_lib = "libniantichash-macos-i386.dylib" + elif os.uname()[4].startswith("arm") and arch == '32bit': hash_lib = "libniantichash-linux-arm-32.so" - elif os.uname()[4].startswith("aarch64") and platform.architecture()[0] == '64bit': + elif os.uname()[4].startswith("aarch64") and arch == '64bit': hash_lib = "libniantichash-linux-arm-64.so" elif sys.platform.startswith('linux'): - if "centos" in platform.platform(): - if platform.architecture()[0] == '64bit': - hash_lib = "libniantichash-centos-x86-64.so" - else: - hash_lib = "libniantichash-centos-i386.so" + if platform.architecture()[0] == '64bit': + hash_lib = "libniantichash-linux-x86-64.so" else: - if platform.architecture()[0] == '64bit': - hash_lib = "libniantichash-linux-x86-64.so" - else: - hash_lib = "libniantichash-linux-i386.so" + hash_lib = "libniantichash-linux-i386.so" elif sys.platform.startswith('freebsd'): - hash_lib = "libniantichash-freebsd-x86-64.so" + if arch == '64bit': + hash_lib = "libniantichash-freebsd-x86-64.so" + else: + hash_lib = "libniantichash-freebsd-i386.so" else: err = "Unexpected/unsupported platform '{}'".format(sys.platform) log.error(err)