Ticket #46388: patch-macosx-mac-app.py.diff

File patch-macosx-mac-app.py.diff, 1.5 KB (added by dliessi (Davide Liessi), 10 years ago)
  • macosx/mac-app.py

    old new  
    1717macosx = os.path.realpath(os.path.dirname(__file__))
    1818root = os.path.dirname(macosx)
    1919
    20 sys.path.append(root)
     20sys.path.insert(0, root)
    2121
    2222from frescobaldi_app import info
    23 from frescobaldi_app.portmidi import pm_ctypes
     23try:
     24    from frescobaldi_app.portmidi import pm_ctypes
     25    dylib_name = pm_ctypes.dll_name
     26except ImportError:
     27    dylib_name = None
    2428
    2529icon = '{0}/icons/{1}.icns'.format(macosx, info.name)
    2630ipstrings = '{0}/app_resources/InfoPlist.strings'.format(macosx)
     
    4044  (WARNING: some manual steps are required after the execution of this script)')
    4145parser.add_argument('-p', '--portmidi', \
    4246  help = 'full path of PortMIDI library (used only with \'-a\')', \
    43   default = pm_ctypes.dll_name)
     47  default = dylib_name)
    4448parser.add_argument('-r', '--arch', \
    4549  help = 'architecture set to include, e.g. i386, x86_64, intel; \
    4650  if the value is None, the architecture of the current Python binary is used \
     
    5256If you really want to point the application bundle to \'{0}\',\n\
    5357use the \'-f\' or \'--force\' flag.'.format(args.script))
    5458
    55 if args.standalone and not os.path.isfile(args.portmidi):
     59if args.standalone and not (isinstance(args.portmidi, basestring) and os.path.isfile(args.portmidi)):
    5660    sys.exit('Error: \'{0}\' does not exist or is not a file.'.format(args.portmidi))
    5761
    5862plist = dict(