diff --git a/build.py b/build.py index 72d7851c..4c5555b5 100755 --- a/build.py +++ b/build.py @@ -126,6 +126,7 @@ Usage: ./build.py [command(s)] [options] install_py Install wxPython only sdist Build a tarball containing all source files + sdist_demo Build a tarball containing just the demo and samples folders bdist Create a binary tarball release of wxPython Phoenix bdist_docs Build a tarball containing the documentation bdist_egg Build a Python egg. Requires magic. @@ -1670,12 +1671,11 @@ def cmd_sdist(options, args): if not os.path.exists('dist'): os.mkdir('dist') - if isGit: - # pull out an archive copy of the repo files - msg('Exporting Phoenix...') - runcmd('git archive HEAD | tar -x -C %s' % PDEST, echoCmd=False) - msg('Exporting wxWidgets...') - runcmd('(cd %s; git archive HEAD) | tar -x -C %s' % (WSRC, WDEST), echoCmd=False) + # pull out an archive copy of the repo files + msg('Exporting Phoenix...') + runcmd('git archive HEAD | tar -x -C %s' % PDEST, echoCmd=False) + msg('Exporting wxWidgets...') + runcmd('(cd %s; git archive HEAD) | tar -x -C %s' % (WSRC, WDEST), echoCmd=False) # copy Phoenix's generated code into the archive tree msg('Copying generated files...') @@ -1723,6 +1723,58 @@ def cmd_sdist(options, args): +def cmd_sdist_demo(options, args): + # Build a tarball containing the demo and samples + cmdTimer = CommandTimer('sdist_demo') + assert os.getcwd() == phoenixDir() + + cfg = Config() + + isGit = os.path.exists('.git') + if not isGit: + msg("Sorry, I don't know what to do in this source tree, no git workspace found.") + return + + # make a tree for building up the archive files + PDEST = 'build/sdist_demo' + if not os.path.exists(PDEST): + os.makedirs(PDEST) + + # and a place to put the final tarball + if not os.path.exists('dist'): + os.mkdir('dist') + + # pull out an archive copy of the repo files + msg('Exporting Phoenix/demo...') + runcmd('git archive HEAD demo | tar -x -C %s' % PDEST, echoCmd=False) + msg('Exporting Phoenix/demo/samples...') + runcmd('git archive HEAD samples | tar -x -C %s' % PDEST, echoCmd=False) + + # Add in the README file + copyFile('packaging/README-sdist_demo.txt', posixjoin(PDEST, 'README.txt')) + + # build the tarball + msg('Archiving Phoenix demo and samples...') + rootname = "%s-demo-%s" % (baseName, cfg.VERSION) + tarfilename = "dist/%s.tar.gz" % rootname + if os.path.exists(tarfilename): + os.remove(tarfilename) + tarball = tarfile.open(name=tarfilename, mode="w:gz") + pwd = pushDir(PDEST) + for name in glob.glob('*'): + tarball.add(name, os.path.join(rootname, name)) + tarball.close() + msg('Cleaning up...') + del pwd + shutil.rmtree(PDEST) + + if options.upload: + uploadPackage(tarfilename, options) + + msg("demo and samples tarball built at %s" % tarfilename) + + + def cmd_bdist(options, args): # Build a tarball and/or installer that includes all the files needed at # runtime for the current platform and the current version of Python. diff --git a/buildbot/master.cfg b/buildbot/master.cfg index 76c3de5a..4e662f71 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -239,7 +239,8 @@ def makeFactory(port, buildType='buildOnly', pyVer='2.7'): mode=mode, method=method)) if buildType == 'sdist': - cmd = 'python -u build.py %s setrev dox touch etg sip build sdist --upload' % pyVer + cmd = 'python -u build.py %s setrev dox touch etg sip build '\ + 'sdist sdist_demo --upload' % pyVer elif buildType == 'docs': cmd = 'python -u build.py %s setrev dox touch etg sip build wxlib ' \ diff --git a/packaging/README-sdist_demo.txt b/packaging/README-sdist_demo.txt new file mode 100644 index 00000000..cabde4e7 --- /dev/null +++ b/packaging/README-sdist_demo.txt @@ -0,0 +1,16 @@ +wxPython Demo and Samples +========================= + +This archive contains a copy of the wxPython Phoenix demo, and also a +collection of small sample applications. + +Once you have installed wxPython Phoenix you can run the demo by launching it +from a command line like this:: + + cd demo + python demo.py + +Each of the folders in the samples folder contains one or more standalone +applications demonstrating how to use certain features of wxPython. Examine +the source code in each sample to see how to run them. +