Skip to content

Commit

Permalink
Fix avbin for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
malikoth committed Jun 3, 2016
1 parent d779b6b commit 1d79b13
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
30 changes: 19 additions & 11 deletions arcade/sound.py
Expand Up @@ -13,25 +13,33 @@ def load_sound_library():
else:
return

import os
appveyor = not os.environ.get('APPVEYOR') is None

import platform
system = platform.system()
if system == 'Windows':

import os
appveyor = not os.environ.get('APPVEYOR') is None
import sys
is64bit = sys.maxsize > 2**32

from distutils.sysconfig import get_python_lib
python_lib = get_python_lib()
import site
packages = site.getsitepackages()

if system == "Windows":
if appveyor:
path = "avbin"
if is64bit:
path = "Win64/avbin"
else:
path = "Win32/avbin"

else:
import sys
is_64_bit = sys.maxsize > 2**32
arch = 'x64' if is_64_bit else 'x86'
path = python_lib + "\\arcade\\avbin-win32-" + arch
if is64bit:
path = packages[0] + "/lib/site-packages/arcade/Win64/avbin"
else:
path = packages[0] + "/lib/site-packages/arcade/Win32/avbin"
elif system == 'Darwin':
path = python_lib + '/lib/site-packages/arcade/libavbin.10.dylib'
from distutils.sysconfig import get_python_lib
path = get_python_lib() + '/lib/site-packages/arcade/lib/libavbin.10.dylib'
else:
path = "avbin"

Expand Down
16 changes: 3 additions & 13 deletions setup.py
Expand Up @@ -5,9 +5,7 @@
RELEASE = VERSION + "b" + str(BUILD)

from os import path
import platform
import sys
import distutils.sysconfig
from setuptools import setup

if __name__ == "__main__":
Expand All @@ -22,16 +20,6 @@
with open(fname, "r") as f:
long_desc = f.read()

system = platform.system()
is_64_bit = sys.maxsize > 2**32
if system == 'Windows':
if is_64_bit:
avbin = 'lib/avbin-win32-x64.dll'
else: # 32-bit
avbin = 'lib/avbin-win32-x86.dll'
elif system == 'Darwin':
avbin = 'lib/libavbin.10.dylib'

setup(
name="arcade",
version=RELEASE,
Expand Down Expand Up @@ -62,5 +50,7 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
test_suite="tests",
data_files=[("lib/site-packages/arcade", [avbin])]
data_files=[("Lib/site-packages/arcade/Win32", ["Win32/avbin.dll"]),
("Lib/site-packages/arcade/Win64", ["Win64/avbin.dll"]),
('lib/site-packages/arcade/lib', ['lib/libavbin.10.dylib'])]
)

0 comments on commit 1d79b13

Please sign in to comment.