From 1669d26e145a00aeac730a01b3e8a81e44267718 Mon Sep 17 00:00:00 2001 From: Headshot Date: Sun, 14 Feb 2021 21:50:22 -0430 Subject: [PATCH] fix more mac things --- AO2XP.py | 6 +++++- setup_mac.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 setup_mac.py diff --git a/AO2XP.py b/AO2XP.py index 306cc4f..1685707 100644 --- a/AO2XP.py +++ b/AO2XP.py @@ -7,6 +7,10 @@ osname = platform.system() bassdll = "bass.dll" if osname != "Windows": bassdll = "libbass.so" +if osname == "Darwin" and ".app" in __file__: # bundle + path = "/".join(__file__.split("/")[:-4]) + sys.stderr.write(path) + os.chdir(path) debugmode = len(sys.argv) > 1 and sys.argv[1] == "debug" if not debugmode: @@ -67,7 +71,7 @@ if not debugmode: from pybass import * import gameview, mainmenu, options, ini -BASS_Init(ini.read_ini_int("base/AO2XP.ini", "Audio", "device", -1), 44100, 0, 0, 0) +BASS_Init(ini.read_ini_int("AO2XP.ini", "Audio", "device", -1), 44100, 0, 0, 0) BASS_PluginLoad("bassopus", 0) shit = gamewindow() shit.show() diff --git a/setup_mac.py b/setup_mac.py new file mode 100644 index 0000000..8d4ceab --- /dev/null +++ b/setup_mac.py @@ -0,0 +1,45 @@ +""" +This is a setup.py script generated by py2applet + +Usage: + python setup.py py2app +""" + +from setuptools import setup + +APP = ['AO2XP.py'] +DATA_FILES = [] +OPTIONS = dict( + includes = [ + "zlib", + "sip", + "PyQt4", + "PyQt4._qt", + "PyQt4.QtCore", + "PyQt4.QtGui", + ], + + excludes = [ + "PyQt4.QtDesigner", + "PyQt4.QtNetwork", + "PyQt4.QtOpenGL", + "PyQt4.QtScript", + "PyQt4.QtSql", + "PyQt4.QtTest", + "PyQt4.QtWebKit", + "PyQt4.QtXml", + "PyQt4.phonon", + ], + + packages = [ + ], + + argv_emulation = False +) + +setup( + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app'], +)