mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Modifications for OS X
git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@111 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
parent
0080e11666
commit
38e83e0bdc
15 changed files with 168 additions and 19 deletions
BIN
data/PySol.icns
Normal file
BIN
data/PySol.icns
Normal file
Binary file not shown.
|
@ -1687,7 +1687,7 @@ Please select a %s type %s.
|
||||||
# find all available music songs
|
# find all available music songs
|
||||||
dirs = manager.getSearchDirs(self, "music-*", "PYSOL_MUSIC")
|
dirs = manager.getSearchDirs(self, "music-*", "PYSOL_MUSIC")
|
||||||
##print dirs
|
##print dirs
|
||||||
ext_re = re.compile(self.audio.EXTENTIONS)
|
ext_re = re.compile(self.audio.EXTENSIONS)
|
||||||
self.initResource(manager, dirs, ext_re, Music)
|
self.initResource(manager, dirs, ext_re, Music)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,3 +61,5 @@ import wavemotion
|
||||||
import windmill
|
import windmill
|
||||||
import yukon
|
import yukon
|
||||||
import zodiac
|
import zodiac
|
||||||
|
from ultra import *
|
||||||
|
from special import *
|
|
@ -77,12 +77,19 @@ def init():
|
||||||
elif settings.TOOLKIT == 'tk' and settings.USE_TILE == 'auto':
|
elif settings.TOOLKIT == 'tk' and settings.USE_TILE == 'auto':
|
||||||
# check tile
|
# check tile
|
||||||
import Tkinter
|
import Tkinter
|
||||||
|
from Tkinter import TclError
|
||||||
root = Tkinter.Tk()
|
root = Tkinter.Tk()
|
||||||
|
#
|
||||||
|
# TkAqua displays the console automatically in application
|
||||||
|
# bundles, so we hide it here.
|
||||||
|
from macosx.appSupport import hideTkConsole
|
||||||
|
#
|
||||||
|
hideTkConsole(root)
|
||||||
root.withdraw()
|
root.withdraw()
|
||||||
settings.USE_TILE = False
|
settings.USE_TILE = False
|
||||||
try:
|
try:
|
||||||
root.tk.call('package', 'require', 'tile', '0.7.8')
|
root.tk.call('package', 'require', 'tile', '0.7.8')
|
||||||
except:
|
except TclError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
settings.USE_TILE = True
|
settings.USE_TILE = True
|
||||||
|
|
0
pysollib/macosx/__init__.py
Normal file
0
pysollib/macosx/__init__.py
Normal file
25
pysollib/macosx/appSupport.py
Normal file
25
pysollib/macosx/appSupport.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
"""
|
||||||
|
A number of function that enhance PySol on MacOSX when it used as a normal
|
||||||
|
GUI application (as opposed to an X11 application).
|
||||||
|
"""
|
||||||
|
import sys
|
||||||
|
from Tkinter import Menu, Text, TclError
|
||||||
|
|
||||||
|
def runningAsOSXApp():
|
||||||
|
""" Returns True iff running from the PySol.app bundle on OSX """
|
||||||
|
return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0])
|
||||||
|
|
||||||
|
def hideTkConsole(root):
|
||||||
|
try:
|
||||||
|
root.tk.call('console', 'hide')
|
||||||
|
except TclError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def setupApp(app):
|
||||||
|
"""
|
||||||
|
Perform setup for the OSX application bundle.
|
||||||
|
"""
|
||||||
|
if not runningAsOSXApp(): return
|
||||||
|
|
||||||
|
hideTkConsole(app.top)
|
||||||
|
#overrideRootMenu(root, flist)
|
|
@ -56,7 +56,7 @@ except ImportError:
|
||||||
|
|
||||||
class AbstractAudioClient:
|
class AbstractAudioClient:
|
||||||
|
|
||||||
EXTENTIONS = r"\.((wav)|(it)|(mod)|(mp3)|(pym)|(s3m)|(xm))$"
|
EXTENSIONS = r"\.((wav)|(it)|(mod)|(mp3)|(pym)|(s3m)|(xm))$"
|
||||||
|
|
||||||
CAN_PLAY_SOUND = False
|
CAN_PLAY_SOUND = False
|
||||||
CAN_PLAY_MUSIC = False
|
CAN_PLAY_MUSIC = False
|
||||||
|
@ -418,7 +418,7 @@ class OSSAudioClient(AbstractAudioClient):
|
||||||
|
|
||||||
class PyGameAudioClient(AbstractAudioClient):
|
class PyGameAudioClient(AbstractAudioClient):
|
||||||
|
|
||||||
EXTENTIONS = r'\.((ogg)|(mp3)|(wav)|(it)|(mod)|(s3m)|(xm)|(mid))$'
|
EXTENSIONS = r'\.((ogg)|(mp3)|(wav)|(it)|(mod)|(s3m)|(xm)|(mid))$'
|
||||||
|
|
||||||
CAN_PLAY_SOUND = True
|
CAN_PLAY_SOUND = True
|
||||||
CAN_PLAY_MUSIC = True
|
CAN_PLAY_MUSIC = True
|
||||||
|
|
|
@ -43,6 +43,7 @@ from mfxutil import Struct, KwStruct, EnvError, latin1_to_ascii
|
||||||
from settings import PACKAGE, VERSION
|
from settings import PACKAGE, VERSION
|
||||||
from settings import DEBUG
|
from settings import DEBUG
|
||||||
|
|
||||||
|
gettext = _
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // Abstract
|
# // Abstract
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import os
|
import sys
|
||||||
|
|
||||||
import Tkinter
|
import Tkinter
|
||||||
from Tkconstants import *
|
from Tkconstants import *
|
||||||
|
@ -325,7 +325,7 @@ class Scrollbar(Widget, Tkinter.Scrollbar):
|
||||||
|
|
||||||
# from http://tkinter.unpythonic.net/wiki/PyLocateTile :
|
# from http://tkinter.unpythonic.net/wiki/PyLocateTile :
|
||||||
# standard Tk scrollbars work on OS X, but Tile ones look weird
|
# standard Tk scrollbars work on OS X, but Tile ones look weird
|
||||||
if os.name == "mac":
|
if sys.platform == "darwin":
|
||||||
Scrollbar = Tkinter.Scrollbar
|
Scrollbar = Tkinter.Scrollbar
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
__all__ = ['PysolMenubar']
|
__all__ = ['PysolMenubar']
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
import math, os, re
|
import math, os, sys, re
|
||||||
import Tile as Tkinter
|
import Tile as Tkinter
|
||||||
import tkFileDialog
|
import tkFileDialog
|
||||||
|
|
||||||
|
@ -204,6 +204,7 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
self.__menupath = {}
|
self.__menupath = {}
|
||||||
self.__keybindings = {}
|
self.__keybindings = {}
|
||||||
self._createMenubar()
|
self._createMenubar()
|
||||||
|
self.top = top
|
||||||
|
|
||||||
if self.progress: self.progress.update(step=1)
|
if self.progress: self.progress.update(step=1)
|
||||||
|
|
||||||
|
@ -350,7 +351,11 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
bind(self.top, "<KeyPress>", self._keyPressHandler)
|
bind(self.top, "<KeyPress>", self._keyPressHandler)
|
||||||
|
|
||||||
m = "Ctrl-"
|
m = "Ctrl-"
|
||||||
if os.name == "mac": m = "Cmd-"
|
if sys.platform == "darwin": m = "Cmd-"
|
||||||
|
|
||||||
|
if self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
|
applemenu=MfxMenu(self.__menubar, n_("apple"))
|
||||||
|
applemenu.add_command(label=_("&About ")+PACKAGE, command=self.mHelpAbout)
|
||||||
|
|
||||||
menu = MfxMenu(self.__menubar, n_("&File"))
|
menu = MfxMenu(self.__menubar, n_("&File"))
|
||||||
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
|
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
|
||||||
|
@ -372,7 +377,8 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
menu.add_command(label=n_("Save &as..."), command=self.mSaveAs)
|
menu.add_command(label=n_("Save &as..."), command=self.mSaveAs)
|
||||||
menu.add_separator()
|
menu.add_separator()
|
||||||
menu.add_command(label=n_("&Hold and quit"), command=self.mHoldAndQuit)
|
menu.add_command(label=n_("&Hold and quit"), command=self.mHoldAndQuit)
|
||||||
menu.add_command(label=n_("&Quit"), command=self.mQuit, accelerator=m+"Q")
|
if not self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
|
menu.add_command(label=n_("&Quit"), command=self.mQuit, accelerator=m+"Q")
|
||||||
|
|
||||||
if self.progress: self.progress.update(step=1)
|
if self.progress: self.progress.update(step=1)
|
||||||
|
|
||||||
|
@ -511,13 +517,15 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
menu.add_command(label=n_("&Rules for this game"), command=self.mHelpRules, accelerator="F1")
|
menu.add_command(label=n_("&Rules for this game"), command=self.mHelpRules, accelerator="F1")
|
||||||
menu.add_command(label=n_("&License terms"), command=self.mHelpLicense)
|
menu.add_command(label=n_("&License terms"), command=self.mHelpLicense)
|
||||||
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
|
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
|
||||||
menu.add_separator()
|
if not self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout)
|
menu.add_separator()
|
||||||
|
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout)
|
||||||
|
|
||||||
MfxMenubar.addPath = None
|
MfxMenubar.addPath = None
|
||||||
|
|
||||||
### FIXME: all key bindings should be *added* to keyPressHandler
|
### FIXME: all key bindings should be *added* to keyPressHandler
|
||||||
ctrl = "Control-"
|
ctrl = "Control-"
|
||||||
|
if sys.platform == "darwin": ctrl = "Command-"
|
||||||
self._bindKey("", "n", self.mNewGame)
|
self._bindKey("", "n", self.mNewGame)
|
||||||
self._bindKey("", "g", self.mSelectGameDialog)
|
self._bindKey("", "g", self.mSelectGameDialog)
|
||||||
self._bindKey("", "v", self.mSelectGameDialogWithPreview)
|
self._bindKey("", "v", self.mSelectGameDialogWithPreview)
|
||||||
|
|
|
@ -142,7 +142,7 @@ class SoundOptionsDialog(MfxDialog):
|
||||||
# remove "Apply" button
|
# remove "Apply" button
|
||||||
kw.strings[1] = None
|
kw.strings[1] = None
|
||||||
#
|
#
|
||||||
frame = Tkinter.LabelFrame(top_frame, text=_('Enable samles'))
|
frame = Tkinter.LabelFrame(top_frame, text=_('Enable samples'))
|
||||||
frame.pack(expand=1, fill='both', padx=5, pady=5)
|
frame.pack(expand=1, fill='both', padx=5, pady=5)
|
||||||
frame.columnconfigure(0, weight=1)
|
frame.columnconfigure(0, weight=1)
|
||||||
frame.columnconfigure(1, weight=1)
|
frame.columnconfigure(1, weight=1)
|
||||||
|
|
|
@ -48,6 +48,7 @@ from tkFont import Font
|
||||||
# PySol imports
|
# PySol imports
|
||||||
from pysollib.mfxutil import destruct, Struct
|
from pysollib.mfxutil import destruct, Struct
|
||||||
from pysollib.settings import PACKAGE, VERSION
|
from pysollib.settings import PACKAGE, VERSION
|
||||||
|
from pysollib.macosx.appSupport import setupApp
|
||||||
from tkutil import after_idle, init_tile, wm_set_icon
|
from tkutil import after_idle, init_tile, wm_set_icon
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
|
|
||||||
|
@ -99,7 +100,7 @@ class MfxRoot(Tkinter.Tk):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
||||||
def initToolkit(self, app, fg=None, bg=None, font=None):
|
def initToolkit(self, app, fg=None, bg=None, font=None):
|
||||||
theme = app.opt.tile_theme
|
setupApp(app)
|
||||||
sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth()
|
sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth()
|
||||||
self.wm_group(self)
|
self.wm_group(self)
|
||||||
self.wm_title(PACKAGE + ' ' + VERSION)
|
self.wm_title(PACKAGE + ' ' + VERSION)
|
||||||
|
@ -147,7 +148,16 @@ class MfxRoot(Tkinter.Tk):
|
||||||
|
|
||||||
# theme
|
# theme
|
||||||
try:
|
try:
|
||||||
init_tile(app, self, theme)
|
windowingsystem = app.top.tk.call("tk", "windowingsystem")
|
||||||
|
if windowingsystem == "x11":
|
||||||
|
app.opt.tile_theme = "clam"
|
||||||
|
elif windowingsystem == "aqua":
|
||||||
|
app.opt.tile_theme = "aqua"
|
||||||
|
elif windowingsystem == "win32":
|
||||||
|
app.opt.tile_theme = "xpnative"
|
||||||
|
init_tile(app, self, app.opt.tile_theme)
|
||||||
|
except TclError:
|
||||||
|
raise
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
print >> sys.stderr, 'ERROR: set theme:', err
|
print >> sys.stderr, 'ERROR: set theme:', err
|
||||||
##self.option_add('*Toolbar.relief', 'groove')
|
##self.option_add('*Toolbar.relief', 'groove')
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
__all__ = ['PysolMenubar']
|
__all__ = ['PysolMenubar']
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
import math, os, re
|
import math, os, sys, re
|
||||||
import Tkinter, tkColorChooser, tkFileDialog
|
import Tkinter, tkColorChooser, tkFileDialog
|
||||||
|
|
||||||
# PySol imports
|
# PySol imports
|
||||||
|
@ -213,6 +213,7 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
self.__menupath = {}
|
self.__menupath = {}
|
||||||
self.__keybindings = {}
|
self.__keybindings = {}
|
||||||
self._createMenubar()
|
self._createMenubar()
|
||||||
|
self.top = top
|
||||||
|
|
||||||
if self.progress: self.progress.update(step=1)
|
if self.progress: self.progress.update(step=1)
|
||||||
|
|
||||||
|
@ -357,7 +358,11 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
bind(self.top, "<KeyPress>", self._keyPressHandler)
|
bind(self.top, "<KeyPress>", self._keyPressHandler)
|
||||||
|
|
||||||
m = "Ctrl-"
|
m = "Ctrl-"
|
||||||
if os.name == "mac": m = "Cmd-"
|
if sys.platform == "darwin": m = "Cmd-"
|
||||||
|
|
||||||
|
if self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
|
applemenu=MfxMenu(self.__menubar, n_("apple"))
|
||||||
|
applemenu.add_command(label=_("&About ")+PACKAGE, command=self.mHelpAbout)
|
||||||
|
|
||||||
menu = MfxMenu(self.__menubar, n_("&File"))
|
menu = MfxMenu(self.__menubar, n_("&File"))
|
||||||
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
|
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
|
||||||
|
@ -379,7 +384,8 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
menu.add_command(label=n_("Save &as..."), command=self.mSaveAs)
|
menu.add_command(label=n_("Save &as..."), command=self.mSaveAs)
|
||||||
menu.add_separator()
|
menu.add_separator()
|
||||||
menu.add_command(label=n_("&Hold and quit"), command=self.mHoldAndQuit)
|
menu.add_command(label=n_("&Hold and quit"), command=self.mHoldAndQuit)
|
||||||
menu.add_command(label=n_("&Quit"), command=self.mQuit, accelerator=m+"Q")
|
if not self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
|
menu.add_command(label=n_("&Quit"), command=self.mQuit, accelerator=m+"Q")
|
||||||
|
|
||||||
if self.progress: self.progress.update(step=1)
|
if self.progress: self.progress.update(step=1)
|
||||||
|
|
||||||
|
@ -516,13 +522,15 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
menu.add_command(label=n_("&Rules for this game"), command=self.mHelpRules, accelerator="F1")
|
menu.add_command(label=n_("&Rules for this game"), command=self.mHelpRules, accelerator="F1")
|
||||||
menu.add_command(label=n_("&License terms"), command=self.mHelpLicense)
|
menu.add_command(label=n_("&License terms"), command=self.mHelpLicense)
|
||||||
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
|
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
|
||||||
menu.add_separator()
|
if not self.top.tk.call("tk", "windowingsystem") == "aqua":
|
||||||
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout)
|
menu.add_separator()
|
||||||
|
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout)
|
||||||
|
|
||||||
MfxMenubar.addPath = None
|
MfxMenubar.addPath = None
|
||||||
|
|
||||||
### FIXME: all key bindings should be *added* to keyPressHandler
|
### FIXME: all key bindings should be *added* to keyPressHandler
|
||||||
ctrl = "Control-"
|
ctrl = "Control-"
|
||||||
|
if sys.platform == "darwin": ctrl = "Command-"
|
||||||
self._bindKey("", "n", self.mNewGame)
|
self._bindKey("", "n", self.mNewGame)
|
||||||
self._bindKey("", "g", self.mSelectGameDialog)
|
self._bindKey("", "g", self.mSelectGameDialog)
|
||||||
self._bindKey("", "v", self.mSelectGameDialogWithPreview)
|
self._bindKey("", "v", self.mSelectGameDialogWithPreview)
|
||||||
|
|
|
@ -48,6 +48,7 @@ from tkFont import Font
|
||||||
# PySol imports
|
# PySol imports
|
||||||
from pysollib.mfxutil import destruct, Struct
|
from pysollib.mfxutil import destruct, Struct
|
||||||
from pysollib.settings import PACKAGE, VERSION
|
from pysollib.settings import PACKAGE, VERSION
|
||||||
|
from pysollib.macosx.appSupport import setupApp
|
||||||
from tkutil import after_idle, wm_set_icon
|
from tkutil import after_idle, wm_set_icon
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
|
|
||||||
|
@ -99,6 +100,7 @@ class MfxRoot(Tkinter.Tk):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
||||||
def initToolkit(self, app, fg=None, bg=None, font=None, theme=None):
|
def initToolkit(self, app, fg=None, bg=None, font=None, theme=None):
|
||||||
|
setupApp(app)
|
||||||
sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth()
|
sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth()
|
||||||
self.wm_group(self)
|
self.wm_group(self)
|
||||||
self.wm_title(PACKAGE + ' ' + VERSION)
|
self.wm_title(PACKAGE + ' ' + VERSION)
|
||||||
|
|
86
setup_osx.py
Normal file
86
setup_osx.py
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
"""
|
||||||
|
Usage:
|
||||||
|
python setup.py py2app
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
from subprocess import call
|
||||||
|
from setuptools import setup
|
||||||
|
from pysollib.settings import PACKAGE, VERSION, FC_VERSION
|
||||||
|
|
||||||
|
# Use Tile widgets, if they are installed.
|
||||||
|
# http://tktable.sourceforge.net/tile/
|
||||||
|
import Tkinter
|
||||||
|
root = Tkinter.Tk()
|
||||||
|
root.withdraw()
|
||||||
|
try:
|
||||||
|
root.tk.call('package', 'require', 'tile', '0.7.8')
|
||||||
|
except:
|
||||||
|
TILE = None
|
||||||
|
else:
|
||||||
|
TILE = "tile0.7.8"
|
||||||
|
TCL_EXTENSION_PATH = "/Library/Tcl"
|
||||||
|
finally:
|
||||||
|
root.destroy()
|
||||||
|
del root, Tkinter
|
||||||
|
|
||||||
|
# Use Freecell Solver, if it is installed.
|
||||||
|
# http://fc-solve.berlios.de/
|
||||||
|
SOLVER_LIB_PATH = "/usr/local/lib/libfreecell-solver.0.dylib"
|
||||||
|
SOLVER = "/usr/local/bin/fc-solve"
|
||||||
|
if not os.path.exists(SOLVER_LIB_PATH):
|
||||||
|
SOLVER_LIB_PATH = SOLVER = ""
|
||||||
|
|
||||||
|
GETINFO_STRING = "PySol Fan Club Edition \
|
||||||
|
%s %s, (C) 1998-2003 Markus F.X.J Oberhumer \
|
||||||
|
%s, (C) 2006 Skomoroh" % (PACKAGE, VERSION, FC_VERSION)
|
||||||
|
PLIST = dict(
|
||||||
|
CFBundleDevelopmentRegion = 'en_US',
|
||||||
|
CFBundleExecutable = PACKAGE,
|
||||||
|
CFBundleDisplayName = PACKAGE,
|
||||||
|
CFBundleGetInfoString = GETINFO_STRING,
|
||||||
|
CFBundleIdentifier = 'org.pysol.PySol',
|
||||||
|
CFBundleName = PACKAGE,
|
||||||
|
CFBundleVersion = '%s (%s)' % (VERSION, FC_VERSION),
|
||||||
|
CFBundleShortVersionString = '%s' % VERSION,
|
||||||
|
NSHumanReadableCopyright = "Copyright (C) 1998-2003 Markus F.X.J. Oberhumer",
|
||||||
|
)
|
||||||
|
APP = ['pysol.py']
|
||||||
|
ICON_FILE = 'data/PySol.icns'
|
||||||
|
DATA_FILES = ['docs', 'data', 'scripts','COPYING', 'README', SOLVER]
|
||||||
|
RESOURCES = [os.path.join(TCL_EXTENSION_PATH, TILE)] if TILE else []
|
||||||
|
FRAMEWORKS = [SOLVER_LIB_PATH]
|
||||||
|
OPTIONS = dict(argv_emulation=True,
|
||||||
|
plist=PLIST,
|
||||||
|
iconfile=ICON_FILE,
|
||||||
|
resources=RESOURCES,
|
||||||
|
frameworks=FRAMEWORKS,
|
||||||
|
excludes=['pysollib.pysolgtk']
|
||||||
|
)
|
||||||
|
|
||||||
|
setup(
|
||||||
|
app=APP,
|
||||||
|
data_files=DATA_FILES,
|
||||||
|
options={'py2app': OPTIONS},
|
||||||
|
setup_requires=['py2app'],
|
||||||
|
)
|
||||||
|
|
||||||
|
##
|
||||||
|
top = os.getcwd()
|
||||||
|
# FIXME: a hack to get Tcl extensions working
|
||||||
|
# from inside the app bundle
|
||||||
|
if TILE and "py2app" in sys.argv:
|
||||||
|
os.chdir('dist/%s.app/Contents/Frameworks' % PACKAGE)
|
||||||
|
try:
|
||||||
|
os.symlink('../Resources/%s' % TILE, TILE)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
os.chdir(top)
|
||||||
|
# Modify the fc-solve binary with install_name_tool to use the dependent
|
||||||
|
# libfreecell-solver dynamic library in the app bundle.
|
||||||
|
if SOLVER and "py2app" in sys.argv:
|
||||||
|
os.chdir('dist/%s.app/Contents/Resources' % PACKAGE)
|
||||||
|
call("install_name_tool -change \
|
||||||
|
/usr/local/lib/libfreecell-solver.0.dylib \
|
||||||
|
@executable_path/../Frameworks/libfreecell-solver.0.dylib fc-solve",
|
||||||
|
shell=True)
|
Loading…
Add table
Reference in a new issue