[PATCH 2/3] Install Qt and Subsurface translations for Windows

Thiago Macieira thiago at macieira.org
Thu Dec 5 16:01:11 UTC 2013


Dirk had done most of the work already. I just needed to add some
trickery to install the system translations in case cross-mingw32
didn't provide it.

Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
 subsurface-install.pri | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/subsurface-install.pri b/subsurface-install.pri
index c244520..3389dd1 100644
--- a/subsurface-install.pri
+++ b/subsurface-install.pri
@@ -3,7 +3,14 @@ xslt.files = $$XSLT_FILES
 icons.files = $$ICONS_FILES
 doc.files = $$DOC_FILES
 translation.files = $$replace(TRANSLATIONS, .ts, .qm)
-qttranslation.files = $$join(QTTRANSLATIONS," "$$[QT_INSTALL_TRANSLATIONS]/,$$[QT_INSTALL_TRANSLATIONS]/)
+exists($$[QT_INSTALL_TRANSLATIONS]) {
+	qt_translation_dir = $$[QT_INSTALL_TRANSLATIONS]/
+} else: exists(/usr/share/qt4/translations) {
+	# On some cross-compilation environments, the translations are either missing or not
+	# where they're expected to be. In such cases, try copying from the system.
+	qt_translation_dir = /usr/share/qt4/translations
+}
+qttranslation.files = $$join(QTTRANSLATIONS," "$$qt_translation_dir/,$$qt_translation_dir/)
 
 nltab = $$escape_expand(\\n\\t)
 
@@ -54,6 +61,10 @@ mac {
 	marbledir.path = $$WINDOWSSTAGING/data
 	INSTALLS += deploy marbledir target
 
+	translation.path = $$WINDOWSSTAGING/translations
+	qttranslation.path = $$WINDOWSSTAGING/translations
+	INSTALLS += translation qttranslation
+
 	qt_conf.commands = echo \'[Paths]\' > $@
 	qt_conf.commands += $${nltab}echo \'Prefix=.\' >> $@
 	qt_conf.target = $$PWD/packaging/windows/qt.conf
-- 
1.7.11.7



More information about the subsurface mailing list