diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2013-11-07 18:15:10 +1100 | 
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-11-07 18:15:10 +1100 | 
| commit | 4f227a1f818a78ffedd780a860b5538a107957df (patch) | |
| tree | 0eef3ec5e406ab07c6b453078b60ebd09e4d1065 | |
| parent | 67481cbf1751c33e04a7377eb3bd124d8af8d586 (diff) | |
| download | scintilla-mirror-4f227a1f818a78ffedd780a860b5538a107957df.tar.gz | |
Feature [feature-requests:#1544]. Qt build system fixes for PySide separate from shiboken.
From Mark Yen.
| -rwxr-xr-x | cocoa/checkbuildosx.sh | 4 | ||||
| -rw-r--r-- | qt/ScintillaEditPy/ScintillaEditPy.pro | 4 | ||||
| -rw-r--r-- | qt/ScintillaEditPy/sepbuild.py | 29 | 
3 files changed, 22 insertions, 15 deletions
| diff --git a/cocoa/checkbuildosx.sh b/cocoa/checkbuildosx.sh index 3ad1207f7..0b4cecbbf 100755 --- a/cocoa/checkbuildosx.sh +++ b/cocoa/checkbuildosx.sh @@ -37,14 +37,14 @@ echo Building Qt and PySide  cd scintilla/qt  cd ScintillaEditBase -qmake +qmake -spec macx-xcode  xcodebuild clean  xcodebuild  cd ..  cd ScintillaEdit  python WidgetGen.py -qmake +qmake -spec macx-xcode  xcodebuild clean  xcodebuild  cd .. 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: | 
