def configure(self): if (path(self.sourcedir)/"configure.py").exists(): # The -S flag is needed or else configure.py # sees any existing sip installation and can fail. cmd = sys.executable + " -S configure.py --platform win32-g++ -b %s -d %s -e %s -v %s"%self.inst_paths print print cmd print ret = sh(cmd) == 0 else: #if configure.py doesn't exist then we might #be using a zipball retreived directly from #sip's mercurial repository. This type of source #needs a step before actually calling configure.py if path("build.py").exists(): print "Will try to build sip from mercurial source zipball" try: #We need bison and flex sh("bison.exe") except: print "Could not find bison flex, use --bisonflex" return False apply_patch_from_string( PATCH ) sh(sys.executable + " -S build.py prepare") ret = self.configure() else: #we don't have a clue of what type of source we're in #so dying cleanly can seem like a good option: return False self.patch_sip_config() return ret
def is_installed(self): compiler = path(self.get_bin_path()) / "gcc.exe" try: sh(compiler + " --version") return True except OSError: return False
def make_install(self): print "Make install" # it is possible to bootstrap boost if no bjam.exe is found: if not (path(self.sourcedir)/"bjam.exe").exists() : print "Call bootstrap.bat" #mingw_path = r"c:/Python27/Lib/site-packages/mingw-5.2-py2.7-win32.egg/" #mingw_path = r"c:/MinGW/" #if sh("bootstrap.bat mingw --toolset-root=%s"%(mingw_path)) != 0: mingw_path = r"C:\Python27\Lib\site-packages\Mingw-5.1.4_4c-py2.7-win32.egg" if sh("bootstrap.bat mingw --toolset-root=%s"%(mingw_path)) != 0: return False else: # The Bootstrapper top-level script ignores that gcc # was used and by default says it's msvc, even though # the lower level scripts used gcc. ascii_file_replace( "project-config.jam", "using msvc", "using gcc") # try to fix a bug in python discovery which prevents # bjam from finding python on Windows NT and old versions. pyjam_pth = path("tools")/"build"/"v2"/"tools"/"python.jam" ascii_file_replace(pyjam_pth, "[ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT )", "[ version.check-jam-version 3 1 17 ] && ( [ os.name ] != NT )") paths = str(self.installdir), str(path(sys.prefix)/"include"), str(path(sys.prefix)/"libs") cmd = "bjam --prefix=%s --without-test --layout=system" cmd += " variant=release link=shared threading=multi runtime-link=shared toolset=gcc" cmd += " include=%s library-path=%s install" cmd %= paths print print cmd print return sh(cmd) == 0
def is_installed(self): compiler = path(self.get_bin_path())/"gcc.exe" try: sh(compiler+" --version") return True except OSError: return False
def configure(self): """ Will install mingw with gcc and other dependencies. More informations: http://www.mingw.org/wiki/InstallationHOWTOforMinGW :warning: will install much more than needed! And will be really heavy! Try to remove what is not necessary. For example, when installing gcc, it installs binutils. A big part of binutils is useless. """ cmd_prefix = "mingw-get install " libs = ["gcc-fortran", "gcc-g++", "gmp", "mpfr", "zlib", "libz", "msys-bison", "msys-flex", "gcc", "mingw32-make"] libs += ["binutils", "mingw-runtime", "pthreads", "iconv", "gcc-core", "libiconv"] for lib in libs: cmd = cmd_prefix + lib sh(cmd) print(cmd) ''' # Remove useless packages: cmd_prefix = "mingw-get remove " libs = ["binutils"] for lib in libs: cmd = cmd_prefix + lib sh(cmd) # mingw-get install --reinstall g++ # avoid error? # gcc: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found ''' return True
def multisetup(): """ Build and install each package """ cwd = os.getcwd() projects = default() for proj in projects: os.chdir(projects[proj].dir) sh("python multisetup.py install") os.chdir(cwd)
def test(): """ Run the test of each package. """ cwd = os.getcwd() projects = default() for proj in projects: os.chdir(projects[proj].dir) # if return 1 : failed (to verify) sh("python multisetup.py nosetests") os.chdir(cwd)
def try_compile(name="openalea"): try: sh("python multisetup.py build") message = "%s compilation succeed !" % name logger.debug(message) print message return True except: message = "%s compilation Failed /!\ " % name logger.warn(message) print message return False
def try_compile(name="openalea"): try: sh("python multisetup.py build") message = "%s compilation succeed !" %name logger.debug(message) print message return True except: message = "%s compilation Failed /!\ " %name logger.warn(message) print message return False
def pth_test(pth): exe_path = path(pth) / self.exe if path(exe_path).exists(): # see if we can actually call it try: sh(exe_path, stdout=NullOutput, stderr=NullOutput) except OSError: print "\tCalling", exe_path, "failed: bad path" return False else: return True return False
def pth_test(pth): exe_path = path(pth)/self.exe if path(exe_path).exists(): # see if we can actually call it try: sh(exe_path, stdout=NullOutput, stderr=NullOutput) except OSError: print "\tCalling", exe_path, "failed: bad path" return False else: return True return False
def win_installer(): """ TODO: Create a package which contains all the libs. !! Doesn't work for the moment !! """ cwd = os.getcwd() temp_path = path(os.getcwd())/"src"/"openalea"/"deploy"/"scripts"/"winInstallers" os.chdir(temp_path) projects = default() for proj in projects: cmd = "python makeWinInstaller.py -u --gforge --pass-path -e system_deploy2_temp -s system_deploy2_temp -o openalea_wi -e %s %s" %(proj,proj) sh(cmd) os.chdir(cwd)
def make(self): # apply_patch_from_string( PATCH ) # sys.path.append("C:\\Program Files\\R\\R-2.15.3") # sys.path.append("C:\\Program Files\\R\\R-2.15.3\\bin") # sys.path.append("C:\\Program Files\\R\\R-2.15.3\\bin\\i386") # sys.path.append("C:\\Program Files\\R\\R-2.15.3\\bin\\i386\\R") # sys.path.append("C:\\Program Files\\R\\R-2.15.3\\bin\\i386\\R.exe") cmd = "set R_HOME=C:\\Program Files\\R\\R-2.15.3\\bin\\i386\\" cmd = "set PATH=R_HOME;%PATH%" sh(cmd) cmd = sys.executable + ' setup.py build_ext --compiler=mingw32' print cmd return sh(cmd) == 0
def bdist_egg(): """ Create eggs into ./"dist" """ # -d option to give destination repository # python multisetup.py [build] [install] bdist_egg # [build] [install] useful??? cwd = os.getcwd() dest = cwd/"dist" cmd = "python multisetup.py bdist_egg -d %s" %dest projects = default() for proj in projects: os.chdir(projects[proj].dir) sh(cmd) os.chdir(cwd)
def bdist_egg(): """ Create eggs into ./"dist" """ # -d option to give destination repository # python multisetup.py [build] [install] bdist_egg # [build] [install] useful??? cwd = os.getcwd() dest = cwd / "dist" cmd = "python multisetup.py bdist_egg -d %s" % dest projects = default() for proj in projects: os.chdir(projects[proj].dir) sh(cmd) os.chdir(cwd)
def configure(self): # we want pyqscintilla to install itself where pyqt4 installed itself. # -- The -S flag is needed or else configure.py # sees any existing sip installation and can fail. -- """ cmd = sys.executable + " -S configure.py"\ " -a %s -o %s -n %s --sipdir=%s --destdir=%s"%self.install_paths # " -a C:/temp_working_dir/install/qt4/qsci"\ # " -o C:/temp_working_dir/src/qscintilla/Qt4Qt5/release"\ # " -n C:/temp_working_dir/src/qscintilla/Qt4Qt5"\ # " -v C:/temp_working_dir/src/pyqt4/sip"\ # " --destdir=C:/temp_working_dir/install/pyqt4/site/PyQt4" .replace("\\", "/")""" cmd = sys.executable + " -S configure.py"\ " -a C:/temp_working_dir/install/qt4/qsci"\ " -o C:/temp_working_dir/src/qscintilla/Qt4Qt5/release"\ " -n C:/temp_working_dir/src/qscintilla/Qt4Qt5"\ " -v C:/temp_working_dir/install/pyqt4/sip"\ " --destdir=C:/temp_working_dir/install/pyqt4/site/PyQt4" """pyqt.inst_paths = pyqt.install_bin_dir, pyqt.install_site_dir, pyqt.install_inc_dir, \ pyqt.install_sip_dir cmd = sys.executable + " -S configure.py --platform win32-g++ -b %s -d %s -e %s -v %s"%pyqt.inst_paths""" print print cmd print return sh(cmd) == 0
def make(self): ret = sh(sys.executable + " setup.py build") == 0 os.chdir("engine") self._packages=[pkg.replace('.','/') for pkg in find_packages('.')] self._package_dir = dict([(pkg, str(path(pkg).abspath())) for pkg in self._packages]) os.chdir("..") self._bin_dir = {'EGG-INFO/scripts': str(path('script').abspath())} return ret
def win_installer(): """ TODO: Create a package which contains all the libs. !! Doesn't work for the moment !! """ cwd = os.getcwd() temp_path = path(os.getcwd( )) / "src" / "openalea" / "deploy" / "scripts" / "winInstallers" os.chdir(temp_path) projects = default() for proj in projects: cmd = "python makeWinInstaller.py -u --gforge --pass-path -e system_deploy2_temp -s system_deploy2_temp -o openalea_wi -e %s %s" % ( proj, proj) sh(cmd) os.chdir(cwd)
def configure(self): cmd = sys.executable + " -S configure.py --confirm-license --no-designer-plugin -w -b %s -d %s -v %s "%self.inst_paths print print cmd print ret = sh(cmd) == 0 self.patch_pyqt_config() return ret
def make_install(self): # import os # from pkgit.utils import in_dir sh("dir") # os.chdir("cd ./ann_%s"%self.version) # sh("dir") # dir = "ann_%s"%self.version # @in_dir(dir) def compile_(): return sh("mingw32-make win32-g++") r = compile_() # os.chdir("..") return r == 0
def make(self): ret = sh(sys.executable + " setup.py build") == 0 os.chdir("engine") self._packages = [pkg.replace('.', '/') for pkg in find_packages('.')] self._package_dir = dict([(pkg, str(path(pkg).abspath())) for pkg in self._packages]) os.chdir("..") self._bin_dir = {'EGG-INFO/scripts': str(path('script').abspath())} return ret
def configure(self): # The -S flag is needed or else configure.py # sees any existing sip installation and can fail. cmd = sys.executable + " -S configure.py -Q %s" % (self.qglbuilderbase) # pyqt = pyqt4() # cmd = sys.executable + " -S configure.py -Q %s --sip-include-dirs=%s"%(self.qglbuilderbase,pyqt.install_sip_dir) print print cmd print return sh(cmd) == 0
def configure(self): # The install procedure will install qscintilla in qt's installation directories qt4_ = qt4() paths = qt4_.install_inc_dir, qt4_.install_tra_dir, qt4_.installdir, qt4_.install_dll_dir, cmd = ("qmake -after header.path=%s trans.path=%s qsci.path=%s " + \ "target.path=%s -spec win32-g++ qscintilla.pro")%paths print print cmd print ret = sh(cmd) == 0 return ret
def configure(self): # new_env_vars cmd = "setx QMAKESPEC win32-g++" print cmd sh(cmd) cmd = "set QMAKESPEC=win32-g++" print cmd sh(cmd) cmd = "setx QTDIR %s" % self.installdir print cmd sh(cmd) cmd = "set QTDIR=%s" % self.installdir print cmd sh(cmd) config_txt = """ -platform win32-g++ -release -opensource -shared -nomake demos -nomake examples -fast -sse2 -3dnow -declarative -webkit -no-vcproj -no-cetest -no-s60""" f = open("configure.cache", "w") f.write(config_txt) f.close() cmd = "configure.exe -redo" print print cmd print # PIPE is required or else pop.communicate won't do anything! pop = subprocess.Popen(cmd, stdin=subprocess.PIPE) # give enough time for executable to load before it asks for license agreement. time.sleep(2) # accepts license agreement, also waits for configure to finish pop.communicate("y\r") return pop.returncode == 0
def configure(self): """ Will install mingw with gcc and other dependencies. More informations: http://www.mingw.org/wiki/InstallationHOWTOforMinGW :warning: will install much more than needed! And will be really heavy! Try to remove what is not necessary. For example, when installing gcc, it installs binutils. A big part of binutils is useless. """ cmd_prefix = "mingw-get install " libs = [ "gcc-fortran", "gcc-g++", "gmp", "mpfr", "zlib", "libz", "msys-bison", "msys-flex", "gcc", "mingw32-make" ] libs += [ "binutils", "mingw-runtime", "pthreads", "iconv", "gcc-core", "libiconv" ] for lib in libs: cmd = cmd_prefix + lib sh(cmd) print(cmd) ''' # Remove useless packages: cmd_prefix = "mingw-get remove " libs = ["binutils"] for lib in libs: cmd = cmd_prefix + lib sh(cmd) # mingw-get install --reinstall g++ # avoid error? # gcc: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found ''' return True
def make_install(self): print "Make install" # it is possible to bootstrap boost if no bjam.exe is found: if not (path(self.sourcedir) / "bjam.exe").exists(): print "Call bootstrap.bat" #mingw_path = r"c:/Python27/Lib/site-packages/mingw-5.2-py2.7-win32.egg/" #mingw_path = r"c:/MinGW/" #if sh("bootstrap.bat mingw --toolset-root=%s"%(mingw_path)) != 0: mingw_path = r"C:\Python27\Lib\site-packages\Mingw-5.1.4_4c-py2.7-win32.egg" if sh("bootstrap.bat mingw --toolset-root=%s" % (mingw_path)) != 0: return False else: # The Bootstrapper top-level script ignores that gcc # was used and by default says it's msvc, even though # the lower level scripts used gcc. ascii_file_replace("project-config.jam", "using msvc", "using gcc") # try to fix a bug in python discovery which prevents # bjam from finding python on Windows NT and old versions. pyjam_pth = path("tools") / "build" / "v2" / "tools" / "python.jam" ascii_file_replace( pyjam_pth, "[ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT )", "[ version.check-jam-version 3 1 17 ] && ( [ os.name ] != NT )") paths = str(self.installdir), str(path(sys.prefix) / "include"), str( path(sys.prefix) / "libs") cmd = "bjam --prefix=%s --without-test --layout=system" cmd += " variant=release link=shared threading=multi runtime-link=shared toolset=gcc" cmd += " include=%s library-path=%s install" cmd %= paths print print cmd print return sh(cmd) == 0
def configure(self): compiler = mingw().get_path() boost_ = boost() db_quote = lambda x: '"'+x+'"' options = " ".join(['-DCMAKE_INSTALL_PREFIX='+db_quote(self.installdir), '-DCMAKE_CXX_COMPILER:FILEPATH='+db_quote(path(compiler)/"bin"/"g++.exe"), '-DBOOST_ROOT='+db_quote(boost_.installdir), '-DGMP_INCLUDE_DIR='+db_quote( path(compiler)/"include" ), '-DMPFR_INCLUDE_DIR='+db_quote( path(compiler)/"include"), '-DZLIB_INCLUDE_DIR='+db_quote(path(compiler)/"include"), '-DZLIB_LIBRARY='+db_quote(path(compiler)/"lib"/"libz.a"), #'-DOPENGL_LIBRARIES='+db_quote(path(compiler)/".."/"lib"/"libglu32.a"), ]) options=options.replace("\\", "/") #avoid "escape sequence" errors with cmake cmd = 'cmake -G"MinGW Makefiles" '+options+' . ' print cmd return sh(cmd) == 0
def configure(self): compiler = mingw().get_path() boost_ = boost() db_quote = lambda x: '"' + x + '"' options = " ".join([ '-DCMAKE_INSTALL_PREFIX=' + db_quote(self.installdir), '-DCMAKE_CXX_COMPILER:FILEPATH=' + db_quote(path(compiler) / "bin" / "g++.exe"), '-DBOOST_ROOT=' + db_quote(boost_.installdir), '-DGMP_INCLUDE_DIR=' + db_quote(path(compiler) / "include"), '-DMPFR_INCLUDE_DIR=' + db_quote(path(compiler) / "include"), '-DZLIB_INCLUDE_DIR=' + db_quote(path(compiler) / "include"), '-DZLIB_LIBRARY=' + db_quote(path(compiler) / "lib" / "libz.a"), #'-DOPENGL_LIBRARIES='+db_quote(path(compiler)/".."/"lib"/"libglu32.a"), ]) options = options.replace( "\\", "/") #avoid "escape sequence" errors with cmake cmd = 'cmake -G"MinGW Makefiles" ' + options + ' . ' print cmd return sh(cmd) == 0
def make(self): # by default, and since we do not use self.options yet, we build in release mode return sh("mingw32-make release") == 0
def make_install(self): cmd = "python setup.py install" print cmd return sh(cmd) == 0
def bdist_egg(self): cmd = "python multisetup.py build bdist_egg -d %s"%(self.dist_dir,) print cmd return sh(cmd) == 0
def _bdist_egg(self): return sh("python setup.py bdist_egg -d %s"%(self.dist_dir,)) == 0
def compile_(): return sh("mingw32-make win32-g++")
def bdist_egg(self): return sh("python multisetup.py clean build install bdist_egg -d %s"%(self.dist_dir,)) == 0
def make_install(self): sys.path.append("C:\\Program Files\\R\\R-2.15.3") cmd = sys.executable + " setup.py install --install-lib=" + self.installdir return sh(cmd) == 0
def _bdist_egg(self): return sh('python "configobj-4.7.2\setup.py" bdist_egg -d %s'%(self.dist_dir,)) == 0
def configure(self): return sh("qmake QGLViewer.pro") == 0
def bdist_egg(self): cmd = "python setup.py build install bdist_egg -d %s"%(self.dist_dir,) print cmd return sh(cmd) == 0
def bdist_egg(self): cmd = "python setup.py build install bdist_egg -d %s" % ( self.dist_dir, ) print cmd return sh(cmd) == 0
def _bdist_egg(self): return sh("python setup.py bdist_egg -d %s" % (self.dist_dir, )) == 0