Esempio n. 1
0
    def setup(self):
        qt4_ = qt4()
        qglv_ = qglviewer()

        pyqgl_mods = recursive_glob_as_dict(self.install_site_dir,
                                            Pattern.pyall,
                                            strip_keys=True,
                                            levels=1).items()
        # includes are recursive subdirectories of qglviewer
        incs = recursive_glob_as_dict(qglv_.install_inc_dir,
                                      Pattern.include,
                                      strip_keys=True,
                                      prefix_key="include",
                                      dirs=True).items()
        inc_dirs = merge_list_dict(incs)
        # libs are recursive subdirectories of qt libs
        libs = recursive_glob_as_dict(qglv_.install_lib_dir,
                                      Pattern.qtstalib,
                                      strip_keys=True,
                                      prefix_key="lib").items()
        # sip files are recursive subdirectories of pyqglviewer sip installation directory
        sips = recursive_glob_as_dict(self.install_sip_dir,
                                      Pattern.sipfiles,
                                      strip_keys=True,
                                      prefix_key="sip").items()
        # examples are recursive subdirectories of pyqglviewer examples installation directory contains various types of files
        exas = recursive_glob_as_dict(self.install_exa_dir,
                                      Pattern.any,
                                      strip_keys=True,
                                      prefix_key="examples").items()
        lib_dirs = {"": str(qglv_.install_dll_dir)}
        data_files = exas + sips + libs + pyqgl_mods

        # Need an other shell ???
        try:
            import PyQGLViewer
        except ImportError:
            print "================================="
            print "!!!!Can't import PyQGLViewer!!!!!"
            print "Close current shell and try again"
            print "================================="
            raise

        return dict(
            VERSION=PyQGLViewer.QGLViewerVersionString(),
            PACKAGE_DATA={'': [Pattern.pyext]},
            #PACKAGE_DIRS = package_dir,
            LIB_DIRS=lib_dirs,
            INC_DIRS=inc_dirs,
            DATA_FILES=data_files,
            INSTALL_REQUIRES=[qt4_.egg_name()])
Esempio n. 2
0
    def setup(self):
        qt4_   = qt4()
        pyqt4_ = pyqt4()
        sip_   = sip()
        # binaries are the union of qt, pyqt and sip binaries 
        bin_dirs = {"bin":str(qt4_.install_bin_dir)}
        # includes are recursive subdirectories and the union of qt and sip includes               
        incs = recursive_glob_as_dict( qt4_.install_inc_dir, Pattern.qtinc, strip_keys=True, prefix_key="include", dirs=True).items() + \
               recursive_glob_as_dict( sip_.install_inc_dir, Pattern.qtinc, strip_keys=True, prefix_key="include", dirs=True).items()
        inc_dirs = merge_list_dict( incs )
        # libs are recursive subdirectories of qt libs          
        libs = recursive_glob_as_dict(qt4_.install_lib_dir, Pattern.qtstalib, strip_keys=True, prefix_key="lib").items()
        # sip files are recursive subdirectories and the union of pyqt4 and...
        sips = recursive_glob_as_dict(pyqt4_.install_sip_dir, Pattern.sipfiles, strip_keys=True, prefix_key="sip").items()
        # sources are recursive subdirectories and the union of qt4 and that all (CPP have been removed)...
        srcs = recursive_glob_as_dict(qt4_.install_src_dir, Pattern.qtsrc, strip_keys=True, prefix_key="src").items()
        # tra files are recursive subdirectories in qt4
        tra = recursive_glob_as_dict(qt4_.install_tra_dir, Pattern.qttransl, strip_keys=True, prefix_key="translations").items()
        # mks files are recursive subdirectories in qt4
        mks = recursive_glob_as_dict(qt4_.install_mks_dir, Pattern.qtmkspec, strip_keys=True, prefix_key="mkspecs").items()        
        # plugins files are recursive subdirectories in qt4
        plu = recursive_glob_as_dict(qt4_.install_plu_lib_dir, Pattern.qtstalib, strip_keys=True, prefix_key="plugins").items()

        return dict( 
                    VERSION          = qt4_.version,                   
                    BIN_DIRS         = bin_dirs,
                    INC_DIRS         = inc_dirs,
                    DATA_FILES       = libs+sips+srcs+tra+mks+plu,
                    INSTALL_REQUIRES = [qt4_.egg_name()]
                    )         
