Changeset 7b35808 in sasview
- Timestamp:
- Apr 14, 2009 7:25:58 PM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 69bee6d
- Parents:
- ac166e9c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/build_sansview.py
r6e2fe95 r7b35808 25 25 import os 26 26 import shutil 27 27 import logging 28 29 # Installation folder 30 import time 31 timestamp = int(time.time()) 32 INSTALL_FOLDER = "install_%s" % str(timestamp) 33 34 logging.basicConfig(level=logging.INFO, 35 format='%(asctime)s %(levelname)s %(message)s', 36 filename='build_%s.log' % str(timestamp), 37 filemode='w') 38 39 CWD = os.getcwd() 28 40 PYTHON = "c:\python25\python" 29 41 SVN = "svn" … … 41 53 PARK_INTEG = "0.1.0" 42 54 55 # URLs for SVN repos 43 56 SANSMODELS_URL = "svn://danse.us/sans/releases/sansmodels-%s" % SANSMODELS 44 57 DATALOADER_URL = "svn://danse.us/sans/releases/DataLoader-%s" % DATALOADER … … 52 65 PARK_URL = "svn://danse.us/park/branches/park-1.2" 53 66 54 # Installation folder55 import time56 timestamp = int(time.time())57 INSTALL_FOLDER = "install_%s" % str(timestamp)58 59 67 60 68 def check_system(): … … 65 73 import wx 66 74 except: 67 print "wxpython missing"75 logging.error("wxpython missing") 68 76 69 77 try: 70 78 import matplotlib 71 79 except: 72 print "matplotlib missing"80 logging.error("matplotlib missing") 73 81 74 82 try: 75 83 import numpy 76 84 except: 77 print "numpy missing"85 logging.error("numpy missing") 78 86 79 87 try: 80 88 import scipy 81 89 except: 82 print "scipy missing"90 logging.error("scipy missing") 83 91 84 92 if os.system("gcc -dumpversion")==1: 85 print "missing mingw"93 logging.error("missing mingw") 86 94 87 95 def install_pkg(install_dir, setup_dir, url): … … 98 106 os.system("%s checkout -q %s" % (SVN, url)) 99 107 os.chdir(setup_dir) 100 os.system("%s setup.py build -cmingw32" % PYTHON)101 os.system("%s setup.py install" % PYTHON)108 os.system("%s setup.py -q build -cmingw32" % PYTHON) 109 os.system("%s setup.py -q install" % PYTHON) 102 110 103 111 def checkout(release=False): … … 158 166 os.chdir(wd) 159 167 if release: 160 os.system("%s checkout %s" % (SVN, SANSVIEW_URL))161 else: 162 os.system("%s checkout svn://danse.us/sans/trunk/sansview" % SVN)168 os.system("%s checkout -q %s" % (SVN, SANSVIEW_URL)) 169 else: 170 os.system("%s checkout -q svn://danse.us/sans/trunk/sansview" % SVN) 163 171 164 172 def prepare(): 173 """ 174 Prepare the build 175 """ 176 # Remove existing libraries 177 from distutils.sysconfig import get_python_lib 178 libdir = get_python_lib() 179 old_dirs = [os.path.join(libdir, 'danse'), 180 os.path.join(libdir, 'data_util'), 181 os.path.join(libdir, 'DataLoader'), 182 os.path.join(libdir, 'park'), 183 os.path.join(libdir, 'sans'), 184 os.path.join(libdir, 'sans_extension'), 185 ] 186 for d in old_dirs: 187 if os.path.isdir(d): 188 shutil.rmtree(d) 189 165 190 # Create a fresh installation folder 166 167 191 if os.path.isdir(INSTALL_FOLDER): 168 192 shutil.rmtree(INSTALL_FOLDER) … … 208 232 print PARK_URL 209 233 else: 234 logging.info("Build script for SansView %s" % SANSVIEW) 210 235 # Prepare installation folder 211 236 prepare() … … 213 238 # Check the command line argument 214 239 if sys.argv[1]=="-t": 215 print "Building trunk version"240 logging.info("Building trunk version") 216 241 checkout() 217 242 elif sys.argv[1]=="-r": 218 print "Building release version"243 logging.info("Building release version") 219 244 checkout(True) 220 245 elif sys.argv[1]=="-i": 221 print "Building release version"246 logging.info("Building release version") 222 247 checkout(True) 223 print "Building installer from release version"248 logging.info("Building installer from release version") 224 249 os.chdir("sansview-%s" % (SANSVIEW)) 225 os.system("%s setup_exe.py py2exe" % PYTHON) 226 os.system("%s installer.iss" % INNO) 227 250 os.system("%s setup_exe.py -q py2exe" % PYTHON) 251 os.system("%s/Q installer.iss" % INNO) 252 shutil.copy2(os.path.join("Output","setupSansView.exe"), 253 os.path.join(CWD, "setupSansView_%s.exe" % str(timestamp))) 254 255
Note: See TracChangeset
for help on using the changeset viewer.