diff options
Diffstat (limited to 'qt/ScintillaEditPy')
-rw-r--r-- | qt/ScintillaEditPy/ScintillaEditPy.pro | 4 | ||||
-rw-r--r-- | qt/ScintillaEditPy/sepbuild.py | 29 |
2 files changed, 20 insertions, 13 deletions
diff --git a/qt/ScintillaEditPy/ScintillaEditPy.pro b/qt/ScintillaEditPy/ScintillaEditPy.pro index 92841ef7e..d8884e5ad 100644 --- a/qt/ScintillaEditPy/ScintillaEditPy.pro +++ b/qt/ScintillaEditPy/ScintillaEditPy.pro @@ -43,7 +43,7 @@ macx { # QMAKE_CXXFLAGS = -arch i386 -arch x86_64 # QMAKE_LFLAGS = -arch i386 -arch x86_64 LIBS += -L$$PY_LIBDIR -lpython$$PY_VERSION_SUFFIX - LIBS += -L$$PYSIDE_LIB + LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB debug { LIBS += -lshiboken-python$$PY_VERSION_SUFFIX-dbg LIBS += -lpyside-python$$PY_VERSION_SUFFIX-dbg @@ -63,7 +63,7 @@ win32 { LIBS += -lQtCore } LIBS += -L$$PY_PREFIX/libs # Note python lib is pulled in via a #pragma - LIBS += -L$$PYSIDE_LIB + LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB # PySide uses x.y suffix on Windows even though Python uses xy DebugBuild { LIBS += -lshiboken-python$${PY_VERSION}_d diff --git a/qt/ScintillaEditPy/sepbuild.py b/qt/ScintillaEditPy/sepbuild.py index be1b238da..c399eb3e9 100644 --- a/qt/ScintillaEditPy/sepbuild.py +++ b/qt/ScintillaEditPy/sepbuild.py @@ -36,7 +36,10 @@ def IsFileNewer(name1, name2): return (mod_time1 > mod_time2) def textFromRun(args): - (stdoutdata, stderrdata) = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE).communicate() + proc = subprocess.Popen(args, shell=isinstance(args, str), stdout=subprocess.PIPE) + (stdoutdata, stderrdata) = proc.communicate() + if proc.returncode: + raise OSError(proc.returncode) return stdoutdata def runProgram(args, exitOnFailure): @@ -171,22 +174,25 @@ class SepBuilder: def _setPySideBase(self, base): self.PySideBase = base - if PLAT_LINUX: - self.PySideTypeSystem = textFromRun("pkg-config --variable=typesystemdir pyside").rstrip() - self.PySideIncludeBase = textFromRun("pkg-config --variable=includedir pyside").rstrip() - self.ShibokenIncludeBase = textFromRun("pkg-config --variable=includedir shiboken").rstrip() - else: - self.PySideTypeSystem = os.path.join(self.PySideBase, "share", "PySide", "typesystems") - self.ShibokenIncludeBase = os.path.join(self.PySideBase, "include", "shiboken") - self.PySideIncludeBase = os.path.join(self.PySideBase, "include", "PySide") - + def _try_pkgconfig(var, package, *relpath): + try: + return textFromRun(["pkg-config", "--variable=" + var, package]).rstrip() + except OSError: + return os.path.join(self.PySideBase, *relpath) + self.PySideTypeSystem = _try_pkgconfig("typesystemdir", "pyside", + "share", "PySide", "typesystems") + self.PySideIncludeBase = _try_pkgconfig("includedir", "pyside", + "include", "PySide") + self.ShibokenIncludeBase = _try_pkgconfig("includedir", "shiboken", + "include", "shiboken") self.PySideIncludes = [ self.ShibokenIncludeBase, self.PySideIncludeBase, os.path.join(self.PySideIncludeBase, "QtCore"), os.path.join(self.PySideIncludeBase, "QtGui")] - self.PySideLibDir = os.path.join(self.PySideBase, "lib") + self.PySideLibDir = _try_pkgconfig("libdir", "pyside", "lib") + self.ShibokenLibDir = _try_pkgconfig("libdir", "shiboken", "lib") self.AllIncludes = os.pathsep.join(self.QtIncludes + self.ScintillaEditIncludes + self.PySideIncludes) self.ShibokenGenerator = "shiboken" @@ -244,6 +250,7 @@ class SepBuilder: f.write("PYSIDE_INCLUDES=" + doubleBackSlashes(self.PySideIncludeBase) + "\n") f.write("PYSIDE_LIB=" + doubleBackSlashes(self.PySideLibDir) + "\n") f.write("SHIBOKEN_INCLUDES=" + doubleBackSlashes(self.ShibokenIncludeBase) + "\n") + f.write("SHIBOKEN_LIB=" + doubleBackSlashes(self.ShibokenLibDir) + "\n") if self.DebugBuild: f.write("CONFIG += debug\n") else: |