Changeset 54684 in vbox
- Timestamp:
- Mar 7, 2015 10:22:27 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98839
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/common/vboxapisetup.py
r43105 r54684 1 1 """ 2 Copyright (C) 2009-201 2Oracle Corporation2 Copyright (C) 2009-2015 Oracle Corporation 3 3 4 4 This file is part of VirtualBox Open Source Edition (OSE), as … … 17 17 import shutil 18 18 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') 20 20 comCache2 = os.path.join(os.environ.get("TEMP", "c:\\tmp"), 'gen_py') 21 21 print "Cleaning COM cache at",comCache1,"and",comCache2 … … 24 24 25 25 def patchWith(file,install,sdk): 26 newFile=file +".new"26 newFile=file + ".new" 27 27 install=install.replace("\\", "\\\\") 28 28 try: … … 33 33 newF = open(newFile, 'w') 34 34 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) 37 37 newF.write(line) 38 38 newF.close() … … 46 46 # See http://docs.python.org/distutils/index.html 47 47 def main(argv): 48 vboxDest =os.environ.get("VBOX_INSTALL_PATH", None)48 vboxDest = os.environ.get("VBOX_INSTALL_PATH", None) 49 49 if vboxDest is None: 50 50 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) 52 53 if vboxVersion is None: 53 54 # Should we use VBox version for binding module versioning? 54 55 vboxVersion = "1.0" 56 55 57 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 62 59 if platform.system() == 'Windows': 63 60 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 65 67 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 ) 74 75 75 76 if __name__ == '__main__': 76 77 main(sys.argv) 78 -
trunk/src/VBox/Main/glue/vboxapi.py
r54126 r54684 94 94 # Globals, environment and sys.path changes. 95 95 # 96 import platform; 96 97 VBoxBinDir = os.environ.get("VBOX_PROGRAM_PATH", None) 97 98 VBoxSdkDir = os.environ.get("VBOX_SDK_PATH", None) 98 99 99 100 if 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%" 102 105 else: 103 106 VBoxBinDir = os.path.abspath(VBoxBinDir) 104 107 105 108 if 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%" 108 113 else: 109 114 VBoxSdkDir = os.path.abspath(VBoxSdkDir)
Note:
See TracChangeset
for help on using the changeset viewer.