Esempio n. 3
0
 def setup(self):
     mingwbase = self.get_path()
     if not path(mingwbase).exists():
         makedirs(path(mingwbase))
     subd = os.listdir(mingwbase)
     safe_rmdir("EGG-INFO", subd)
     safe_rmdir("bin", subd)
     safe_rmdir("include", subd)
     data = []
     for dir in subd:
         dat = recursive_glob_as_dict(path(mingwbase) / dir,
                                      "*",
                                      strip_keys=True,
                                      prefix_key=dir).items()
         data += [(str(d), [str(f) for f in t if not f.endswith(".dll")])
                  for d, t in dat]
     bindirs = {"bin": str(self.get_bin_path())}
     incdirs = {"include": str(path(mingwbase) / "include")}
     #libdirs = {"lib": str(path(mingwbase/"lib")}
     return dict(
         VERSION=self.version,
         BIN_DIRS=bindirs,
         INC_DIRS=incdirs,
         LIB_DIRS=None,
         DATA_FILES=data,
     )
Esempio n. 4
0
    def setup(self):
        from pkgit.formulas.pyqt4 import Pyqt4 as pyqt4
        from pkgit.formulas.pyqscintilla import Pyqscintilla as pyqscintilla
        from pkgit.formulas.sip import Sip as sip

        pyqt4_ = pyqt4()
        pysci_ = pyqscintilla()
        sip_ = sip()
        # dlls are the union of qt dlls and plugins directories (which is actually the same!)
        # qscis apis are recursive from qt4 (need to list all files)
        qscis = recursive_glob_as_dict(pysci_.qsci_dir,
                                       Pattern.sciapi,
                                       strip_keys=True,
                                       prefix_key="qsci").items()
        extra_pyqt4_mods = recursive_glob_as_dict(
            path(pyqt4_.install_site_dir) / "PyQt4",
            Pattern.pyall,
            strip_keys=True,
            prefix_key="PyQt4").items()
        # print extra_pyqt4_mods
        sip_mods = recursive_glob_as_dict(sip_.install_site_dir,
                                          Pattern.pyall,
                                          strip_keys=True,
                                          levels=1).items()

        lib_dirs = {"PyQt4": str(self.install_dll_dir)}
        package_dir = {"PyQt4": str(path(pyqt4_.install_site_dir) / "PyQt4")}

        d = dict(VERSION=self.version,
                 PACKAGES=find_packages(str(pyqt4_.install_site_dir), "PyQt4"),
                 PACKAGE_DIRS=package_dir,
                 PACKAGE_DATA={'': [Pattern.pyext]},
                 LIB_DIRS=lib_dirs,
                 INC_DIRS=None,
                 BIN_DIRS=None,
                 DATA_FILES=qscis + sip_mods + extra_pyqt4_mods,
                 INSTALL_REQUIRES=[mingw_rt().egg_name()])
        return d
