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: 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 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 'darwin' in platform.system().lower(): return mkdir(options.target_build_dir) log = open(os.path.join(options.target_build_dir, 'macports_setup.log'), 'w') python_version = '26' ## Hard coded due to wxPython if not self.found: if version is None: version = '2.1.3' website = ('https://distfiles.macports.org/MacPorts/',) src_dir = 'MacPorts-' + str(version) archive = src_dir + '.tar.gz' autotools_install(environ, website, archive, src_dir, False) patch_file('/opt/local/share/macports/Tcl/port1.0/portconfigure.tcl', 'default configure.ldflags', '{-L${prefix}/lib}', '{"-L${prefix}/lib -Xlinker -headerpad_max_install_names"}') patch_file('/opt/local/etc/macports/macports.conf', 'build_arch i386', '#', '') ## Also due to wxPython admin_check_call(['port', 'selfupdate'], stdout=log, stderr=log) if not self.ports_found: admin_check_call(['port', 'install', 'python' + python_version, 'python_select'], stdout=log, stderr=log) admin_check_call(['port', 'select', '--set', 'python', 'python' + python_version], stdout=log, stderr=log) admin_check_call(['port', 'install', 'py' + python_version + '-numpy'], stdout=log, stderr=log) admin_check_call(['port', 'install', 'py' + python_version + '-py2app'], stdout=log, stderr=log) log.close() if not self.is_installed(environ, version, strict): raise Exception("Macports 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.')