?–Sc@sddlZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZddlmZyLddlZddlmZdd lmZdd lmZmZmZWnek reZnXeZgZgZ d Z!d Z"d Z#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-defdYZ.de fdYZ/de fdYZ0defdYZ1d e2fd!YZ3d"e1fd#YZ4dS($iN(tdep_util(t build_ext(t install_lib(t install_data(t Extension(tfind_executable(t Overrides(t DefsParser(tregister_typest SourceWritert FileOutputs *************************************************************************** Codegen could not be found on your system and is required by the dsextras.Template and dsextras.TemplateExtension classes. *************************************************************************** cCstjd|d}tjjdr2d}n'tjjdrMd}n tdx<t|jD](}|j|}|rl|j dSqlWdS(s@Return the value of a m4_define variable as set in configure.in.s m4_define\(s \,\s*(.+)\)s configure.acs configure.ins$ERROR: Could not find configure fileiN( tretcompiletostpathtexistst SystemExittopent readlinestmatchtgrouptNone(tvarnametpatterntfnametlinet match_obj((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt get_m4_define*s   cCst|dS(s=Return output (stdout or stderr) of executing cmd in a shell.i(tgetstatusoutput(tcmd((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt getoutput=scCstjdkrjtj|d}|j}|jp<d}x|dd kr_|d }qBW||fSddlm}||SdS( s4Return (status, output) of executing cmd in a shell.twin32triis s (RN(s s (tsystplatformR tpopentreadtclosetcommandsR(RtpipettexttstsR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRAs  cCstdrtSdS(sChecks for the existence of gcctgccN(RtTrue(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pythave_gccPs cCstdrtSdS(s&Checks for the existence of pkg-configs pkg-configN(RR+(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pythave_pkgconfigUs cCs|jtjdkrP|jtj}tj|d tj}|d}n |}d}tjj|}g}xHtj|D]7}t j ||r|j tjj||qqW|S(sList all files in a dir, with filename match support: for example: glade/*.glade will return all files in the glade directory that matches *.glade. It also looks up the full pathit.( tfindR tseptsplittstringtjoinRtabspathtlistdirtfnmatchtappend(tdirtpartsRtretvaltfile((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt list_filesZs #cCsntjd| }|stSt|}tt|jd}tt|jd}||krjtStS(ssCheck the existence and version number of a package: returns False if not installed or too old, True otherwise.spkg-config --exists %sR.(R tsystemtFalsetpkgc_get_versiontmaptintR1R+(tnamet req_versiont is_installedt orig_versiontversiont pkc_version((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_version_checkos  cCstd|S(s7return the version as return by pkg-config --modversionspkg-config --modversion %s(R(RB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR?scCs&td|}|jddjS(sCreturns a list of libraries as returned by pkg-config --libs-only-lspkg-config --libs-only-l %ss-lt(RtreplaceR1(RBtoutput((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_librariesscCs&td|}|jddjS(sFreturns a list of library dirs as returned by pkg-config --libs-only-Lspkg-config --libs-only-L %ss-LRI(RRJR1(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_library_dirsscCs&td|}|jddjS(sHreturns a list of include dirs as returned by pkg-config --cflags-only-Ispkg-config --cflags-only-I %ss-IRI(RRJR1(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_include_dirsscCstd|}|S(sAreturns the defs dir as returned by pkg-config --variable=defsdirs pkg-config --variable=defsdir %s(R(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_defs_dirstBuildExtcBs,eZdZdZdZdZRS(cCsg|_tjdkr|jjdkrtsBtdnidd6dd6dd6}td }d |||d fGH|jj||d ndS( NRtmingw32sERROR: Could not find gcc.s-fnative-structt2s-mms-bitfieldst3t4sgcc -dumpversions)using MinGW GCC version %s with %s optioni( textra_compile_argsR!R"tcompilert compiler_typeR,RRR7(tselftmsnative_structt gcc_version((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytinit_extra_compile_argss !    cCsktjdkrg|jjdkrgts9tdn|jjjdrg|jjjdqgndS(NRRQsERROR: Could not find gcc.s-static( R!R"RVRWR,Rt linker_sotcounttremove(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytmodify_compilers ! cCs%|j|jtj|dS(N(R[R_Rtbuild_extensions(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR`s  cCs|j|j7_t|dr.|jntjdkr|jjdkr|j}g|jD]}|dkrb|^qb|_n |j}tj |||dk r||jkr||_ndS(NtgenerateRtmsvctctm(RcRd( RUthasattrRaR!R"RVRWt librariesRtbuild_extensionR(RXtextt save_libstlib((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRgs !  (t__name__t __module__R[R_R`Rg(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRPs  t InstallLibcBs/eZgZgZdZdZdZRS(cCs ||_dS(N(t install_dir(RXRn((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytset_install_dirscCstj||jS(N(Rt get_outputst local_outputs(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRpscCstj||jS(N(Rt get_inputst local_inputs(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRrs(RkRlRqRsRoRpRr(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRms   t InstallDatacBsPeZgZgZiZdZdZdZdZdZ dZ RS(cCs(tjdkr:tjj|jjtjd |_n(tjj|jjtjd |_d|_d|_d|_ d|_ d|_ |j d|j|j d |j|j d |j|j d |j |j d |j |j d |j |j dt j|j dddS(Ntntiis ${prefix}/bins${prefix}/includes ${prefix}/libs${prefix}/sharetprefixt exec_prefixt includedirtlibdirt datarootdirtdatadirtPYTHONtTHREADING_CFLAGSRI(R RBR0R3RnR1RvRwRxRyRzR{tadd_template_optionR!t executable(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytprepares +(     cCs ||_dS(N(Rn(RXRn((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRoscCs||jd|* %s.pc could not be found, bindings for %s will not be built.R.sWarning: Too old version of %ss% Need %s, but %s is installedN(t can_build_okRRRRRGtzipR R=RBR>R?R@RAR1R+(RXtreqstpackageRFR:RE((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt can_buildfs*     cCsdS(N((RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRasN( RkRlRRRRRRRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs " tTemplatecBs>eZdZgdedZdZdZdZRS(cOs/ts"td|jtfntj|S(Ns'%s' is not defined %s(ttemplate_classes_enabledt NameErrorRktcodegen_error_messagetobjectt__new__(tclstargstkwds((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs c Cs||_||_||_||_||_g|_t|tre|d|_|jj |n ||_g|_ xT|D]L}t|tr|j j |d|jj |q~|j j |q~WdS(Ni( toverrideRKRvt load_typestpy_ssize_t_cleant built_defst isinstanceRtdefsR7tregister( RXRRKRRvRRRR ((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs           cCs>|j}|j|j|j|jtj||j S(N(RR7RRRt newer_groupRK(RXtfiles((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt check_datess cCsSxL|jD]A\}}tj||r d|g|}tjj|q q WdS(Ntdummy(RRRtcodegent createdefstmain(RXttargettsourcesR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt generate_defsscCs|j|jrdSx:|jD]/}t|tt}|jt|q$W|jryi}t |j|nt|j tt}|jt|t |j d}t |t|j|jt||j }|j|j|jdS(Ntw(RRRRtdictRt startParsingRRtexecfileRRRKR RRRvR RRR%(RXtitemtdptglobalstfdtsw((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRas$      N( RkRlRRR>RRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs    tTemplateExtensioncBs#eZdZdZdZRS(cOs5ts"td|jtfntj|||S(Ns'%s' is not defined %s(RRRkRRR(RRR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs c Ks |d}|d}t|tr8|dd d}n|d d}|d}|jd}|jdt}g|_|jjt|||d ||d |||d =|d=|d=|r|d=n|jd r|d |d<|d =nt j ||dS( NRBRiis.cRRRtpyRRK( RRtgetRR>t templatesR7Rthas_keyRR(RXRRBRRKRRR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs&        cCstd|jdS(NcSs |jS(N(Ra(tx((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyts(R@R(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRas(RkRlRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs  (5R R!R6R R2t distutilsRtdistutils.command.build_extRtdistutils.command.install_libRtdistutils.command.install_dataRtdistutils.extensionRtdistutils.spawnRtcodegen.createdefsRtcodegen.overrideRtcodegen.defsparserRtcodegen.codegenRR R t ImportErrorR>RR+RRRRRRR,R-R<RHR?RLRMRNRORPRmRtRRRR(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytsN                     ?8lN