def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = self.version short_ver = '.'.join(version.split('.')[:2]) py_ver = ''.join(get_python_version()) brew_extra = '' win_extra = '32' if platform.architecture()[0] == '64bit': brew_extra = ' --devel' win_extra = '64' website = ('http://sourceforge.net/projects/wxpython/', 'files/wxPython/' + str(version) + '/') ## NOTE: no local install due to complex platform dependencies global_install('wxPython', website, winstaller='wxPython' + short_ver + '-win' + \ win_extra + '-' + str(version) + '-py' + \ py_ver + '.exe', brew='--python wxmac' + brew_extra, port='py' + py_ver + '-wxpython', deb='python-wxgtk python-wxtools', rpm='wxPython-devel') if system_uses_homebrew(): target = os.path.join(homebrew_prefix(), 'lib', 'python'+'.'.join(get_python_version()), 'site-packages', 'wx') if not os.path.exists(target): os.symlink(glob.glob(os.path.join(homebrew_prefix(), 'lib', 'python2.6', 'site-packages', 'wx-*', 'wx'))[0], target) if not self.is_installed(environ, version, strict): raise Exception('wxpython installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: src_dir = self.download(environ, version, strict) if 'windows' in platform.system().lower() or \ (not locally and system_uses_homebrew()): website = ('http://dist.neo4j.org/',) win_ver = version.replace('.', '_') win_arch = 'x32' if struct.calcsize('P') == 8: win_arch = 'x64' global_install('Neo4j', website, winstaller='neo4j-community_windows-' + win_arch + \ '_' + win_ver + '.exe', brew='neo4j', ## no macports, debian or yum packages ) self.environment['NEO4J'] = ['neo4j', 'start'] elif not locally: local_dir = os.path.join(options.target_build_dir, src_dir, 'bin') admin_check_call([os.path.join(local_dir, 'neo4j'), 'install']) else: local_dir = os.path.join(options.target_build_dir, src_dir, 'bin') self.environment['NEO4J'] = [os.path.join(local_dir, 'neo4j'), 'start']
def install(self, environ, version, strict=False, locally=True): if not self.found: website = ('https://www.eldos.com/files/sftpnetdrive2/') #TODO sshfs: no good Windows solution global_install('sshfs', website, #winstaller='SftpNetDriveFree.exe', brew='sshfs', port='sshfs', deb='sshfs', rpm='fuse-sshfs') if not self.is_installed(environ, version, strict): raise Exception('sshfs installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally) else: global_install('Graphviz', None, brew='graphviz', port='graphviz-devel', deb='graphviz-dev', rpm='graphviz-devel') if not self.is_installed(environ, version, strict): raise Exception('Graphviz installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '2.8.10.2' website = ('http://www.cmake.org/', 'files/v' + major_minor_version(version) + '/') #TODO no local install global_install('CMake', website, winstaller='cmake-' + str(version) + '-win32-x86.exe', brew='cmake', port='cmake', deb='cmake', rpm='cmake') if not self.is_installed(environ, version, strict): raise Exception('CMake installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '1.8.3.1' website = ('http://ftp.stack.nl/pub/users/dimitri/',) #TODO no local install global_install('Doxygen', website, winstaller='doxygen-' + str(version) + '-setup.exe', brew='doxygen', port='doxygen', deb='doxygen', rpm='doxygen') if not self.is_installed(environ, version, strict): raise Exception('Doxygen installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) #TODO this is a CMake build autotools_install_without_fetch(environ, src_dir, locally) else: global_install('GLFW', None, brew='glfw', port='glfw-devel', deb='libglfw-dev', rpm='glfw-devel') #TODO glfw package on CentOS/RHEL if not self.is_installed(environ, version, strict): raise Exception('GLFW installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally) else: here = os.getcwd() global_install('LZF', None, brew=os.path.join(here, 'liblzf.rb'), port='liblzf', deb='liblzf-dev', rpm='liblzf-devel') if not self.is_installed(environ, version, strict): raise Exception('LZF installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or not 'darwin' in platform.system().lower(): here = os.path.abspath(os.getcwd()) if locally: prefix = os.path.abspath(options.target_build_dir) if not prefix in options.local_search_paths: options.add_local_search_path(prefix) else: prefix = options.global_prefix ## MinGW shell strips backslashes prefix = convert2unixpath(prefix) src_dir = self.download(environ, version, strict) oper_sys = 'linux' if 'windows' in platform.system().lower(): oper_sys = 'mingw' elif 'darwin' in platform.system().lower(): oper_sys = 'macosx' build_dir = os.path.join(options.target_build_dir, src_dir) os.chdir(build_dir) log = open('build.log', 'w') if 'windows' in platform.system().lower(): try: ## ncurses prerequisite check_call(['mingw-get', 'install', 'pdcurses']) check_call(['mingw-get', 'install', 'libpdcurses']) except subprocess.CalledProcessError: pass mingw_check_call(environ, ['make', 'OS=mingw', 'ENV=gnu', 'all'], stdout=log, stderr=log) mingw_check_call(environ, ['make', 'INSTALLDIR=' + prefix, 'install'], stdout=log, stderr=log) else: check_call(['make', 'OS=' + oper_sys, 'ENV=gnu', 'all'], stdout=log, stderr=log) if locally: check_call(['make', 'INSTALLDIR=' + prefix, 'install'], stdout=log, stderr=log) else: admin_check_call(['make', 'INSTALLDIR=' + prefix, 'install'], stdout=log, stderr=log) log.close() os.chdir(here) else: global_install('CDF', None, brew='cdf', port='cdf') if not self.is_installed(environ, version, strict): raise Exception('CDF installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '4.8.0' if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally) else: website = ('http://trac.osgeo.org/proj/',) global_install('PROJ4', website, brew='proj', port='libproj4', deb='libproj-dev', rpm='proj-devel') if not self.is_installed(environ, version, strict): raise Exception('Proj4 installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) ## Compile with: REQUIRES_RTTI=1 ./configure --enable-optimized autotools_install_without_fetch(environ, src_dir, locally, ['--enable-optimized'], {'REQUIRES_RTTI': '1'}) else: global_install('LLVM', None, brew='llvm', port='llvm-devel', deb='libllvm-dev', rpm='llvm-devel') if not self.is_installed(environ, version, strict): raise Exception('LLVM installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if not 'windows' in platform.system().lower(): raise Exception('Not installing MinGW on this platform. ' + 'Cross compiling not (yet) supported.') if version is None: version = '20120426' website = ('http://sourceforge.net/projects/mingw/', 'files/Installer/mingw-get-inst/mingw-get-inst-' + str(version) + '/') global_install('MinGW', website, winstaller='mingw-get-inst-' + str(version) + '.exe') if not self.is_installed(environ, version, strict): raise Exception('MinGW installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: website = ('http://git-scm.com/',) if 'windows' in platform.system().lower(): if version is None: version = '1.8.1.2-preview21130201' website = ('http://msysgit.googlecode.com/', 'files/') #TODO no local install global_install('Git', website, winstaller='Git-' + str(version) + '.exe', brew='git', port='git-core', deb='git', rpm='git') if not self.is_installed(environ, version, strict): raise Exception('Git installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: src_dir = self.download(environ, version, strict) if locally: autotools_install_without_fetch(environ, src_dir, locally, extra_cfg=['--enable-static', '--enable-shared'], addtnl_env={'CFLAGS': '-fPIC'} ) else: global_install('MPICH', None, brew='mpich2', port='mpich-devel', deb='libmpich2-dev', rpm='mpich2-devel') if not self.is_installed(environ, version, strict): raise Exception('MPICH2 installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '0.10.15' website = ('http://nodejs.org/', 'dist/v' + version +'/') arch = 'x86' if struct.calcsize('P') == 8: arch = 'x64' website = (website[0], website[1] + arch + '/') #TODO no local install global_install('Node.js', website, winstaller='node-v' + version + '-' + arch + 'msi', brew='node, npm', port='nodejs, npm', deb='nodejs, npm', rpm='nodejs, npm') if not self.is_installed(environ, version, strict): raise Exception('Node.js installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally: src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally) else: if version is None: version = '1.6.4' website = ('http://www.open-mpi.org/', 'software/ompi/v' + '.'.join(version.split('.')[:2]) + '/downloads/') global_install('OpenMPI', website, brew='open-mpi', port='openmpi', deb='libopenmpi-dev', rpm='openmpi-devel') if not self.is_installed(environ, version, strict): raise Exception('OPENMPI2 installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or "windows" in platform.system().lower(): src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally) else: global_install( "FreeImage", None, brew="freeimage", port="freeimage-devel", deb="libfreeimage-dev", rpm="freeimage-devel", ) if not self.is_installed(environ, version, strict): raise Exception("FreeImage installation failed.")
def install(self, environ, version, strict=False, locally=True): if not self.found: website = ('http://gcc.gnu.org',) if 'windows' in platform.system().lower(): if version is None: version = '20120426' website = ('http://sourceforge.net/projects/mingw/', 'files/Installer/mingw-get-inst/mingw-get-inst-' + str(version) + '/') if 'darwin' in platform.system().lower() and system_uses_macports(): raise Exception('GFortran does not appear to be installed.') global_install('GFortran', website, winstaller='mingw-get-inst-' + str(version) + '.exe', brew='gfortran ', #+ os.path.join(here, 'g77.rb'), deb='gfortran', rpm='gcc-gfortran') if not self.is_installed(environ, version, strict): raise Exception('GFortran installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or 'windows' in platform.system().lower(): ## NB: broken on Windows! src_dir = self.download(environ, version, strict) here = os.path.abspath(os.getcwd()) if locally: prefix = os.path.abspath(options.target_build_dir) if not prefix in options.local_search_paths: options.add_local_search_path(prefix) else: prefix = options.global_prefix prefix = convert2unixpath(prefix) ## MinGW shell strips backslashes build_dir = os.path.join(options.target_build_dir, src_dir, '_build') mkdir(build_dir) os.chdir(build_dir) log = open('build.log', 'w') if 'windows' in platform.system().lower(): # Assumes MinGW present, detected, and loaded in environment mingw_check_call(environ, ['../configure', '--prefix="' + prefix + '"', '--shared', #'-O ', '-b 32', '-Si nocygin 1'], stdout=log, stderr=log) mingw_check_call(environ, ['make'], stdout=log, stderr=log) mingw_check_call(environ, ['make', 'install'], stdout=log, stderr=log) else: check_call(['../configure', '--prefix=' + prefix, '--shared'], stdout=log, stderr=log) check_call(['make'], stdout=log, stderr=log) if locally: check_call(['make', 'install'], stdout=log, stderr=log) else: admin_check_call(['make', 'install'], stdout=log, stderr=log) log.close() os.chdir(here) else: global_install('ATLAS', None, ## part of XCode deb='libatlas-dev', rpm='atlas-devel') if not self.is_installed(environ, version, strict): raise Exception('ATLAS installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '5.16.3' website = ('http://www.perl.org/',) if locally and not 'windows' in platform.system().lower(): sys.stderr.write('Perl was not found, ' + 'but should be already installed by default.' + '\nInstalling locally anyway.\n') ## MinGW build is *not* straight-forward - hence not implemented website = ('http://www.cpan.org/', 'src/' + version.split('.')[0] + '.0/') src_dir = 'perl-' + str(version) archive = src_dir + '.tar.gz' fetch(''.join(website), archive, archive) unarchive(archive, src_dir) if locally: prefix = os.path.abspath(options.target_build_dir) if not prefix in options.local_search_paths: options.add_local_search_path(prefix) else: prefix = options.global_prefix here = os.path.abspath(os.getcwd()) os.chdir(options.target_build_dir) log = open('build.log', 'w') check_call(['./Configure', '-des', '-Dprefix=' + prefix], stdout=log, stderr=log) check_call(['make'], stdout=log, stderr=log) check_call(['make', 'install'], stdout=log, stderr=log) log.close() os.chdir(here) else: if 'darwin' in platform.system().lower(): raise Exception('Perl is included with OSX. What happened?') if 'windows' in platform.system().lower(): website = ('http://strawberry-perl.googlecode.com/', 'files/') version = '5.16.2.2' global_install('Perl', website, 'strawberry-perl-' + str(version) + '-32bit.msi', deb='libperl-dev', rpm='perl-devel') if not self.is_installed(environ, version, strict): raise Exception('Perl installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = '1.6.0' sub = str(version).split('.')[1] website = 'http://www.java.com/' installer = None if 'darwin' in platform.system().lower(): raise Exception('Java is included with OSX. What happened?') if 'windows' in platform.system().lower(): website = 'http://oscg-downloads.s3.amazonaws.com/installers/' installer = 'oscg-openjdk6b24-1-windows-installer.exe' #TODO no local install global_install('Java', website, winstaller=installer, deb='openjdk-' + sub + '-jdk', rpm='java-1.' + str(version) + '-openjdk-devel') if not self.is_installed(environ, version, strict): raise Exception('Java installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: env = dict() if 'windows' in platform.system().lower(): env['LIBS'] = '-lws2_32' try: ## zlib prerequisite check_call(['mingw-get', 'install', 'libz-dev']) except subprocess.CalledProcessError: pass if locally or 'windows' in platform.system().lower(): src_dir = self.download(environ, version, strict) autotools_install_without_fetch(environ, src_dir, locally, extra_cfg=['--enable-cxx','--enable-fortran'], addtnl_env=env) else: global_install('HDF5', None, brew='hdf5', port='hdf5', deb='libhdf5-dev', rpm='hdf5-devel') if not self.is_installed(environ, version, strict): raise Exception('HDF5 installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if version is None: version = "2.8.12" website = ("http://prdownloads.sourceforge.net/wxwindows/",) if "windows" in platform.system().lower(): src_dir = "wxMSW-" + str(version) archive = src_dir + ".zip" autotools_install(environ, website, archive, src_dir, locally) elif locally: pass # TODO non-windows local install else: global_install( "wxWidgets", website, brew="wxwidgets", port="wxgtk", deb="libwxbase-dev libwxgtk-dev", rpm="wxBase wxGTK-devel", ) if not self.is_installed(environ, version, strict): raise Exception("WxGTK installation failed.")
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or ('darwin' in platform.system().lower() and system_uses_homebrew()): here = os.path.abspath(os.getcwd()) if locally: prefix = os.path.abspath(options.target_build_dir) if not prefix in options.local_search_paths: options.add_local_search_path(prefix) else: prefix = options.global_prefix ## MinGW shell strips backslashes prefix = convert2unixpath(prefix) src_dir = 'gccxml' if not os.path.exists(os.path.join(here, options.download_dir, src_dir)): os.chdir(options.download_dir) gitsite = 'https://github.com/gccxml/gccxml.git' check_call([environ['GIT'], 'clone', gitsite, src_dir]) os.chdir(here) build_dir = os.path.join(options.download_dir, src_dir, '_build') mkdir(build_dir) os.chdir(build_dir) log = open('build.log', 'w') if 'windows' in platform.system().lower(): if 'MSVC' in environ: config_cmd = [environ['CMAKE'], '..', '-G', '"NMake Makefiles"', '-DCMAKE_INSTALL_PREFIX=' + prefix] #TODO test msvc cmake build; probably wrong check_call([environ['MSVC_VARS']], stdout=log, stderr=log) check_call(config_cmd, stdout=log, stderr=log) check_call([environ['NMAKE']], stdout=log, stderr=log) check_call([environ['NMAKE'], 'install'], stdout=log, stderr=log) else: ## MinGW config_cmd = [environ['CMAKE'], '..', '-G', '"MSYS Makefiles"', '-DCMAKE_INSTALL_PREFIX=' + prefix, '-DCMAKE_MAKE_PROGRAM=/bin/make.exe'] mingw_check_call(environ, config_cmd, stdout=log, stderr=log) mingw_check_call(environ, ['make'], stdout=log, stderr=log) mingw_check_call(environ, ['make', 'install'], stdout=log, stderr=log) else: config_cmd = [environ['CMAKE'], '..', '-G', 'Unix Makefiles', '-DCMAKE_INSTALL_PREFIX=' + prefix] check_call(config_cmd, stdout=log, stderr=log) check_call(['make'], stdout=log, stderr=log) if locally: check_call(['make', 'install'], stdout=log, stderr=log) else: admin_check_call(['make', 'install'], stdout=log, stderr=log) log.close() os.chdir(here) else: if version is None: version = '0.6.0' website = ('http://www.gccxml.org/', 'files/v' + major_minor_version(version) + '/') global_install('GCCXML', website, winstaller='gccxml-' + str(version) + '-win32.exe', brew=None, port='gccxml-devel', deb='gccxml', rpm='gccxml') if not self.is_installed(environ, version, strict): raise Exception('GCC-XML installation failed.')
def install(self, environ, version, strict=False, locally=True): if not self.found: if locally or "windows" in platform.system().lower(): src_dir = self.download(environ, version, strict) here = os.path.abspath(os.getcwd()) if locally: prefix = os.path.abspath(options.target_build_dir) if not prefix in options.local_search_paths: options.add_local_search_path(prefix) else: prefix = options.global_prefix os.chdir(os.path.join(options.target_build_dir, src_dir)) log = open("build.log", "w") err = open("build.errors", "w") ## unique build process if "windows" in platform.system().lower(): os_environ = os.environ.copy() new_path = ( os_environ["PATH"] + os.path.join(environ["MINGW_DIR"], "bin") + ";" + os.path.join(environ["MSYS_DIR"], "bin") + ";" ) os_environ["PATH"] = new_path.encode("ascii", "ignore") cmd_line = "bootstrap.bat mingw" # cmd_line = 'bootstrap.bat msvc' p = subprocess.Popen(cmd_line, env=os_environ, stdout=log, stderr=err) status = p.wait() if status != 0: raise subprocess.CalledProcessError(status, cmd_line) toolset = "toolset=gcc" # toolset = 'toolset=msvc' cmd_line = ( "bjam.exe install link=shared link=static " + toolset + " variant=release threading=single " + '--prefix="' + prefix + '"' ) p = subprocess.Popen(cmd_line, env=os_environ, stdout=log, stderr=err) status = p.wait() if status != 0: raise subprocess.CalledProcessError(status, cmd_line) else: check_call(["./bootstrap.sh"], stdout=log, stderr=err) subprocess.call(["./bjam", "install", "--prefix=" + prefix], stdout=log, stderr=err) ## may return an error even if everything built log.close() err.close() os.chdir(here) else: global_install( "Boost", None, brew="boost", port="boost +python" + "".join(get_python_version()), deb="libboost-dev", rpm="boost-devel", ) if not self.is_installed(environ, version, strict): raise Exception("Boost installation failed.")