Esempio n. 5
0
    def setup(self):
        qt4_ = qt4()
        pyqt4_ = pyqt4()
        sip_ = sip()
        # binaries are the union of qt, pyqt and sip binaries
        bin_dirs = {"bin": str(qt4_.install_bin_dir)}
        # includes are recursive subdirectories and the union of qt and sip includes
        incs = recursive_glob_as_dict( qt4_.install_inc_dir, Pattern.qtinc, strip_keys=True, prefix_key="include", dirs=True).items() + \
               recursive_glob_as_dict( sip_.install_inc_dir, Pattern.qtinc, strip_keys=True, prefix_key="include", dirs=True).items()
        inc_dirs = merge_list_dict(incs)
        # libs are recursive subdirectories of qt libs
        libs = recursive_glob_as_dict(qt4_.install_lib_dir,
                                      Pattern.qtstalib,
                                      strip_keys=True,
                                      prefix_key="lib").items()
        # sip files are recursive subdirectories and the union of pyqt4 and...
        sips = recursive_glob_as_dict(pyqt4_.install_sip_dir,
                                      Pattern.sipfiles,
                                      strip_keys=True,
                                      prefix_key="sip").items()
        # sources are recursive subdirectories and the union of qt4 and that all (CPP have been removed)...
        srcs = recursive_glob_as_dict(qt4_.install_src_dir,
                                      Pattern.qtsrc,
                                      strip_keys=True,
                                      prefix_key="src").items()
        # tra files are recursive subdirectories in qt4
        tra = recursive_glob_as_dict(qt4_.install_tra_dir,
                                     Pattern.qttransl,
                                     strip_keys=True,
                                     prefix_key="translations").items()
        # mks files are recursive subdirectories in qt4
        mks = recursive_glob_as_dict(qt4_.install_mks_dir,
                                     Pattern.qtmkspec,
                                     strip_keys=True,
                                     prefix_key="mkspecs").items()
        # plugins files are recursive subdirectories in qt4
        plu = recursive_glob_as_dict(qt4_.install_plu_lib_dir,
                                     Pattern.qtstalib,
                                     strip_keys=True,
                                     prefix_key="plugins").items()

        return dict(VERSION=qt4_.version,
                    BIN_DIRS=bin_dirs,
                    INC_DIRS=inc_dirs,
                    DATA_FILES=libs + sips + srcs + tra + mks + plu,
                    INSTALL_REQUIRES=[qt4_.egg_name()])
Esempio n. 6
0
 def setup(self):
     version_re  = re_compile("^.*BOOST_VERSION\s:\s([\d\.]{4,8}).*$", re.MULTILINE|re.DOTALL)
     incs = recursive_glob_as_dict( str(self.install_inc_dir), Pattern.qtinc, strip_keys=True, prefix_key="include", dirs=True).items()
     inc_dirs = merge_list_dict( incs )
     # get the version from Jamroot file
     version = "UNKNOWN"        
     with open( path(self.sourcedir)/"Jamroot" ) as f:
         txt = f.read()
         se = version_re.search(txt)
         if se:
             version = se.groups()[0]
     lib_dirs    = {"lib": str(self.install_lib_dir)}
     return dict( 
                 VERSION          = version,                 
                 LIB_DIRS         = lib_dirs,
                 INC_DIRS         = inc_dirs,
                 BIN_DIRS         = None,                
                 INSTALL_REQUIRES = [mingw_rt.egg_name()]
                 )  
Esempio n. 7
0
 def setup(self):
     mingwbase = self.get_path()
     if not path(mingwbase).exists():
         makedirs(path(mingwbase))
     subd  = os.listdir( mingwbase )
     safe_rmdir("EGG-INFO", subd)
     safe_rmdir("bin", subd)
     safe_rmdir("include", subd)
     data = []
     for dir in subd:
         dat = recursive_glob_as_dict(path(mingwbase)/dir, "*", strip_keys=True, prefix_key=dir).items()         
         data += [ (str(d), [str(f) for f in t if not f.endswith(".dll")]) for d,t in dat]
     bindirs = {"bin": str(self.get_bin_path())}
     incdirs = {"include": str(path(mingwbase)/"include")}   
     #libdirs = {"lib": str(path(mingwbase/"lib")}  
     return dict( 
                 VERSION  = self.version,
                 BIN_DIRS = bindirs,
                 INC_DIRS = incdirs,
                 LIB_DIRS = None,
                 DATA_FILES   = data,
                 )
Esempio n. 8
0
 def setup(self):
     version_re = re_compile("^.*BOOST_VERSION\s:\s([\d\.]{4,8}).*$",
                             re.MULTILINE | re.DOTALL)
     incs = recursive_glob_as_dict(str(self.install_inc_dir),
                                   Pattern.qtinc,
                                   strip_keys=True,
                                   prefix_key="include",
                                   dirs=True).items()
     inc_dirs = merge_list_dict(incs)
     # get the version from Jamroot file
     version = "UNKNOWN"
     with open(path(self.sourcedir) / "Jamroot") as f:
         txt = f.read()
         se = version_re.search(txt)
         if se:
             version = se.groups()[0]
     lib_dirs = {"lib": str(self.install_lib_dir)}
     return dict(VERSION=version,
                 LIB_DIRS=lib_dirs,
                 INC_DIRS=inc_dirs,
                 BIN_DIRS=None,
                 INSTALL_REQUIRES=[mingw_rt.egg_name()])