VirtualBox

Changeset 54684 in vbox


Ignore:
Timestamp:
Mar 7, 2015 10:22:27 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98839
Message:

vboxapi.py,vboxapisetup.py: Don't patch stuff in the bundle, breaks signing.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/common/vboxapisetup.py

    r43105 r54684  
    11"""
    2 Copyright (C) 2009-2012 Oracle Corporation
     2Copyright (C) 2009-2015 Oracle Corporation
    33
    44This file is part of VirtualBox Open Source Edition (OSE), as
     
    1717    import shutil
    1818    from distutils.sysconfig import get_python_lib
    19     comCache1 = os.path.join(get_python_lib(),'win32com', 'gen_py')
     19    comCache1 = os.path.join(get_python_lib(), 'win32com', 'gen_py')
    2020    comCache2 = os.path.join(os.environ.get("TEMP", "c:\\tmp"), 'gen_py')
    2121    print "Cleaning COM cache at",comCache1,"and",comCache2
     
    2424
    2525def patchWith(file,install,sdk):
    26     newFile=file+".new"
     26    newFile=file + ".new"
    2727    install=install.replace("\\", "\\\\")
    2828    try:
     
    3333    newF = open(newFile, 'w')
    3434    for line in oldF:
    35         line=line.replace("%VBOX_INSTALL_PATH%",install)
    36         line=line.replace("%VBOX_SDK_PATH%",sdk)
     35        line = line.replace("%VBOX_INSTALL_PATH%", install)
     36        line = line.replace("%VBOX_SDK_PATH%", sdk)
    3737        newF.write(line)
    3838    newF.close()
     
    4646# See http://docs.python.org/distutils/index.html
    4747def main(argv):
    48     vboxDest=os.environ.get("VBOX_INSTALL_PATH", None)
     48    vboxDest = os.environ.get("VBOX_INSTALL_PATH", None)
    4949    if vboxDest is None:
    5050        raise Exception("No VBOX_INSTALL_PATH defined, exiting")
    51     vboxVersion=os.environ.get("VBOX_VERSION", None)
     51
     52    vboxVersion = os.environ.get("VBOX_VERSION", None)
    5253    if vboxVersion is None:
    5354        # Should we use VBox version for binding module versioning?
    5455        vboxVersion = "1.0"
     56
    5557    import platform
    56     if platform.system() == 'Darwin':
    57         vboxSdkDest = os.path.join(vboxDest, "..", "..", "..", "sdk")
    58         if not os.path.isdir(vboxSdkDest):
    59             vboxSdkDest = os.path.join(vboxDest, "sdk")
    60     else:
    61         vboxSdkDest = os.path.join(vboxDest, "sdk")
     58
    6259    if platform.system() == 'Windows':
    6360        cleanupComCache()
    64     patchWith(os.path.join(os.path.dirname(sys.argv[0]), 'vboxapi', '__init__.py'), vboxDest, vboxSdkDest)
     61
     62    # Darwin: Patched before installation. Modifying bundle is not allowed, breaks signing and upsets gatekeeper.
     63    if platform.system() != 'Darwin':
     64        vboxSdkDest = os.path.join(vboxDest, "sdk")
     65        patchWith(os.path.join(os.path.dirname(sys.argv[0]), 'vboxapi', '__init__.py'), vboxDest, vboxSdkDest)
     66
    6567    setup(name='vboxapi',
    66       version=vboxVersion,
    67       description='Python interface to VirtualBox',
    68       author='Oracle Corp.',
    69       author_email='[email protected]',
    70       url='http://www.virtualbox.org',
    71       packages=['vboxapi']
    72       )
    73 
     68          version=vboxVersion,
     69          description='Python interface to VirtualBox',
     70          author='Oracle Corp.',
     71          author_email='[email protected]',
     72          url='http://www.virtualbox.org',
     73          packages=['vboxapi']
     74          )
    7475
    7576if __name__ == '__main__':
    7677    main(sys.argv)
     78
  • trunk/src/VBox/Main/glue/vboxapi.py

    r54126 r54684  
    9494# Globals, environment and sys.path changes.
    9595#
     96import platform;
    9697VBoxBinDir = os.environ.get("VBOX_PROGRAM_PATH", None)
    9798VBoxSdkDir = os.environ.get("VBOX_SDK_PATH", None)
    9899
    99100if VBoxBinDir is None:
    100     # Will be set by the installer
    101     VBoxBinDir = "%VBOX_INSTALL_PATH%"
     101    if platform.system() == 'Darwin':
     102        VBoxBinDir = '/Applications/VirtualBox.app/Contents/MacOS'
     103    else: # Will be set by the installer
     104        VBoxBinDir = "%VBOX_INSTALL_PATH%"
    102105else:
    103106    VBoxBinDir = os.path.abspath(VBoxBinDir)
    104107
    105108if VBoxSdkDir is None:
    106     # Will be set by the installer
    107     VBoxSdkDir = "%VBOX_SDK_PATH%"
     109    if platform.system() == 'Darwin':
     110        VBoxSdkDir = '/Applications/VirtualBox.app/Contents/MacOS/sdk'
     111    else: # Will be set by the installer
     112        VBoxSdkDir = "%VBOX_SDK_PATH%"
    108113else:
    109114    VBoxSdkDir = os.path.abspath(VBoxSdkDir)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette