Skip to contentSkip to conversation

qt4: Fix translation support

PATCH In review Dmitry Eremin-Solenikov 2 participants 3 messages Oct 2, 2011 – Oct 5, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qt4: Fix translation support

From: Otavio Salvador <[email protected]>

The translation support was disable in build. The fix-translation.patch was imported from OpenEmbedded to fix a linking issue in phonon translation support.

[Dmitry Eremin-Solenikov: ported to apply to qt 4.7.4 build, bumped PR]

---
 meta/recipes-qt/qt4/qt-4.7.4.inc                   |    9 ++---
 .../recipes-qt/qt4/qt-4.7.4/fix-translations.patch |   32 ++++++++++++++++++++
 meta/recipes-qt/qt4/qt4-embedded_4.7.4.bb          |    2 +-
 meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb          |    2 +-
 4 files changed, 38 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-qt/qt4/qt-4.7.4/fix-translations.patch
meta/recipes-qt/qt4/qt-4.7.4.inc +4 -5
index 5c06bbe..bc33b6b 100644
@@ -13,6 +13,7 @@ SRC_URI = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${PV}.
            file://0009-support-2bpp.patch \
            file://0001-Added-Openembedded-crossarch-option.patch \
            file://blacklist-diginotar-certs.diff \
+           file://fix-translations.patch \
            file://g++.conf \
            file://linux.conf \
            file://fix-qtbug-20925.patch \
