From ab045a1b8ec7feb398f043844557fae1a251175d Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Sat, 7 May 2011 14:08:05 +0000 Subject: [PATCH] dropped cmake for src dist --- CMakeLists.txt | 40 ---------------------------------------- tools/build/toolchain.py | 29 +++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 644a6d7f..c75d8f36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,13 +321,6 @@ if (CONF_CPACK) # both 32-bit and 64-bit processors. set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) - # For source code, use .tar.gz on Unix, and .zip on Windows - if (UNIX) - set(CPACK_SOURCE_GENERATOR TGZ) - else (UNIX) - set(CPACK_SOURCE_GENERATOR ZIP) - endif() - set(CPACK_PACKAGE_NAME "synergy") set(CPACK_PACKAGE_VENDOR "The Synergy Project") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Synergy server and client") @@ -339,39 +332,6 @@ if (CONF_CPACK) set(CPACK_RESOURCE_FILE_LICENSE "${cmake_dir}/License.rtf") set(CPACK_RESOURCE_FILE_README "${cmake_dir}/Readme.txt") - # files to exclude from src package (regex patterns) - # to escape, use 4 backslashes (\\\\) -- yuck! - set(CPACK_SOURCE_IGNORE_FILES - # temp output dirs in root - "/build/" - "/bin/" - "/lib/" - - # generated config.h file - "/config\\\\.h$" - - # buildbot stuff - "\\\\.buildbot\\\\-sourcedata$" - - # qt temp build dir - "/gui/tmp/.*" - - # qt make file - "/gui/Makefile$" - - # qt generated ui headers - "/gui/ui_.*\\\\.h$" - - # compiled python files - ".*\\\\.pyc$" - - # subversion caches (all dirs) - ".*/\\\\.svn/.*" - - # emacs temporary files - ".*~$" - ) - # Must be last (since it relies of CPACK_ vars). include(CPack) diff --git a/tools/build/toolchain.py b/tools/build/toolchain.py index ccf176ab..e840b7da 100644 --- a/tools/build/toolchain.py +++ b/tools/build/toolchain.py @@ -465,8 +465,7 @@ class InternalCommands: elif type == 'src': if sys.platform in ['linux2', 'darwin']: - self.dist_run('make package_source', unixTarget) - moveExt = 'tar.gz' + self.distSrc() else: package_unsupported = True @@ -509,6 +508,32 @@ class InternalCommands: ("Package type, '%s' is not supported for platform, '%s'") % (type, sys.platform)) + def distSrc(self): + version = self.getVersionFromCmake() + name = (self.project + '-' + version + '-Source') + exportPath = self.build_dir + '/' + name + + if os.path.exists(exportPath): + print "Removing existing export..." + import shutil + shutil.rmtree(exportPath) + + print 'Exporting repository to: ' + exportPath + err = os.system('svn export . ' + exportPath) + if err != 0: + raise Exception('Repository export failed: ' + str(err)) + + packagePath = '../' + self.bin_dir + '/' + name + '.tar.gz' + + try: + self.try_chdir(self.build_dir) + print 'Packaging to: ' + packagePath + err = os.system('tar cfvz ' + packagePath + ' ' + name) + if err != 0: + raise Exception('Package failed: ' + str(err)) + finally: + self.restore_chdir() + def unixMove(self, source, dest): print 'Moving ' + source + ' to ' + dest err = os.system('mv ' + source + ' ' + dest)