[PyKDE] ANN: SIP/PyQt v3.3rc2

Ricardo Javier Cardenes Medina rcardenes at debian.org
Fri Jun 28 22:23:01 BST 2002


On Fri, Jun 28, 2002 at 02:06:30PM +0100, Phil Thompson wrote:
> 
> Again - *please* test the new build system.

Hi Phil. Just sip's test this time. I'll test PyQt later.
There's an annoying thing with this build system: it rewrites the .pro
templates, so if you re-run build.py without replacing them againg with
the original one, you end up with... no changes at all :-) I've modified
buildMakefile so it accepts a second (optional) argument, which it takes
as the 'template', and overwrites the first argument (the '.pro') with it
before patching.

I had problems with siplib compilation too. There's a little bug at line
461 of build.py. It lacks a space between Python and Qt headers' dirs.

There's a patch attached with these modifications.
-------------- next part --------------
--- build.py.orig	Fri Jun 28 21:19:54 2002
+++ build.py	Fri Jun 28 21:20:14 2002
@@ -244,6 +244,18 @@
 
     return os.path.basename(l[0])
 
+def copyFile(orig, dest):
+    """Make a copy of a file
+
+    orig is the name of the copied file.
+    dest is the name of the new file.
+    """
+    f1 = open(orig,"r")
+    f2 = open(dest,"w")
+    s = f1.read()
+    f2.write(s)
+    f1.close()
+    f2.close()
 
 def copyToFile(name,text):
     """Copy a string to a file.
@@ -458,7 +470,7 @@
 
         qtIncDir = ""
 
-    proPatches["INCLUDEPATH"] = [re.compile("@BL_INCLUDEPATH@",re.M), ". " + escape(platPyIncDir) + escape(qtIncDir)]
+    proPatches["INCLUDEPATH"] = [re.compile("@BL_INCLUDEPATH@",re.M), ". " + escape(platPyIncDir) + " " + escape(qtIncDir)]
 
     # Look for the Makefile generator.
     global makefileGen, usingTmake
@@ -673,13 +685,15 @@
     return runProgram(makeBin,argv,fatal)
 
 
-def buildMakefile(pro):
+def buildMakefile(pro, template=None):
     """Run qmake or tmake to create a Makefile from a project file.
 
     pro is the name of the project file.
     """
     global makefileGen, proPatches, makefilePatches
 
+    if template:
+    	copyFile(template,pro)
     patchFile(pro,proPatches)
     runProgram(makefileGen,['-o', 'Makefile', pro])
     patchFile("Makefile",makefilePatches)
@@ -781,13 +795,13 @@
 
     inform("Creating SIP code generator Makefile.")
     olddir = pushDir("sipgen")
-    buildMakefile("sipgen.pro")
+    buildMakefile("sipgen.pro", "sipgen.t")
     fixInstallTarget()
     popDir(olddir)
 
     inform("Creating SIP module Makefile.")
     olddir = pushDir("siplib")
-    buildMakefile("siplib.pro")
+    buildMakefile("siplib.pro", "siplib.t")
     fixInstallTarget(1)
     popDir(olddir)
 


More information about the PyQt mailing list