@@ -27,7 +28,9 @@ FILES_${QT_BASE_NAME}-tools                += "${bindir}/qml"
 
 do_configure_prepend() {
     for pro in $(find ${S} -name "*.pro") ; do
-        sed -i 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' $pro
+        sed -i \
+            -e 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' \
+            -e 's:qtPrepareTool(LRELEASE, lrelease):LRELEASE = ${OE_QMAKE_LRELEASE}:g' $pro
     done
 
     sed -i s:SEDME:${S}: ${WORKDIR}/linux.conf
@@ -39,10 +42,6 @@ do_configure_prepend() {
     ${S}/configure
 }
 
-do_configure_append() {
-    sed -e '/QMAKE_TARGET /d' -e '/TARGET /d' -i ${S}/translations/Makefile
-}
-
 QT_GLFLAGS ?= ""
 QT_CONFIG_FLAGS += " -xmlpatterns -no-rpath -qt3support -reduce-relocations -silent ${QT_GLFLAGS}"
 
meta/recipes-qt/qt4/qt-4.7.4/fix-translations.patch new file +32 -0
new file mode 100644
index 0000000..906d4e3
@@ -0,0 +1,32 @@
+fix phony translation linking error
+
+  | .../usr/lib/crt1.o: In function `_start':
+  | .../../sysdeps/i386/elf/start.S:115: undefined reference to `main'
+  | collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <[email protected]>
+
+diff --git a/translations/translations.pro b/translations/translations.pro
+index cdaf04a..24fa668 100644
+--- a/translations/translations.pro
++++ b/translations/translations.pro
+@@ -20,7 +20,7 @@ updateqm.name = LRELEASE ${QMAKE_FILE_IN}
+ updateqm.CONFIG += no_link
+ QMAKE_EXTRA_COMPILERS += updateqm
+ 
+-isEmpty(vcproj) {
++!isEmpty(vcproj) {
+     QMAKE_LINK = @: IGNORE THIS LINE
+     OBJECTS_DIR =
+     win32:CONFIG -= embed_manifest_exe
+@@ -30,7 +30,7 @@ isEmpty(vcproj) {
+     phony_src.input = PHONY_DEPS
+     phony_src.output = phony.c
+     phony_src.variable_out = GENERATED_SOURCES
+-    phony_src.commands = echo int main() { return 0; } > phony.c
++    phony_src.commands = echo \"int main() { return 0; }\" > phony.c
+     phony_src.name = CREATE phony.c
+     phony_src.CONFIG += combine
+     QMAKE_EXTRA_COMPILERS += phony_src
meta/recipes-qt/qt4/qt4-embedded_4.7.4.bb +1 -1
index 9d893f9..34061cb 100644
@@ -1,7 +1,7 @@
 require qt-${PV}.inc
 require qt4-embedded.inc
 
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
 
 QT_CONFIG_FLAGS_append_armv6-vfp = " -no-neon "
 
meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb +1 -1
index 2f39ec0..0290313 100644
@@ -1,7 +1,7 @@
 require qt4-x11-free.inc
 require qt-${PV}.inc
 
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
 
 QT_CONFIG_FLAGS_append_armv6-vfp = " -no-neon "
 
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 2/2 qt4: packaging fixup

Improve packaging:
* Add phrasebook packages to DYNAMIC_PACKAGES
* Correct phrasebook packages generation
* Include more files into -dbg packages
* Package fontdir and fonts README.

---
 meta/recipes-qt/qt4/qt4-embedded.inc |    2 +-
 meta/recipes-qt/qt4/qt4-x11-free.inc |    2 +-
 meta/recipes-qt/qt4/qt4.inc          |   13 ++++++++-----
 3 files changed, 10 insertions(+), 7 deletions(-)
meta/recipes-qt/qt4/qt4-embedded.inc +1 -1
index 53e1297..79473c9 100644
@@ -3,7 +3,7 @@ SECTION = "libs"
 LICENSE = "LGPLv2.1 | GPLv3"
 HOMEPAGE = "http://qt.nokia.com"
 DEPENDS += "directfb tslib"
-INC_PR = "r34"
+INC_PR = "r35"
 
 QT_BASE_NAME ?= "qt4-embedded"
 QT_BASE_LIB  ?= "libqt-embedded"
meta/recipes-qt/qt4/qt4-x11-free.inc +1 -1
index f76a97f..f391028 100644
@@ -5,7 +5,7 @@ HOMEPAGE = "http://qt.nokia.com"
 SECTION = "x11/libs"
 DEPENDS += "virtual/libgl virtual/libx11 fontconfig libxft libxext libxrender libxrandr libxcursor"
 
-INC_PR = "r31"
+INC_PR = "r32"
 
 QT_GLFLAGS ?= "${@base_contains('DISTRO_FEATURES', 'opengl', '-opengl', '-no-opengl', d)} "
 QT_GLFLAGS_qemux86 = "-opengl"
meta/recipes-qt/qt4/qt4.inc +8 -5
index eb01a1b..d6382f5 100644
@@ -50,7 +50,7 @@ python __anonymous () {
                   ${libdir}/lib%(name)s${QT_LIBINFIX}.so
                   ${includedir}/${QT_DIR_NAME}/%(incname)s
                   ${libdir}/pkgconfig/%(name)s${QT_LIBINFIX}.pc""" % locals(), d)
-        bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so.*" % locals(), d)
+        bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so*" % locals(), d)
         bb.data.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg", d)
         lib_packages.append(pkg)
         dev_packages.append("%s-dev" % pkg)
@@ -67,7 +67,7 @@ python __anonymous () {
                   ${libdir}/lib%(name)s.so
                   ${includedir}/${QT_DIR_NAME}/%(incname)s
                   ${libdir}/pkgconfig/%(name)s.pc""" % locals(), d)
-        bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so.*" % locals(), d)
+        bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so*" % locals(), d)
         bb.data.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg", d)
         lib_packages.append(pkg)
         dev_packages.append("%s-dev" % pkg)
@@ -104,7 +104,7 @@ OTHER_PACKAGES = "\
 #We prepend so ${QT_BASE_NAME}-demos-doc comes before ${PN}-doc,so the packaging of FILES_ get done before.
 PACKAGES =+ "${QT_BASE_NAME}-demos-doc"
 PACKAGES += "${LIB_PACKAGES} ${DEV_PACKAGES} ${DBG_PACKAGES} ${OTHER_PACKAGES}"
-PACKAGES_DYNAMIC = "${QT_BASE_NAME}-plugin-* ${QT_BASE_NAME}-translation-* ${QT_BASE_NAME}-fonts-*"
+PACKAGES_DYNAMIC = "${QT_BASE_NAME}-plugin-* ${QT_BASE_NAME}-translation-* ${QT_BASE_NAME}-phrasebook-* ${QT_BASE_NAME}-fonts-*"
 
 ALLOW_EMPTY_${PN} = "1"
 ALLOW_EMPTY_${QT_BASE_NAME}-fonts = "1"
@@ -157,6 +157,7 @@ FILES_${QT_BASE_NAME}-fonts-ttf-dejavu     = "${libdir}/fonts/DejaVu*.ttf"
 FILES_${QT_BASE_NAME}-fonts-pfa            = "${libdir}/fonts/*.pfa"
 FILES_${QT_BASE_NAME}-fonts-pfb            = "${libdir}/fonts/*.pfb"
 FILES_${QT_BASE_NAME}-fonts-qpf            = "${libdir}/fonts/*.qpf"
+FILES_${QT_BASE_NAME}-fonts                = "${libdir}/fonts/README ${libdir}/fonts/fontdir"
 FILES_${QT_BASE_NAME}-linguist             = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts"
 FILES_${QT_BASE_NAME}-linguist-dbg         = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts"
 FILES_${QT_BASE_NAME}-pixeltool            = "${bindir}/pixeltool"
@@ -171,7 +172,7 @@ FILES_${QT_BASE_NAME}-mkspecs              = "${datadir}/${QT_DIR_NAME}/mkspecs/
 FILES_${QT_BASE_NAME}-xmlpatterns          = "${bindir}/xmlpatterns*"
 FILES_${QT_BASE_NAME}-xmlpatterns-dbg      = "${bindir}/.debug/xmlpatterns*"
 FILES_${QT_BASE_NAME}-qml-plugins          = "${libdir}/${QT_DIR_NAME}/imports/* ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/*"
-FILES_${QT_BASE_NAME}-qml-plugins-dbg      = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug"
+FILES_${QT_BASE_NAME}-qml-plugins-dbg      = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/.debug"
 
 do_configure() {
 	unset QMAKESPEC
@@ -233,8 +234,10 @@ python populate_packages_prepend() {
         phrasebook_dir = bb.data.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/', d)
         phrasebook_name = bb.data.expand('${QT_BASE_NAME}-phrasebook-%s', d)
         import os;
-        if os.path.exists(phrasebook_dir):
+        if os.path.exists("%s%s" % (bb.data.expand('${D}',d), phrasebook_dir)):
                 do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' )
+        else:
+                bb.note("The path does not exist:", bb.data.expand('${D}', d), phrasebook_dir)
  
         # Package all the plugins and their -dbg version and create a meta package
         def qtopia_split(path, name, glob):
Signature · 1 line
1.7.2.5
#2 lore raw
In reply to Dmitry Eremin-Solenikov
Quoted 108 lines · Dmitry Eremin-Solenikov

From: Otavio Salvador<[email protected]>

The translation support was disable in build. The fix-translation.patch was imported from OpenEmbedded to fix a linking issue in phonon translation support.

[Dmitry Eremin-Solenikov: ported to apply to qt 4.7.4 build, bumped PR]

---
  meta/recipes-qt/qt4/qt-4.7.4.inc                   |    9 ++---
  .../recipes-qt/qt4/qt-4.7.4/fix-translations.patch |   32 ++++++++++++++++++++
  meta/recipes-qt/qt4/qt4-embedded_4.7.4.bb          |    2 +-
  meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb          |    2 +-
  4 files changed, 38 insertions(+), 7 deletions(-)

create mode 100644 meta/recipes-qt/qt4/qt-4.7.4/fix-translations.patch

meta/recipes-qt/qt4/qt-4.7.4.inc +4 -5
index 5c06bbe..bc33b6b 100644
@@ -13,6 +13,7 @@ SRC_URI = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${PV}.
             file://0009-support-2bpp.patch \
             file://0001-Added-Openembedded-crossarch-option.patch \
             file://blacklist-diginotar-certs.diff \
+           file://fix-translations.patch \
             file://g++.conf \
             file://linux.conf \
             file://fix-qtbug-20925.patch \
@@ -27,7 +28,9 @@ FILES_${QT_BASE_NAME}-tools                += "${bindir}/qml"
 
  do_configure_prepend() {
      for pro in $(find ${S} -name "*.pro") ; do
-        sed -i 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' $pro
+        sed -i \
+            -e 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' \
+            -e 's:qtPrepareTool(LRELEASE, lrelease):LRELEASE = ${OE_QMAKE_LRELEASE}:g' $pro
      done
 
      sed -i s:SEDME:${S}: ${WORKDIR}/linux.conf
@@ -39,10 +42,6 @@ do_configure_prepend() {
      ${S}/configure
  }
 
-do_configure_append() {
-    sed -e '/QMAKE_TARGET /d' -e '/TARGET /d' -i ${S}/translations/Makefile
-}
-
  QT_GLFLAGS ?= ""
  QT_CONFIG_FLAGS += " -xmlpatterns -no-rpath -qt3support -reduce-relocations -silent ${QT_GLFLAGS}"
 
meta/recipes-qt/qt4/qt-4.7.4/fix-translations.patch new file +32 -0
new file mode 100644
index 0000000..906d4e3
@@ -0,0 +1,32 @@
+fix phony translation linking error
+
+  | .../usr/lib/crt1.o: In function `_start':
+  | .../../sysdeps/i386/elf/start.S:115: undefined reference to `main'
+  | collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador<[email protected]>
+
+diff --git a/translations/translations.pro b/translations/translations.pro
+index cdaf04a..24fa668 100644
+--- a/translations/translations.pro
++++ b/translations/translations.pro
+@@ -20,7 +20,7 @@ updateqm.name = LRELEASE ${QMAKE_FILE_IN}
+ updateqm.CONFIG += no_link
+ QMAKE_EXTRA_COMPILERS += updateqm
+
+-isEmpty(vcproj) {
++!isEmpty(vcproj) {
+     QMAKE_LINK = @: IGNORE THIS LINE
+     OBJECTS_DIR =
+     win32:CONFIG -= embed_manifest_exe
+@@ -30,7 +30,7 @@ isEmpty(vcproj) {
+     phony_src.input = PHONY_DEPS
+     phony_src.output = phony.c
+     phony_src.variable_out = GENERATED_SOURCES
+-    phony_src.commands = echo int main() { return 0; }>  phony.c
++    phony_src.commands = echo \"int main() { return 0; }\">  phony.c
+     phony_src.name = CREATE phony.c
+     phony_src.CONFIG += combine
+     QMAKE_EXTRA_COMPILERS += phony_src
meta/recipes-qt/qt4/qt4-embedded_4.7.4.bb +1 -1
index 9d893f9..34061cb 100644
@@ -1,7 +1,7 @@
  require qt-${PV}.inc
  require qt4-embedded.inc
 
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
 
  QT_CONFIG_FLAGS_append_armv6-vfp = " -no-neon "
 
meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb +0 -0
index 2f39ec0..0290313 100644

meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb line 7

Quoted 8 lines
meta/recipes-qt/qt4/qt4-x11-free_4.7.4.bb +1 -1
@@ -1,7 +1,7 @@
  require qt4-x11-free.inc
  require qt-${PV}.inc
 
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
 
  QT_CONFIG_FLAGS_append_armv6-vfp = " -no-neon "
 

The 2 patches were merged to OE-Core

Thanks
Sau!