summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Lacko <backup.rlacko@gmail.com>2012-06-07 08:34:11 +0200
committerRoman Lacko <backup.rlacko@gmail.com>2012-06-07 08:34:11 +0200
commit66b90adc1bb48b70fe6456b1f00cb1c4682c7070 (patch)
tree2c09e8c3ca1ca8a7f076133b0f5fa2f76ff9ff4d
parent8123eef67f9c5e239a22b33b0ff32bbb502e9dc5 (diff)
new --standalone option, when enabled, package qt libs on linux
-rw-r--r--qtinfo.py4
-rw-r--r--setup.py55
-rw-r--r--utils.py6
3 files changed, 53 insertions, 12 deletions
diff --git a/qtinfo.py b/qtinfo.py
index 1369bff6..e638f90a 100644
--- a/qtinfo.py
+++ b/qtinfo.py
@@ -18,6 +18,9 @@ class QtInfo(object):
def getBinsPath(self):
return self.getProperty("QT_INSTALL_BINS")
+ def getLibsPath(self):
+ return self.getProperty("QT_INSTALL_LIBS")
+
def getPluginsPath(self):
return self.getProperty("QT_INSTALL_PLUGINS")
@@ -45,6 +48,7 @@ class QtInfo(object):
version = property(getVersion)
bins_dir = property(getBinsPath)
+ libs_dir = property(getLibsPath)
plugins_dir = property(getPluginsPath)
qmake_path = property(getQMakePath)
imports_dir = property(getImportsPath)
diff --git a/setup.py b/setup.py
index 99429264..a7c3aed8 100644
--- a/setup.py
+++ b/setup.py
@@ -95,10 +95,6 @@ def has_option(name):
return True
except ValueError:
pass
- # allow passing all cmd line options also as environment variables
- env_val = os.getenv(name.upper().replace('-', '_'), 'false').lower()
- if env_val == "true":
- return True
return False
def option_value(name):
@@ -122,6 +118,7 @@ OPTION_QMAKE = option_value("qmake")
OPTION_CMAKE = option_value("cmake")
OPTION_OPENSSL = option_value("openssl")
OPTION_ONLYPACKAGE = has_option("only-package")
+OPTION_STANDALONE = has_option("standalone")
if OPTION_QMAKE is None:
OPTION_QMAKE = find_executable("qmake")
@@ -404,7 +401,9 @@ class pyside_build(_build):
"setup_dir": self.script_dir,
"ssl_libs_dir": OPTION_OPENSSL,
"py_version": self.py_version,
+ "qt_version": self.qtinfo.version,
"qt_bin_dir": self.qtinfo.bins_dir,
+ "qt_lib_dir": self.qtinfo.libs_dir,
"qt_plugins_dir": self.qtinfo.plugins_dir,
"qt_imports_dir": self.qtinfo.imports_dir,
"qt_translations_dir": self.qtinfo.translations_dir,
@@ -454,8 +453,8 @@ class pyside_build(_build):
"${install_dir}/lib/",
"${setup_dir}/PySide",
filter=[
- "libpyside*",
- "libshiboken*",
+ "libpyside*.so.*",
+ "libshiboken*.so.*",
],
recursive=False, logger=log, vars=vars)
# <install>/share/PySide/typesystems/* -> <setup>/PySide/typesystems
@@ -473,6 +472,38 @@ class pyside_build(_build):
"${sources_dir}/pyside-examples/examples",
"${setup_dir}/PySide/examples",
force=False, logger=log, vars=vars)
+ # Copy Qt libs to package
+ if OPTION_STANDALONE:
+ # <qt>/bin/* -> <setup>/PySide
+ copydir("${qt_bin_dir}", "${setup_dir}/PySide",
+ filter=[
+ "designer",
+ "linguist",
+ "lrelease",
+ "lupdate",
+ "lconvert",
+ ],
+ recursive=False, logger=log, vars=vars)
+ # <qt>/lib/* -> <setup>/PySide
+ copydir("${qt_lib_dir}", "${setup_dir}/PySide",
+ filter=[
+ "libQt*.so.?",
+ "libphonon.so.?",
+ ],
+ recursive=False, logger=log, vars=vars)
+ # <qt>/plugins/* -> <setup>/PySide/plugins
+ copydir("${qt_plugins_dir}", "${setup_dir}/PySide/plugins",
+ filter=["*.so"],
+ logger=log, vars=vars)
+ # <qt>/imports/* -> <setup>/PySide/imports
+ if float(vars["qt_version"][:3]) > 4.6:
+ copydir("${qt_imports_dir}", "${setup_dir}/PySide/imports",
+ filter=["qmldir", "*.so"],
+ logger=log, vars=vars)
+ # <qt>/translations/* -> <setup>/PySide/translations
+ copydir("${qt_translations_dir}", "${setup_dir}/PySide/translations",
+ filter=["*.qm"],
+ logger=log, vars=vars)
def prepare_packages_win32(self, vars):
# <install>/lib/site-packages/PySide/* -> <setup>/PySide
@@ -522,6 +553,11 @@ class pyside_build(_build):
"${install_dir}/include",
"${setup_dir}/PySide/include",
logger=log, vars=vars)
+ # <sources>/pyside-examples/examples/* -> <setup>/PySide/examples
+ copydir(
+ "${sources_dir}/pyside-examples/examples",
+ "${setup_dir}/PySide/examples",
+ force=False, logger=log, vars=vars)
# <ssl_libs>/* -> <setup>/PySide/
copydir("${ssl_libs_dir}", "${setup_dir}/PySide",
filter=[
@@ -554,13 +590,8 @@ class pyside_build(_build):
logger=log, vars=vars)
# <qt>/translations/* -> <setup>/PySide/translations
copydir("${qt_translations_dir}", "${setup_dir}/PySide/translations",
- filter=["*.ts"],
+ filter=["*.qm"],
logger=log, vars=vars)
- # <sources>/pyside-examples/examples/* -> <setup>/PySide/examples
- copydir(
- "${sources_dir}/pyside-examples/examples",
- "${setup_dir}/PySide/examples",
- force=False, logger=log, vars=vars)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
diff --git a/utils.py b/utils.py
index 59cb50d4..8659b507 100644
--- a/utils.py
+++ b/utils.py
@@ -77,6 +77,12 @@ def copydir(src, dst, logger=None, filter=None, ignore=None, force=True,
if vars is not None:
src = subst_vars(src, **vars)
dst = subst_vars(dst, **vars)
+ if filter is not None:
+ for i in range(len(filter)):
+ filter[i] = subst_vars(filter[i], **vars)
+ if ignore is not None:
+ for i in range(len(ignore)):
+ ignore[i] = subst_vars(ignore[i], **vars)
if not os.path.exists(src) and not force:
if logger is not None: