Changeset 4736


Ignore:
Timestamp:
Jan 7, 2021 3:53:49 PM (3 years ago)
Author:
toby
Message:

more install work

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • install/bootstrap.py

    r4732 r4736  
    1111skipInstallChecks = False  # if set to True, continue installation even if current Python lacks packages and
    1212                           # skips platform-dependent installation steps
     13                           #--> True: -noinstall or -binary=
    1314skipDownloadSteps = False  # if False, svn is used to download GSAS-II files and binaries
     15                           #--> True: -nonet
    1416skipProxy = False          # if False then the script creates a prompt asking for proxy info
     17                           #--> True: -nonet or -noproxy or -binary=
    1518showWXerror = False        # if True, errors are shown in wxPython windows (used on Windows only)
     19                           #--> True: -noinstall or -binary= (both on windows)
    1620help = False               # if True, a help message is shown
     21                           #--> True: -help
    1722allBinaries = False        # if True, causes all binaries to be installed
    18 binaryVersion=None         # if specified, gives a specific numpy version to use (such as 1.18)
     23                           #--> True: -allbinaries or -server
     24numpyVersion=None          # if specified, gives a specific numpy version to use (such as 1.18)
    1925                           # for selecting a set of binaries to use
    20 numpyVersion=None
     26                           #--> Set by: -binary=
    2127
    2228for a in sys.argv[1:]:
     
    581587elif numpyVersion:
    582588    binaryVersion = GSASIIpath.GetBinaryPrefix()+'_n'+numpyVersion
     589    print('Load binaries from '+binaryVersion)
    583590    if not GSASIIpath.svnSwitchDir('bindist','',g2home+ 'Binaries/'+binaryVersion,None,True):
    584591        msg = 'Binary load failed with '+binaryVersion+'. Subversion problem? Please seek help'
    585592        BailOut(msg)
    586593else:
     594    print('Load binaries matching current python/numpy')
    587595    GSASIIpath.DownloadG2Binaries(g2home)
    588596       
     
    649657            exec(source_file.read())
    650658
     659#===========================================================================
     660# on Windows, make a batch file with Python and GSAS-II location hard-coded
    651661if skipInstallChecks:
    652662    pass
    653 #===========================================================================
    654 # on Windows, make a batch file with Python and GSAS-II location hard-coded
    655663elif sys.platform.startswith('win') and os.path.exists(
    656664    os.path.join(path2GSAS2,"makeBat.py")):
     
    659667# on a Mac, make an applescript
    660668elif sys.platform.startswith('darwin') and os.path.exists(
    661     os.path.join(path2GSAS2,"makeMacApp.py")):
     669         os.path.join(path2GSAS2,"makeMacApp.py")):
    662670    sys.argv = [os.path.join(path2GSAS2,"makeMacApp.py")]
    663671    print(u'running '+sys.argv[0])
     
    666674# On linux, make desktop icon
    667675elif sys.platform.startswith('linux') and os.path.exists(
    668     os.path.join(path2GSAS2,"makeLinux.py")):
     676         os.path.join(path2GSAS2,"makeLinux.py")):
    669677    sys.argv = [os.path.join(path2GSAS2,"makeLinux.py")]
    670678    print(u'running '+sys.argv[0])
  • install/g2complete/build.sh.template

    r4710 r4736  
    88mkdir -p $PREFIX/GSASII
    99cp $RECIPE_DIR/src/bootstrap.py $PREFIX/GSASII
    10 python $PREFIX/GSASII/bootstrap.py --binary=**npversion** > $PREFIX/conda_G2build_log.txt
     10python $PREFIX/GSASII/bootstrap.py --binary=**npversion** > $PREFIX/GSASII/conda_G2build_log.txt 2>&1
  • install/g2complete/post-link.sh

    r4715 r4736  
    11#!/bin/bash
    2 echo "Complete installation GSAS-II and update from APS subversion server, if on network" > $PREFIX/GSASII/conda_inst.log
    3 # create bootstrap script
    4 #echo "# Commands to run GSAS-II load/update process" > $CONDA_ROOT/start_G2_bootstrap.sh
    5 #echo "source $CONDA_ROOT/bin/activate $CONDA_DEFAULT_ENV" >> $CONDA_ROOT/start_G2_bootstrap.sh
    6 #echo "$PREFIX/bin/python $PREFIX/GSASII/bootstrap.py" >> $CONDA_ROOT/start_G2_bootstrap.sh
     2echo "Complete complete installation GSAS-II from APS subversion server" > $PREFIX/GSASII/conda_inst.log
     3# Note: for g2complete create scripts to access bootstrap & start are moved to g2postinstall.sh (g2full)
    74#
    85# "install" the GSAS-II package (create shortcuts, byte-compile...)
    96#
    10 $PREFIX/bin/python $PREFIX/GSASII/bootstrap.py --nonet > /tmp/bootstrap1.log 2>> $PREFIX/GSASII/conda_inst.log 2>&1
     7$PREFIX/bin/python $PREFIX/GSASII/bootstrap.py --nonet >> $PREFIX/GSASII/conda_inst.log 2>&1
    118# Now try to update to latest GSAS-II version (will fail if no network)
    12 $PREFIX/bin/python $PREFIX/GSASII/bootstrap.py --noinstall > /tmp/bootstrap2.log 2>> $PREFIX/GSASII/conda_inst.log 2>&1
    13 # create start script
    14 #echo "# Commands to start GSAS-II" > $CONDA_ROOT/start_GSASII.sh
    15 #echo "source $CONDA_ROOT/bin/activate $CONDA_DEFAULT_ENV" >> $CONDA_ROOT/start_GSASII.sh
    16 #if [ -e $PREFIX/bin/pythonw ]
    17 #then
    18 #   echo "$PREFIX/bin/pythonw $PREFIX/GSASII/GSASII.py" >> $CONDA_ROOT/start_GSASII.sh
    19 #else
    20 #   echo "$PREFIX/bin/python $PREFIX/GSASII/GSASII.py" >> $CONDA_ROOT/start_GSASII.sh
    21 #fi
    22 #cp $PREFIX/GSASII/conda_inst.log $PREFIX/.messages.txt
    23 echo "GSAS-II bootstrap completed" > $PREFIX/.messages.txt
     9$PREFIX/bin/python $PREFIX/GSASII/bootstrap.py --noinstall >> $PREFIX/GSASII/conda_inst.log 2>&1
     10cp $PREFIX/GSASII/conda_inst.log $PREFIX/.messages.txt
     11echo "GSAS-II bootstrap completed" >> $PREFIX/.messages.txt
  • install/g2complete/src/bootstrap.py

    r4732 r4736  
    1111skipInstallChecks = False  # if set to True, continue installation even if current Python lacks packages and
    1212                           # skips platform-dependent installation steps
     13                           #--> True: -noinstall or -binary=
    1314skipDownloadSteps = False  # if False, svn is used to download GSAS-II files and binaries
     15                           #--> True: -nonet
    1416skipProxy = False          # if False then the script creates a prompt asking for proxy info
     17                           #--> True: -nonet or -noproxy or -binary=
    1518showWXerror = False        # if True, errors are shown in wxPython windows (used on Windows only)
     19                           #--> True: -noinstall or -binary= (both on windows)
    1620help = False               # if True, a help message is shown
     21                           #--> True: -help
    1722allBinaries = False        # if True, causes all binaries to be installed
    18 binaryVersion=None         # if specified, gives a specific numpy version to use (such as 1.18)
     23                           #--> True: -allbinaries or -server
     24numpyVersion=None          # if specified, gives a specific numpy version to use (such as 1.18)
    1925                           # for selecting a set of binaries to use
    20 numpyVersion=None
     26                           #--> Set by: -binary=
    2127
    2228for a in sys.argv[1:]:
     
    581587elif numpyVersion:
    582588    binaryVersion = GSASIIpath.GetBinaryPrefix()+'_n'+numpyVersion
     589    print('Load binaries from '+binaryVersion)
    583590    if not GSASIIpath.svnSwitchDir('bindist','',g2home+ 'Binaries/'+binaryVersion,None,True):
    584591        msg = 'Binary load failed with '+binaryVersion+'. Subversion problem? Please seek help'
    585592        BailOut(msg)
    586593else:
     594    print('Load binaries matching current python/numpy')
    587595    GSASIIpath.DownloadG2Binaries(g2home)
    588596       
     
    649657            exec(source_file.read())
    650658
     659#===========================================================================
     660# on Windows, make a batch file with Python and GSAS-II location hard-coded
    651661if skipInstallChecks:
    652662    pass
    653 #===========================================================================
    654 # on Windows, make a batch file with Python and GSAS-II location hard-coded
    655663elif sys.platform.startswith('win') and os.path.exists(
    656664    os.path.join(path2GSAS2,"makeBat.py")):
     
    659667# on a Mac, make an applescript
    660668elif sys.platform.startswith('darwin') and os.path.exists(
    661     os.path.join(path2GSAS2,"makeMacApp.py")):
     669         os.path.join(path2GSAS2,"makeMacApp.py")):
    662670    sys.argv = [os.path.join(path2GSAS2,"makeMacApp.py")]
    663671    print(u'running '+sys.argv[0])
     
    666674# On linux, make desktop icon
    667675elif sys.platform.startswith('linux') and os.path.exists(
    668     os.path.join(path2GSAS2,"makeLinux.py")):
     676         os.path.join(path2GSAS2,"makeLinux.py")):
    669677    sys.argv = [os.path.join(path2GSAS2,"makeLinux.py")]
    670678    print(u'running '+sys.argv[0])
  • install/g2full/g2postinstall.sh

    r4732 r4736  
    2121fi
    2222# in case constructor changed the binary files
    23 svn revert $PREFIX/GSASII/bindist/*
     23$PREFIX/bin/svn revert $PREFIX/GSASII/bindist/*
     24#create the GSAS-II app or Desktop icon (note that scripts run only on correct platform)
     25$PREFIX/bin/python $PREFIX/GSASII/makeMacApp.py
     26$PREFIX/bin/python $PREFIX/GSASII/makeLinux.py
  • trunk/makeLinux.py

    r3545 r4736  
    3030    print("\n\tUsage: python "+sys.argv[0]+" [<GSAS-II script>]\n")
    3131    sys.exit()
    32 if __name__ == '__main__':
     32
     33if __name__ == '__main__' and sys.platform.startswith('linux'):
    3334    # find the main GSAS-II script if not on command line
    3435    if len(sys.argv) == 1:
  • trunk/makeMacApp.py

    r4725 r4736  
    77created in the directory where the GSAS-II script (.../GSASII/GSASII.py)
    88is located. A softlink to Python is created inside that app bundle,
    9 but the softlink name is GSAS-II so that GSAS-II shows up as the name
    10 of the app rather than  Python in the menu bar, etc. A soft link named
     9but the softlink name is GSAS-II so that "GSAS-II" shows up as the name
     10of the app in the menu bar, etc. rather than "Python". A soft link named
    1111GSAS-II.py, referencing the GSASII.py script, is created so that some file
    1212menu items also are labeled with GSAS-II (but not the right capitalization,
     
    1515This has been tested with several versions of Python interpreters
    1616from Anaconda and does not require pythonw (Python.app). It tests to
    17 make sure that a wx python script will run inside Python and if not,
     17make sure that a wxpython script will run inside the app but if not,
    1818it searches for a pythonw image and tries that.
    1919
     
    5151'''
    5252
    53 if __name__ == '__main__':
     53if __name__ == '__main__' and sys.platform == "darwin":
    5454    project="GSAS-II"
    5555
Note: See TracChangeset for help on using the changeset viewer.