Changeset db7b92e in sasview for sansview


Ignore:
Timestamp:
May 3, 2010 10:28:58 AM (15 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
ee370db
Parents:
481ad37
Message:

sansview: update build script for mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/build_sansview.py

    r5353e1c rdb7b92e  
    1616# 
    1717#   - mingw must be installed 
     18# 
     19# On Mac: 
     20#   - Macholib must be installed to use py2app 
    1821# 
    1922# Usage: 
     
    3538timestamp = int(time.time()) 
    3639CWD    = os.getcwd() 
    37  
    3840INSTALL_FOLDER = "install_%s" % str(timestamp) 
    39 LIB_FOLDER = "%s\%s" % (CWD, INSTALL_FOLDER) 
     41 
     42# On Windows, the python executable is not always on the path. 
     43# Use its most frequent location as the default. 
     44if sys.platform == 'win32': 
     45    PYTHON = "c:\python25\python" 
     46    LIB_FOLDER = "%s/%s" % (CWD, INSTALL_FOLDER) 
     47else: 
     48    PYTHON = 'python' 
    4049 
    4150logging.basicConfig(level=logging.INFO, 
     
    4352                    filename='build_%s.log' % str(timestamp), 
    4453                    filemode='w') 
    45  
    46  
    47 # On Windows, the python executable is not always on the path. 
    48 # Use its most frequent location as the default. 
    49 if sys.platform == 'win32': 
    50     PYTHON = "c:\python25\python" 
    51 else: 
    52     PYTHON = 'python' 
    5354 
    5455SVN    = "svn" 
     
    137138        if sys.platform == 'win32': 
    138139            os.system("%s setup.py -q build -cmingw32" % PYTHON) 
     140            os.system("%s setup.py -q install --root \"%s\"" % (PYTHON, LIB_FOLDER)) 
    139141        else: 
    140             os.system("%s setup.py -q build" % PYTHON) 
    141         os.system("%s setup.py -q install --root \"%s\"" % (PYTHON, LIB_FOLDER)) 
     142            os.system("%s setup.py build" % PYTHON) 
     143            os.system("%s setup.py install --prefix ~/.local" % PYTHON) 
    142144    except: 
    143145        logging.error("Install failed for %s" % url) 
     
    154156    os.chdir(wd) 
    155157    if release: 
     158        install_pkg(".", "DataLoader-%s" % DATALOADER, DATALOADER_URL) 
     159    else: 
     160        install_pkg(".", "DataLoader", "svn://danse.us/sans/trunk/DataLoader") 
     161     
     162    os.chdir(wd) 
     163    if release: 
    156164        install_pkg(".", "sansmodels-%s/src" % SANSMODELS, SANSMODELS_URL) 
    157165    else: 
    158166        install_pkg(".", "sansmodels/src", "svn://danse.us/sans/trunk/sansmodels") 
    159      
    160     os.chdir(wd) 
    161     if release: 
    162         install_pkg(".", "DataLoader-%s" % DATALOADER, DATALOADER_URL) 
    163     else: 
    164         install_pkg(".", "DataLoader", "svn://danse.us/sans/trunk/DataLoader") 
    165167     
    166168    os.chdir(wd) 
     
    355357                checkout(True) 
    356358                if sys.platform=='win32': 
    357                     logging.info("Building installer from release version") 
     359                    logging.info("Building Windows installer from release version") 
    358360                    os.chdir("sansview-%s" % (SANSVIEW)) 
    359                     os.system("%s setup_exe.py -q py2exe --extrapath \"%s\python25\lib\site-packages\"" % (PYTHON, LIB_FOLDER)) 
     361                    os.system("%s setup_exe.py py2exe --extrapath \"%s\python25\lib\site-packages\"" % (PYTHON, LIB_FOLDER)) 
    360362                    os.system("%s/Q installer.iss" % INNO) 
    361363                    shutil.copy2(os.path.join("Output","setupSansView.exe"),  
    362364                                 os.path.join(CWD, "setupSansView_%s.exe" % str(timestamp))) 
    363365                elif sys.platform=='darwin': 
    364                     #TODO: bundle a Mac app 
    365                     pass 
     366                    logging.info("Building Mac application from release version") 
     367                    os.chdir("sansview-%s" % (SANSVIEW)) 
     368                    os.system("%s setup_mac.py py2app" % PYTHON)                     
    366369                     
    367370    raw_input("Press enter to continue\n") 
Note: See TracChangeset for help on using the changeset viewer.