summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase.inc
blob: a5ac60cbc79603f1378ee3360a9e2bcd3d4b033b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
require qt5.inc

SRC_URI += " \
    file://0001-Add-linux-oe-g-platform.patch \
    file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
    file://0003-Add-external-hostbindir-option.patch \
    file://0004-qmake-is-already-built-in-qtbase-native.patch \
    file://0005-Allow-building-a-separate-qmake-for-the-target.patch \
    file://0006-qt_functions-temporary-remove-isEmpty-check.patch \
    file://0008-configureapp-Prefix-default-LIBDIRS-and-INCDIRS-with.patch \
    file://0009-qt_module-Fix-pkgconfig-replacement.patch \
    file://0010-qmake-property-rename-QT_INSTALL_CONFIGURATION-to-QT.patch \
    file://0011-qt_module-Fix-paths-in-.prl-files.patch \
"

DEPENDS += "qtbase-native virtual/libgl freetype jpeg libpng zlib openssl glib-2.0 ${ICU} udev"

# to provide xcb/xcb_icccm.h, xcb/xcb_image.h, xcb/xcb_keysyms.h and dbus/dbus.h
XCB_DEPENDS += "xcb-util-wm xcb-util-image xcb-util-keysyms dbus"
# reenable when we switch to "-qt-xcb" and build of 
# DEPENDS += "${XCB_DEPENDS}"
# QT_MODULE_FLAGS = "-qt-xcb"
# src/platformsupport/glxconvenience/ is resolved to be before build of
# src/plugins/platforms/xcb/

QT_MODULE_FLAGS = "-no-xcb"

INC_PR = "r0"

SSTATE_SCAN_FILES += "*.pri *.prl"

# Qt uses atomic instructions not supported in thumb mode
ARM_INSTRUCTION_SET = "arm"

inherit qmake5

do_generate_qt_config_file_append() {
    UNDO_SYSROOT_PREFIX=`echo ${STAGING_DIR_TARGET} | sed 's#/[^/]*#../#g'`
    cat >> ${WORKDIR}/qt.conf <<EOF

[EffectivePaths]
Prefix=..
#Prefix=$UNDO_SYSROOT_PREFIX
EOF
}

EXTRA_ENV = 'QMAKE="bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} -after \
             INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
             LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
             STRIP="${OE_QMAKE_STRIP}" \
             MAKE="make -e ${PARALLEL_MAKE}"'

# qtbase is exception, we need to use mkspecs from ${S}
# QMAKE_MKSPEC_PATH = "${S}/mkspecs"
QMAKE_MKSPEC_PATH = "${B}"

do_configure_append() {
    # we need symlink in path relative to source, because
    # EffectivePaths:Prefix is relative to qmake location
    if [ ! -e ${B}/bin/qmake ]; then
        mkdir ${B}/bin
        ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake
    fi

    ${S}/configure -v \
        -dont-process \
        -opensource -confirm-license \
        -sysroot ${STAGING_DIR_TARGET} \
        -no-gcc-sysroot \
        -prefix ${prefix} \
        -bindir ${bindir}/${QT_DIR_NAME} \
        -libdir ${libdir} \
        -datadir ${datadir}/${QT_DIR_NAME} \
        -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
        -docdir ${docdir}/${QT_DIR_NAME} \
        -headerdir ${includedir}/${QT_DIR_NAME} \
        -archdatadir ${libdir}/${QT_DIR_NAME} \
        -libexecdir ${libdir}/${QT_DIR_NAME}/libexec \
        -plugindir ${libdir}/${QT_DIR_NAME}/plugins \
        -importdir ${libdir}/${QT_DIR_NAME}/imports \
        -qmldir ${libdir}/${QT_DIR_NAME}/qml \
        -translationdir ${datadir}/${QT_DIR_NAME}/translations \
        -testsdir ${datadir}/${QT_DIR_NAME}/tests \
        -examplesdir ${datadir}/${QT_DIR_NAME}/examples \
        -hostbindir ${bindir}/${QT_DIR_NAME} \
        -hostdatadir ${libdir}/${QT_DIR_NAME} \
        -external-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
        -platform ${OE_QMAKESPEC} \
        -xplatform linux-oe-g++ \
        ${QT_CONFIG_FLAGS}
	
    bin/qmake -r ${OE_QMAKE_DEBUG_OUTPUT} ${S}
}

do_compile_append() {
    # Build qmake for the target arch
    # Disable for now, because doesn't work well with separate ${B}
    # cp -ra ${S}/qmake ${B}
    # cd ${B}/qmake
    # ${OE_QMAKE_QMAKE}
    # Fix to use headers in ${B}
    # sed '/INCPATH/s#${S}#${B}#g' -i Makefile
    # oe_runmake CC="${CC}" CXX="${CXX}"
    # cd ${B}
}

do_install_append() {
    ### Fix up the binaries to the right location
    ### TODO: FIX
    # qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed
    # ERROR: objcopy failed with exit code 1 (cmd was 'arm-oe-linux-gnueabi-objcopy' --only-keep-debug '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/qmake' '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/.debug/qmake')
    rm -f ${D}/${bindir}/${QT_DIR_NAME}/qmake

    # everything except HostData and HostBinaries is prefixed with sysroot value, 
    # but we cannot remove sysroot override, because that's useful for pkg-config etc
    cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
    rm -rf ${D}${STAGING_DIR_TARGET}
    # remove empty dirs
    TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
    while test ${TMP} != ${D}; do
        rmdir ${TMP}
        TMP=`dirname ${TMP}`;
    done
}

PACKAGES =. "${PN}-fonts "
FILES_${PN}-fonts = "${libdir}/${QT_DIR_NAME}/fonts ${libdir}/fonts"