From: Cédric Aguerre Date: Thu, 4 Feb 2016 15:56:19 +0000 (+0100) Subject: Download archives X-Git-Tag: 160205_pv50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37b64eb08c91a637d636a855e1eab443c99c0e59;p=tools%2Fpvdeliv.git Download archives --- diff --git a/scripts/BuildSalomeMini.py b/scripts/BuildSalomeMini.py index 6db228e..06be8b4 100755 --- a/scripts/BuildSalomeMini.py +++ b/scripts/BuildSalomeMini.py @@ -12,14 +12,21 @@ config.optionxform = str # case sensitive config.read(os.path.join(current_directory, config_filename)) # third argument of get: interpolation(0) or raw mode(1) cmake_archive=config.get('Prerequisites', 'cmake_archive', 0) -python_archive=config.get('Prerequisites', 'python_archive', 0) +cmake_url=config.get('Prerequisites', 'cmake_url', 0) hdf5_archive=config.get('Prerequisites', 'hdf5_archive', 0) +hdf5_url=config.get('Prerequisites', 'hdf5_url', 0) swig_archive=config.get('Prerequisites', 'swig_archive', 0) +swig_url=config.get('Prerequisites', 'swig_url', 0) qt_archive=config.get('Prerequisites', 'qt_archive', 0) +qt_url=config.get('Prerequisites', 'qt_url', 0) med_archive=config.get('Prerequisites', 'med_archive', 0) +med_url=config.get('Prerequisites', 'med_url', 0) +python_archive=config.get('Prerequisites', 'python_archive', 0) +python_url=config.get('Prerequisites', 'python_url', 0) python_version_short=config.get('Prerequisites', 'python_version_short', 0) python_version_long=config.get('Prerequisites', 'python_version_long', 0) swig_version=config.get('Prerequisites', 'swig_version', 0) +swig_url=config.get('Prerequisites', 'swig_url', 0) paraview_git_repo=config.get('ParaView', 'paraview_git_repo', 0) paraview_git_version=config.get('ParaView', 'paraview_git_version', 0) paraview_version=config.get('ParaView', 'paraview_version', 0) @@ -29,10 +36,36 @@ kernel_version=config.get('SALOME', 'kernel_version', 0) gui_version=config.get('SALOME', 'gui_version', 0) paravis_version=config.get('SALOME', 'paravis_version', 0) make_nb_jobs=config.get('Build options', 'make_nb_jobs', 0) +do_archive_download=config.getboolean('Build options', 'do_archive_download') - -# Prepare build +# Download archives local_archives_path=os.path.join(current_directory,"archives") +if not os.path.exists(local_archives_path): + os.makedirs(local_archives_path) + do_archive_download=True + pass + +import urllib2 +def download(url, outfile): + print "Downloading",outfile,"..." + if os.path.exists(outfile): + print "Already downloaded" # :TODO: should include MD5 check + return + try: + remotefile=urllib2.urlopen(url) + except urllib2.HTTPError: + print "Unable to fetch url:", url + sys.exit(1) + pass + with open(outfile,'w') as localfile: + buf = remotefile.read(65536) + while buf != "": + localfile.write(buf) + buf = remotefile.read(65536) + pass + pass + remotefile.close() + pass cmakeLoc=os.path.join(local_archives_path,cmake_archive) pythonLoc=os.path.join(local_archives_path,python_archive) @@ -41,6 +74,26 @@ swigLoc=os.path.join(local_archives_path,swig_archive) qtLoc=os.path.join(local_archives_path,qt_archive) medLoc=os.path.join(local_archives_path,med_archive) +if not os.path.exists(cmakeLoc) \ + or not os.path.exists(pythonLoc) \ + or not os.path.exists(hdf5Loc) \ + or not os.path.exists(swigLoc) \ + or not os.path.exists(qtLoc) \ + or not os.path.exists(medLoc): + do_archive_download=True + pass + +if do_archive_download: + download(cmake_url, cmakeLoc) + download(med_url, medLoc) + download(hdf5_url, hdf5Loc) + download(swig_url, swigLoc) + download(qt_url, qtLoc) + download(python_url, pythonLoc) + pass + + +# Prepare build paraviewLoc=(paraview_git_repo,paraview_git_version) medcouplingLoc=(os.path.join(salome_git_repo,"tools","medcoupling.git"),medcoupling_version) @@ -57,6 +110,9 @@ compOut="compile_out.log" compErr="compile_err.log" okFlag=".install_ok" + +# Manage environment + def cmake_Environ(installDir,envAcc): pathAdd=[os.path.join(installDir,"bin")] addEnv(envAcc,"PATH",pathAdd) diff --git a/scripts/SalomeMiniConfig.cfg b/scripts/SalomeMiniConfig.cfg index d93cb88..5ed4baf 100644 --- a/scripts/SalomeMiniConfig.cfg +++ b/scripts/SalomeMiniConfig.cfg @@ -1,13 +1,19 @@ [Prerequisites] cmake_archive=cmake-3.0.2.tar.gz +cmake_url=https://cmake.org/files/v3.0/cmake-3.0.2.tar.gz hdf5_archive=hdf5-1.8.14.tar.gz +hdf5_url=https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.14/src/hdf5-1.8.14.tar.gz med_archive=med-3.2.0.tar.gz +med_url=http://files.salome-platform.org/Salome/other/med-3.2.0.tar.gz python_version_short=2.7 python_version_long=2.7.10 python_archive=Python-2.7.10.tgz +python_url=https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz qt_archive=qt-everywhere-opensource-src-5.5.1.tar.gz +qt_url=http://download.qt.io/archive/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz swig_version=2.0.8 swig_archive=swig-2.0.8.tar.gz +swig_url=http://downloads.sourceforge.net/project/swig/swig/swig-2.0.8/swig-2.0.8.tar.gz [ParaView] paraview_git_repo=https://github.com/Kitware/ParaView.git @@ -23,3 +29,4 @@ paravis_version=314918a6 [Build options] make_nb_jobs=8 +do_archive_download=yes