Skip to content

Commit a6c6d72

Browse files
committed
Fixed library loader
Also making sure the dlls are correctly distributed
1 parent 79f8c5d commit a6c6d72

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

openal/library_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def load_other(name, paths = None):
5151
library = ctypes.util.find_library(candidate)
5252
if library:
5353
try:
54-
return ctypes.CDLL(library)
54+
return ctypes.CDLL(os.path.realpath(library))
5555
except:
5656
pass
5757

@@ -66,11 +66,11 @@ def load_windows(name, paths = None):
6666
library = ctypes.util.find_library(candidate)
6767
if library:
6868
try:
69-
return ctypes.CDLL(candidate)
69+
return ctypes.CDLL(os.path.realpath(library))
7070
except WindowsError:
7171
pass
7272
except OSError:
73-
not_supported.append(candidate)
73+
not_supported.append(library)
7474

7575

7676
if not_supported:

setup.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
from codecs import open
1111
from os import path
1212

13+
import sys
14+
15+
platform = None
16+
17+
if (len(sys.argv) == 4):
18+
if (sys.argv[3] == "win-amd64"):
19+
platform = 64
20+
elif (sys.argv[3] == "win32"):
21+
platform = 32
22+
1323
here = path.abspath(path.dirname(__file__))
1424

1525
setup(
@@ -18,7 +28,7 @@
1828
# Versions should comply with PEP440. For a discussion on single-sourcing
1929
# the version across setup.py and the project code, see
2030
# https://packaging.python.org/en/latest/single_source_version.html
21-
version='0.7.9a1',
31+
version='0.7.10a1',
2232

2333
description='OpenAL integration for Python',
2434
long_description=open(path.join(here, 'README.md')).read(),
@@ -72,8 +82,8 @@
7282

7383
package_data={
7484
# include shared libraries in wheel packages
75-
'openal': ['soft_oal.dll']
76-
},
85+
'openal': ['soft_oal_{}.dll'.format(platform)]
86+
} if platform else {},
7787

7888
# List run-time dependencies here. These will be installed by pip when
7989
# your project is installed. For an analysis of "install_requires" vs pip's

0 commit comments

Comments
 (0)