Changeset 103028 in vbox for trunk/src/VBox/Installer/darwin
- Timestamp:
- Jan 24, 2024 3:53:59 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 161263
- Location:
- trunk/src/VBox/Installer/darwin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/darwin/Makefile.kmk
r101552 r103028 721 721 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk \ 722 722 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer \ 723 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/ vboxapi \723 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/python/vboxapi \ 724 724 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/ \ 725 725 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom \ -
trunk/src/VBox/Installer/darwin/VirtualBox/postflight
r98103 r103028 34 34 # Install the Python bindings 35 35 # 36 ## @todo r=andy Merge this code with linux/routines.sh! 37 # 36 38 VBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS 37 PYTHON="python python2.3 python2.5 python2.6 python2.7" 38 if [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then 39 for p in $PYTHON; do 39 PYTHON_INSTALLER_PATH="$VBOX_INSTALL_PATH/sdk/installer/python" 40 PYTHON_BINARIES="\ 41 python2.7 \ 42 python2 \ 43 python3.3 \ 44 python3.4 \ 45 python3.5 \ 46 python3.6 \ 47 python3.7 \ 48 python3.8 \ 49 python3.9 \ 50 python3.10 \ 51 python3.11 \ 52 python3.12 \ 53 python3 \ 54 python" 55 56 if [ -e "$PYTHON_INSTALLER_PATH/vboxapisetup.py" ]; then 57 for PYTHON_BIN in $PYTHON_BINARIES; do 40 58 # Install the python bindings if python is in the path 41 if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then 42 echo 1>&2 "Python found: ${p}, installing bindings..." 43 # Pass install path via environment 44 export VBOX_INSTALL_PATH 45 /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install" 46 /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py clean --all" 59 if [ "`\${PYTHON_BIN} -c 'print "test"' 2> /dev/null`" = "test" ]; then 60 echo 1>&2 "Python found: ${PYTHON_BIN}, installing bindings..." 61 # Pass install path via environment 62 export VBOX_INSTALL_PATH 63 # Check if python has working distutils 64 "$PYTHON_BIN" -c "from distutils.core import setup" > /dev/null 2>&1 65 if test "$?" -ne 0; then 66 echo 1>&2 "Python $PYTHON_VER does not have package 'distutils', checking for 'setuptools'..." 67 # Since Python 3.12 there are no distutils anymore. See PEP632. 68 "$PYTHON_BIN" -c "from setuptools import setup" > /dev/null 2>&1 69 if test "$?" -ne 0; then 70 echo 1>&2 "Python $PYTHON_VER also does not have package 'setuptools'. Skipping installation." 71 return 0 72 fi 73 # When we reach here, we have to use 'pip' in order to install our bindings (Python >= 3.12). 74 if test -x "`which pip 2>/dev/null`"; then 75 PYTHON_PIP_BIN=$(which pip) 76 else 77 echo 1>&2 "Python package manager 'pip' not found. Skipping installation." 78 fi 79 fi 80 81 if [ -n "$PYTHON_PIP_BIN" ]; then 82 # Note: We use '-v' to show verbose output of our setup.py script on error. 83 $SHELL -c "cd ${PYTHON_INSTALLER_PATH} && ${PYTHON_PIP_BIN} -v install ./vboxapi" 84 else 85 $SHELL -c "cd ${PYTHON_INSTALLER_PATH} && ${PYTHON_BIN} vboxapisetup.py install" 86 $SHELL -c "cd ${PYTHON_INSTALLER_PATH} && ${PYTHON_BIN} vboxapisetup.py clean --all" 87 fi 47 88 fi 48 89 done
Note:
See TracChangeset
for help on using the changeset viewer.