1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_configure.dpatch by Torsten Marek <shlomme@debian.org>
##
## DP: Make PyQt4 objectdir-buildable
@DPATCH@
diff -urNad python-qt4-4.0.1~/configure.py python-qt4-4.0.1/configure.py
--- python-qt4-4.0.1~/configure.py 2006-07-15 19:43:31.000000000 +0200
+++ python-qt4-4.0.1/configure.py 2006-10-17 20:16:20.000000000 +0200
@@ -20,6 +20,8 @@
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Modified for Debian by Torsten Marek <shlomme@gmx.net>
+
import sys
import os
import string
@@ -29,6 +31,23 @@
import sipconfig
+topsrcdir = os.path.dirname(os.path.abspath(__file__))
+has_objdir = topsrcdir != os.path.abspath(os.path.curdir)
+if not has_objdir:
+ topsrcdir = None
+
+
+def makeDir(dirname):
+ try:
+ os.mkdir(dirname)
+ except OSError, e:
+ if e.errno != 17:
+ raise
+
+def srcPath(filename):
+ if topsrcdir is not None:
+ return os.path.join(topsrcdir, filename)
+ return filename
# Initialise the globals.
pyqt_version = 0x040001
@@ -115,7 +134,8 @@
0x040101: None,
0x040102: "Qt_4_1_1",
0x040103: "Qt_4_1_2",
- 0x050000: "Qt_4_1_3"
+ 0x040200: "Qt_4_1_3",
+ 0x050000: "Qt_4_2_0"
}
def check_modules(self):
@@ -163,26 +183,26 @@
f = open("Qt.py", "w")
for m in pyqt_modules:
- f.write("from PyQt4.%s import *\n" % m)
+ f.write("try: from PyQt4.%s import *\nexcept ImportError: pass\n" % m)
f.close()
def module_installs(self):
- return ["__init__.py", "Qt.py", "pyqtconfig.py"]
+ return [srcPath("__init__.py"), "Qt.py", "pyqtconfig.py"]
def tools(self):
tool = []
- sipconfig.inform("Creating elementtree Makefile...")
+## sipconfig.inform("Creating elementtree Makefile...")
- makefile = sipconfig.PythonModuleMakefile(
- configuration=sipcfg,
- dstdir=os.path.join(opt_pyqtmoddir, "elementtree"),
- dir="elementtree"
- )
+## makefile = sipconfig.PythonModuleMakefile(
+## configuration=sipcfg,
+## dstdir=os.path.join(opt_pyqtmoddir, "elementtree"),
+## dir="elementtree"
+## )
- makefile.generate()
- tool.append("elementtree")
+## makefile.generate()
+## tool.append("elementtree")
# Create the pyuic4 wrapper. Use the GUI version on MacOS (so that
# previews work properly and normal console use will work anyway), but
@@ -190,16 +210,17 @@
sipconfig.inform("Creating pyuic4 wrapper...")
uicdir=os.path.join(opt_pyqtmoddir, "uic")
- wrapper = sipconfig.create_wrapper(os.path.join(uicdir, "pyuic.py"), os.path.join("pyuic", "pyuic4"), (sys.platform == "darwin"))
+ makeDir("pyuic")
+ #wrapper = sipconfig.create_wrapper(os.path.join(uicdir, "pyuic.py"), os.path.join("pyuic", "pyuic4"), (sys.platform == "darwin"))
sipconfig.inform("Creating pyuic4 Makefile...")
makefile = sipconfig.PythonModuleMakefile(
configuration=sipcfg,
dstdir=uicdir,
- srcdir="uic",
+ srcdir=srcPath(os.path.join("pyuic", "uic")),
dir="pyuic",
- installs=[[os.path.basename(wrapper), opt_pyqtbindir]]
+ #installs=[[os.path.basename(wrapper), opt_pyqtbindir]]
)
makefile.generate()
@@ -207,7 +228,7 @@
if "QtXml" in pyqt_modules:
sipconfig.inform("Creating pylupdate4 Makefile...")
-
+ makeDir("pylupdate")
makefile = sipconfig.ProgramMakefile(
configuration=sipcfg,
build_file="pylupdate.sbf",
@@ -216,14 +237,15 @@
console=1,
qt=["QtCore", "QtGui", "QtXml"],
debug=opt_debug,
- warnings=1
+ warnings=1,
+ topsrcdir=topsrcdir
)
-
+ makefile.extra_include_dirs.append(srcPath("pylupdate"))
makefile.generate()
tool.append("pylupdate")
sipconfig.inform("Creating pyrcc4 Makefile...")
-
+ makeDir("pyrcc")
makefile = sipconfig.ProgramMakefile(
configuration=sipcfg,
build_file="pyrcc.sbf",
@@ -232,7 +254,8 @@
console=1,
qt=["QtCore", "QtXml"],
debug=opt_debug,
- warnings=1
+ warnings=1,
+ topsrcdir=topsrcdir
)
makefile.generate()
@@ -357,7 +380,6 @@
makefile = sipconfig.ProgramMakefile(sipcfg, console=1, qt=[mname], warnings=0, opengl=opengl, debug=opt_debug)
exe, build = makefile.build_command(name)
-
# Make sure the executable file doesn't exist.
remove_file(exe)
run_command(build)
@@ -397,7 +419,7 @@
ctor is the C++ constructor of the class being used for the test.
"""
# Check the module's main .sip file exists.
- if os.access(os.path.join("sip", mname, mname + "mod.sip"), os.F_OK):
+ if os.access(srcPath(os.path.join("sip", mname, mname + "mod.sip")), os.F_OK):
sipconfig.inform("Checking to see if the %s module should be built..." % mname)
if check_class(incfile, ctor, mname):
@@ -511,10 +533,14 @@
argv.append(buildfile)
argv.append("-I")
- argv.append("sip")
+ argv.append(srcPath("sip"))
# SIP assumes POSIX style path separators.
- argv.append(string.join(["sip", mname, mname + "mod.sip"], "/"))
+ if topsrcdir is not None:
+ argv.append(string.join([topsrcdir, "sip", mname, mname + "mod.sip"], "/"))
+ else:
+ argv.append(string.join(["sip", mname, mname + "mod.sip"], "/"))
+
cmd = string.join(argv)
@@ -534,7 +560,11 @@
sipfiles = []
for s in glob.glob("sip/" + mname + "/*.sip"):
- sipfiles.append(os.path.join("..", "sip", mname, os.path.basename(s)))
+ if has_objdir:
+ topdir = topsrcdir
+ else:
+ topdir = ".."
+ sipfiles.append(os.path.join(topdir, "sip", mname, os.path.basename(s)))
installs.append([sipfiles, os.path.join(opt_pyqtsipdir, mname)])
@@ -895,6 +925,7 @@
"""QT = core
TARGET = %s
SOURCES = %s
+CONFIG += release
""" % (app, cpp_file))
f.close()
@@ -1120,7 +1151,7 @@
).generate()
# Install the configuration module.
- create_config("pyqtconfig.py", "pyqtconfig.py.in", macros)
+ create_config("pyqtconfig.py", srcPath("pyqtconfig.py.in"), macros)
###############################################################################
|