mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Include the svn revision in the version numbers.
Various other sdist and bdist tweaks and updates. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
53
build.py
53
build.py
@@ -32,7 +32,6 @@ from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, fi
|
|||||||
getSvnRev, runcmd, textfile_open, getSipFiles, \
|
getSvnRev, runcmd, textfile_open, getSipFiles, \
|
||||||
getVisCVersion
|
getVisCVersion
|
||||||
|
|
||||||
|
|
||||||
import buildtools.version as version
|
import buildtools.version as version
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
@@ -51,6 +50,9 @@ unstable_series = (version.VER_MINOR % 2) == 1 # is the minor version odd or ev
|
|||||||
isWindows = sys.platform.startswith('win')
|
isWindows = sys.platform.startswith('win')
|
||||||
isDarwin = sys.platform == "darwin"
|
isDarwin = sys.platform == "darwin"
|
||||||
|
|
||||||
|
baseName = 'wxPython_Phoenix'
|
||||||
|
eggInfoName = baseName + '.egg-info'
|
||||||
|
|
||||||
|
|
||||||
# Some tools will be downloaded for the builds. These are the versions and
|
# Some tools will be downloaded for the builds. These are the versions and
|
||||||
# MD5s of the tool binaries currently in use.
|
# MD5s of the tool binaries currently in use.
|
||||||
@@ -791,9 +793,9 @@ def cmd_docs_bdist(options, args):
|
|||||||
cmdTimer = CommandTimer('docs_bdist')
|
cmdTimer = CommandTimer('docs_bdist')
|
||||||
pwd = pushDir(phoenixDir())
|
pwd = pushDir(phoenixDir())
|
||||||
|
|
||||||
svnrev = getSvnRev()
|
cfg = Config()
|
||||||
|
|
||||||
rootname = "wxPython-Phoenix-%s-docs" % svnrev
|
rootname = "%s-%s-docs" % (baseName, cfg.VERSION)
|
||||||
tarfilename = "dist/%s.tar.gz" % rootname
|
tarfilename = "dist/%s.tar.gz" % rootname
|
||||||
|
|
||||||
if not os.path.exists('dist'):
|
if not os.path.exists('dist'):
|
||||||
@@ -1215,11 +1217,18 @@ def cmd_bdist_wininst(options, args):
|
|||||||
_doSimpleSetupCmd(options, args, 'bdist_wininst')
|
_doSimpleSetupCmd(options, args, 'bdist_wininst')
|
||||||
|
|
||||||
# bdist_msi requires the version number to be only 3 components, but we're
|
# bdist_msi requires the version number to be only 3 components, but we're
|
||||||
# using 4. TODO: Fix this?
|
# using 4. TODO: Can we fix this?
|
||||||
#def cmd_bdist_msi(options, args):
|
#def cmd_bdist_msi(options, args):
|
||||||
# _doSimpleSetupCmd(options, args, 'bdist_msi')
|
# _doSimpleSetupCmd(options, args, 'bdist_msi')
|
||||||
|
|
||||||
|
|
||||||
|
def cmd_egg_info(options, args, egg_base=None):
|
||||||
|
cmdTimer = CommandTimer('egg_info')
|
||||||
|
VERBOSE = '--verbose' if options.verbose else ''
|
||||||
|
BASE = '--egg-base '+egg_base if egg_base is not None else ''
|
||||||
|
cmd = "%s setup.py egg_info %s %s" % (PYTHON, VERBOSE, BASE)
|
||||||
|
runcmd(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1341,10 +1350,12 @@ def cmd_sdist(options, args):
|
|||||||
cmdTimer = CommandTimer('sdist')
|
cmdTimer = CommandTimer('sdist')
|
||||||
assert os.getcwd() == phoenixDir()
|
assert os.getcwd() == phoenixDir()
|
||||||
|
|
||||||
|
cfg = Config()
|
||||||
|
|
||||||
isGit = os.path.exists('.git')
|
isGit = os.path.exists('.git')
|
||||||
isSvn = os.path.exists('.svn')
|
isSvn = os.path.exists('.svn')
|
||||||
if not isGit and not isSvn:
|
if not isGit and not isSvn:
|
||||||
msg("Sorry, I don't know what to do in this source tree, no git or svn repos found.")
|
msg("Sorry, I don't know what to do in this source tree, no git or svn workspace found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
# make a tree for building up the archive files
|
# make a tree for building up the archive files
|
||||||
@@ -1389,16 +1400,14 @@ def cmd_sdist(options, args):
|
|||||||
|
|
||||||
# Add some extra stuff to the root folder
|
# Add some extra stuff to the root folder
|
||||||
copyFile('packaging/setup.py', ADEST)
|
copyFile('packaging/setup.py', ADEST)
|
||||||
copyFile('packaging/README.rst', ADEST)
|
copyFile('packaging/README-sdist.txt', opj(ADEST, 'README.txt'))
|
||||||
cmd = "%s setup.py egg_info --egg-base %s" % (PYTHON, ADEST)
|
cmd_egg_info(options, args, egg_base=ADEST)
|
||||||
runcmd(cmd)
|
|
||||||
copyFile(opj(ADEST, 'wxPython_Phoenix.egg-info/PKG-INFO'),
|
copyFile(opj(ADEST, 'wxPython_Phoenix.egg-info/PKG-INFO'),
|
||||||
opj(ADEST, 'PKG-INFO'))
|
opj(ADEST, 'PKG-INFO'))
|
||||||
|
|
||||||
# build the tarball
|
# build the tarball
|
||||||
msg('Archiving Phoenix source...')
|
msg('Archiving Phoenix source...')
|
||||||
svnrev = getSvnRev()
|
rootname = "%s-%s-src" % (baseName, cfg.VERSION)
|
||||||
rootname = "wxPython-Phoenix-%s-src" % svnrev
|
|
||||||
tarfilename = "dist/%s.tar.gz" % rootname
|
tarfilename = "dist/%s.tar.gz" % rootname
|
||||||
if os.path.exists(tarfilename):
|
if os.path.exists(tarfilename):
|
||||||
os.remove(tarfilename)
|
os.remove(tarfilename)
|
||||||
@@ -1424,20 +1433,18 @@ def cmd_bdist(options, args):
|
|||||||
cmdTimer = CommandTimer('bdist')
|
cmdTimer = CommandTimer('bdist')
|
||||||
assert os.getcwd() == phoenixDir()
|
assert os.getcwd() == phoenixDir()
|
||||||
|
|
||||||
|
cmd_egg_info(options, args)
|
||||||
|
cfg = Config()
|
||||||
|
|
||||||
dllext = ".so"
|
dllext = ".so"
|
||||||
environ_script="packaging/phoenix_environ.sh"
|
|
||||||
readme = "packaging/README.txt"
|
|
||||||
wxlibdir = os.path.join(getBuildDir(options), "lib")
|
wxlibdir = os.path.join(getBuildDir(options), "lib")
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('darwin'):
|
||||||
environ_script = None
|
|
||||||
elif sys.platform.startswith('darwin'):
|
|
||||||
dllext = ".dylib"
|
dllext = ".dylib"
|
||||||
|
|
||||||
svnrev = getSvnRev()
|
|
||||||
platform = sys.platform
|
platform = sys.platform
|
||||||
if isWindows and PYTHON_ARCH == '64bit':
|
if isWindows and PYTHON_ARCH == '64bit':
|
||||||
platform = 'win64'
|
platform = 'win64'
|
||||||
rootname = "wxPython-Phoenix-%s-%s-py%s" % (svnrev, platform, PYVER)
|
rootname = "%s-%s-%s-py%s" % (baseName, cfg.VERSION, platform, PYVER)
|
||||||
tarfilename = "dist/%s.tar.gz" % rootname
|
tarfilename = "dist/%s.tar.gz" % rootname
|
||||||
|
|
||||||
if not os.path.exists('dist'):
|
if not os.path.exists('dist'):
|
||||||
@@ -1447,8 +1454,12 @@ def cmd_bdist(options, args):
|
|||||||
os.remove(tarfilename)
|
os.remove(tarfilename)
|
||||||
msg("Archiving Phoenix binaries...")
|
msg("Archiving Phoenix binaries...")
|
||||||
tarball = tarfile.open(name=tarfilename, mode="w:gz")
|
tarball = tarfile.open(name=tarfilename, mode="w:gz")
|
||||||
tarball.add('wx', os.path.join(rootname, 'wx'),
|
tarball.add('wx', opj(rootname, 'wx'),
|
||||||
filter=lambda info: None if '.svn' in info.name else info)
|
filter=lambda info: None if '.svn' in info.name \
|
||||||
|
or info.name.endswith('.pyc') \
|
||||||
|
or '__pycache__' in info.name else info)
|
||||||
|
tarball.add(eggInfoName, opj(rootname, eggInfoName))
|
||||||
|
|
||||||
if not isDarwin and not isWindows and not options.no_magic and not options.use_syswx:
|
if not isDarwin and not isWindows and not options.no_magic and not options.use_syswx:
|
||||||
# If the DLLs are not already in the wx package folder then go fetch
|
# If the DLLs are not already in the wx package folder then go fetch
|
||||||
# them now.
|
# them now.
|
||||||
@@ -1457,9 +1468,7 @@ def cmd_bdist(options, args):
|
|||||||
for dll in dlls:
|
for dll in dlls:
|
||||||
tarball.add(dll, os.path.join(rootname, 'wx', os.path.basename(dll)))
|
tarball.add(dll, os.path.join(rootname, 'wx', os.path.basename(dll)))
|
||||||
|
|
||||||
if environ_script:
|
tarball.add('packaging/README-bdist.txt', os.path.join(rootname, 'README.txt'))
|
||||||
tarball.add(environ_script, os.path.join(rootname, os.path.basename(environ_script)))
|
|
||||||
tarball.add(readme, os.path.join(rootname, os.path.basename(readme)))
|
|
||||||
tarball.close()
|
tarball.close()
|
||||||
|
|
||||||
if options.upload_package:
|
if options.upload_package:
|
||||||
|
|||||||
@@ -94,16 +94,24 @@ class Configuration(object):
|
|||||||
# load the version numbers into this instance's namespace
|
# load the version numbers into this instance's namespace
|
||||||
versionfile = opj(os.path.split(__file__)[0], 'version.py')
|
versionfile = opj(os.path.split(__file__)[0], 'version.py')
|
||||||
myExecfile(versionfile, self.__dict__)
|
myExecfile(versionfile, self.__dict__)
|
||||||
|
|
||||||
# If we're doing a dated build then alter the VERSION strings
|
# Include the subversion revision in the version number?
|
||||||
if os.path.exists('DAILY_BUILD'):
|
if os.environ.get('WXRELEASE') is None:
|
||||||
self.VER_FLAGS += '.b' + open('DAILY_BUILD').read().strip()
|
# TODO: It would be nice to have a better fallback than the date
|
||||||
|
# if this is not being run in a svn or git-svn environment...
|
||||||
|
# Perhaps writing the last used valid revision number to a file?
|
||||||
|
# Or perhaps pull it from the PKG-INFO file in egg-info?
|
||||||
|
#
|
||||||
|
# TODO #2: an environment variable is not a good way to control
|
||||||
|
# this...
|
||||||
|
self.VER_FLAGS = '-' + getSvnRev()
|
||||||
|
|
||||||
self.VERSION = "%s.%s.%s.%s%s" % (self.VER_MAJOR,
|
self.VERSION = "%s.%s.%s.%s%s" % (self.VER_MAJOR,
|
||||||
self.VER_MINOR,
|
self.VER_MINOR,
|
||||||
self.VER_RELEASE,
|
self.VER_RELEASE,
|
||||||
self.VER_SUBREL,
|
self.VER_SUBREL,
|
||||||
self.VER_FLAGS)
|
self.VER_FLAGS)
|
||||||
|
|
||||||
self.WXDLLVER = '%d%d' % (self.VER_MAJOR, self.VER_MINOR)
|
self.WXDLLVER = '%d%d' % (self.VER_MAJOR, self.VER_MINOR)
|
||||||
|
|
||||||
# change the PORT default for wxMac
|
# change the PORT default for wxMac
|
||||||
|
|||||||
@@ -14,5 +14,5 @@
|
|||||||
VER_MAJOR = 2 # The first three must match wxWidgets
|
VER_MAJOR = 2 # The first three must match wxWidgets
|
||||||
VER_MINOR = 9
|
VER_MINOR = 9
|
||||||
VER_RELEASE = 5
|
VER_RELEASE = 5
|
||||||
VER_SUBREL = 80 # wxPython release num for x.y.z release of wxWidgets
|
VER_SUBREL = 81 # wxPython release num for x.y.z release of wxWidgets
|
||||||
VER_FLAGS = "" # release flags, such as prerelease or RC num, etc.
|
VER_FLAGS = "" # release flags, such as prerelease or RC num, etc.
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Help Python find Phoenix
|
|||||||
|
|
||||||
All the usual suspects apply here. You can simply add this folder to
|
All the usual suspects apply here. You can simply add this folder to
|
||||||
your PYTHONPATH environment variable. Or you can add a phoenix.pth
|
your PYTHONPATH environment variable. Or you can add a phoenix.pth
|
||||||
file to some place already on the sys.path which contains the path to
|
file to someplace already on the sys.path which contains the path to
|
||||||
this folder. Or you can even copy the wx folder into the
|
this folder. Or you can even copy the wx folder into the
|
||||||
site-packages folder in your virtualenv.
|
site-packages folder in your virtualenv.
|
||||||
|
|
||||||
@@ -38,30 +38,20 @@ site-packages folder in your virtualenv.
|
|||||||
Help Phoenix find wxWidgets
|
Help Phoenix find wxWidgets
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
The Phoenix extension modules need to load the dynamic libraries that
|
The Phoenix extension modules need to load the dynamic libraries that contain
|
||||||
contain the wxWidgets code for the platform. For the Windows platform
|
the wxWidgets code for the platform. In most cases the extension modules in
|
||||||
nothing extra should be needed because the system will automatically
|
this snapshot already know to look in the same folder for the wxWidgets
|
||||||
look for the DLLs in the same folder that the extension modules are
|
shared libraries. This will work for Windows and Mac, and should also work
|
||||||
located in.
|
for any unix-like system based on ELF binaries, and if the expected objdump
|
||||||
|
utility was found on the build system.
|
||||||
|
|
||||||
For Mac OSX there should also not be anything extra needed to help
|
For those cases where the build was not able to perform the neccesary magic
|
||||||
Phoenix find the wxWidgets dynamic libraries because the install names
|
required to be able to make and use relocatable shared libraries, you may
|
||||||
have been modified to use @loader_path so they can find the libraries
|
need to do a little extra to help wxPython find the wxWidgets libraries.
|
||||||
in the same folder as the extension modules.
|
Check your platform's documentation for details, but it may be as simple as
|
||||||
|
setting the LD_LIBRARY_PATH variable in the environment. For example if
|
||||||
For Unix-like systems like Linux the locations that are searched for
|
you're in the folder where this README is located, then you can do something
|
||||||
the dynamic libraries can be controlled by setting the LD_LIBRARY_PATH
|
like this::
|
||||||
environment variable. Basically you just need to set that variable to
|
|
||||||
the path of the wx package, for example if you're in the folder where
|
|
||||||
this README is located, then you can do something like this::
|
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=`pwd`/wx
|
export LD_LIBRARY_PATH=`pwd`/wx
|
||||||
|
|
||||||
The phoenix_environ.sh shell script included with this build can help
|
|
||||||
you do that, just be sure to use the "source" command so the variables
|
|
||||||
in the current shell's environment will be modified.
|
|
||||||
|
|
||||||
It is also possible to embed the path that the dynamic library should
|
|
||||||
be loaded from directly into the extension module. For now at least
|
|
||||||
this is left as an exercise for the reader. Look for the chrpath
|
|
||||||
tool.
|
|
||||||
19
packaging/README-sdist.txt
Normal file
19
packaging/README-sdist.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
================
|
||||||
|
wxPython Phoenix
|
||||||
|
================
|
||||||
|
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
============
|
||||||
|
|
||||||
|
Phoenix is a new implementation of wxPython focused on improving speed,
|
||||||
|
maintainability and extensibility. Just like wxPython it wraps the wxWidgets
|
||||||
|
C++ toolkit and provides access to the UI portions of the wx API, enabling
|
||||||
|
Python applications to have a GUI on Windows, Macs or Unix systems with a
|
||||||
|
native look and feel and requiring very little (if any) platform specific code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
More to be written...
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
|
|
||||||
export PYTHONPATH=$DIR
|
|
||||||
export LD_LIBRARY_PATH=$DIR/wx
|
|
||||||
Reference in New Issue
Block a user