Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* make it possible to override the "python" binary used for everything
* if we're building with a python3 version, name the DMG and PKG files accordingly

git-svn-id: https://xpra.org/svn/Xpra/trunk@17881 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 4, 2018
1 parent 60344e7 commit f8bb423
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
15 changes: 10 additions & 5 deletions osx/make-DMG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ if [ ! -d "${APP_DIR}" ]; then
fi

#get the version and build info from the python build records:
PYTHON_COMMAND="${PYTHON_COMMAND:=python}"
PYTHON_MAJOR_VERSION=`${PYTHON_COMMAND} -c 'import sys;sys.stdout.write("%s" % sys.version_info[0])'`
export PYTHONPATH="${APP_DIR}/Contents/Resources/lib/python/"
VERSION=`python -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`python -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`python -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
BUILD_BIT=`python -c "from xpra import build_info;import sys;sys.stdout.write(str(build_info.BUILD_BIT))"`
VERSION=`${PYTHON_COMMAND} -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
BUILD_BIT=`${PYTHON_COMMAND} -c "from xpra import build_info;import sys;sys.stdout.write(str(build_info.BUILD_BIT))"`
BUILD_INFO=""
if [ "${PYTHON_MAJOR_VERSION}" == "3" ]; then
BUILD_INFO="${BUILD_INFO}-Python3"
fi
if [ "$BUILD_BIT" != "32bit" ]; then
BUILD_INFO="-x86_64"
BUILD_INFO="${BUILD_INFO}-x86_64"
fi

DMG_NAME="Xpra$BUILD_INFO-$VERSION-r$REVISION$REV_MOD.dmg"
Expand Down
15 changes: 10 additions & 5 deletions osx/make-PKG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ fi

#get the version and build info from the python build records:
export PYTHONPATH="${APP_DIR}/Contents/Resources/lib/python/"
VERSION=`python -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`python -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`python -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
BUILD_BIT=`python -c "from xpra import build_info;import sys;sys.stdout.write(str(build_info.BUILD_BIT))"`
PYTHON_COMMAND="${PYTHON_COMMAND:=python}"
PYTHON_MAJOR_VERSION=`${PYTHON_COMMAND} -c 'import sys;sys.stdout.write("%s" % sys.version_info[0])'`
VERSION=`${PYTHON_COMMAND} -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
BUILD_BIT=`${PYTHON_COMMAND} -c "from xpra import build_info;import sys;sys.stdout.write(str(build_info.BUILD_BIT))"`
BUILD_INFO=""
if [ "${PYTHON_MAJOR_VERSION}" == "3" ]; then
BUILD_INFO="${BUILD_INFO}-Python3"
fi
if [ "$BUILD_BIT" != "32bit" ]; then
BUILD_INFO="-x86_64"
BUILD_INFO="${BUILD_INFO}-x86_64"
fi

PKG_FILENAME="$APP_NAME$BUILD_INFO-$VERSION-r$REVISION$REV_MOD.pkg"
Expand Down
20 changes: 10 additions & 10 deletions osx/make-app.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

PYTHON_COMMAND="${PYTHON_COMMAND:=python}"
PYTHON_MAJOR_VERSION=`python3 -c 'import sys;sys.stdout.write("%s" % sys.version_info[0])'`
PYTHON_MINOR_VERSION=`python3 -c 'import sys;sys.stdout.write("%s" % sys.version_info[1])'`
PYTHON_MAJOR_VERSION=`$PYTHON_COMMAND -c 'import sys;sys.stdout.write("%s" % sys.version_info[0])'`
PYTHON_MINOR_VERSION=`$PYTHON_COMMAND -c 'import sys;sys.stdout.write("%s" % sys.version_info[1])'`


STRIP_DEFAULT="${STRIP_DEFAULT:=1}"
Expand Down Expand Up @@ -30,7 +30,7 @@ LIBDIR="${RSCDIR}/lib"

echo "*******************************************************************************"
echo "Deleting existing xpra modules and temporary directories"
PYTHON_PREFIX=`python-config --prefix`
PYTHON_PREFIX=`python${PYTHON_MAJOR_VERSION}-config --prefix`
PYTHON_PACKAGES=`ls -d ${PYTHON_PREFIX}/lib/python${PYTHON_MAJOR_VERSION}*/site-packages | sort | tail -n 1`
rm -fr "${PYTHON_PACKAGES}/xpra"*
rm -fr image/* dist
Expand All @@ -43,13 +43,13 @@ echo "Building and installing locally"
pushd ../src

svn upgrade ../.. >& /dev/null
python -c "from add_build_info import record_src_info;record_src_info()"
${PYTHON_COMMAND} -c "from add_build_info import record_src_info;record_src_info()"
rm -fr build/* dist/*
python ./setup.py clean
${PYTHON_COMMAND} ./setup.py clean
INSTALL_LOG=`pwd`/install.log
echo "./setup.py install ${BUILD_ARGS}"
echo " (see ${INSTALL_LOG} for details - this may take a minute or two)"
python ./setup.py install ${BUILD_ARGS} >& ${INSTALL_LOG}
${PYTHON_COMMAND} ./setup.py install ${BUILD_ARGS} >& ${INSTALL_LOG}
if [ "$?" != "0" ]; then
popd
echo "ERROR: install failed"
Expand All @@ -59,9 +59,9 @@ if [ "$?" != "0" ]; then
fi
#get the version and build info from the python build records:
export PYTHONPATH="."
VERSION=`python -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`python -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`python -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
VERSION=`${PYTHON_COMMAND} -c "from xpra import __version__;import sys;sys.stdout.write(__version__)"`
REVISION=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(str(src_info.REVISION))"`
REV_MOD=`${PYTHON_COMMAND} -c "from xpra import src_info;import sys;sys.stdout.write(['','M'][src_info.LOCAL_MODIFICATIONS>0])"`
echo "OK"

if [ "${DO_TESTS}" == "1" ]; then
Expand Down Expand Up @@ -89,7 +89,7 @@ echo "py2app step:"
PY2APP_LOG=`pwd`/py2app.log
echo "./setup.py py2app ${BUILD_ARGS}"
echo " (see ${PY2APP_LOG} for details - this may take a minute or two)"
python ./setup.py py2app ${BUILD_ARGS} >& ${PY2APP_LOG}
${PYTHON_COMMAND} ./setup.py py2app ${BUILD_ARGS} >& ${PY2APP_LOG}
if [ "$?" != "0" ]; then
echo "ERROR: py2app failed"
echo
Expand Down

0 comments on commit f8bb423

Please sign in to comment.