aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt3/qt3/qt-x11-free-common.inc
blob: 6d23848df9a6a4b3d06836d98dfc07bd8b5bab76 (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
DESCRIPTION = "Qt/X11 Version ${PV} is a full fledged cross-platform application framework"
SECTION = "x11/libs"
LICENSE = "GPLv2 | QPL-1.0"
HOMEPAGE = "http://www.trolltech.com"
INC_PR = "r6"

S = "${WORKDIR}/qt-x11-free-${PV}"

QT3DEPENDS = ""

inherit qmake_base qt3x11 distro_features_check
REQUIRED_DISTRO_FEATURES = "x11"

export QTDIR = "${S}"
ARCH_i686 = "x86"
EXTRA_OEMAKE = "-e"

QT_CONFIG_FLAGS = "-release -shared -qt-zlib -no-nas-sound -no-sm -qt-libpng -no-gif -no-xinerama \
                   -no-tablet -no-xkb -no-dlopen-opengl -no-nis -no-cups -thread  -verbose"

EXTRA_ENV = 'QMAKE="${OE_QMAKE_QMAKE} -after INCPATH+=${STAGING_INCDIR} \
             INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
             QMAKESPEC="${QMAKESPEC}" LINK="${CXX}" \
             AR="${TARGET_PREFIX}ar cqs" \
             MOC="${OE_QMAKE_MOC}" UIC="${OE_QMAKE_UIC}" MAKE="make -e"'

# This isn't an ideal fix, but not everything is obeying the 'LINK' variable,
# and the qt3 build isn't using a qmake.conf that obeys the OE_QMAKE_
# variables. Rather than substantially reworking the qt3 build at this time,
# just hack it. We'll eventually bump LSB support and drop qt3 anyway.
CXX += "${LDFLAGS}"

do_configure() {
	if [ ! -L ${QMAKE_MKSPEC_PATH}/${TARGET_OS}-oe-g++ ]; then
		ln -sf ${QMAKE_MKSPEC_PATH}/linux-g++ ${QMAKE_MKSPEC_PATH}/${TARGET_OS}-oe-g++
	fi

	echo "yes" | ./configure -prefix ${prefix} ${QT_CONFIG_FLAGS} -no-fast \
		-L${STAGING_LIBDIR} -I${STAGING_INCDIR} -I${STAGING_INCDIR}/freetype2 -I${STAGING_INCDIR}/mysql

	# force regenerate
	rm -f src/qtmain.pro
	find . -name "Makefile"|xargs rm -f
	(cd src && ${OE_QMAKE_QMAKE} -spec ${QMAKESPEC} )
	(cd plugins/src && ${OE_QMAKE_QMAKE} -spec ${QMAKESPEC} )
	(cd tools && ${OE_QMAKE_QMAKE} -spec ${QMAKESPEC} )
	(cd tools/qvfb && ${OE_QMAKE_QMAKE} -spec ${QMAKESPEC} )
}

do_compile() {
	unset CFLAGS
	unset CXXFLAGS

	install -m 0755 ${OE_QMAKE_MOC} ${S}/bin/moc
	install -m 0755 ${OE_QMAKE_UIC} ${S}/bin/uic

	oe_runmake -C src ${EXTRA_ENV}
	oe_runmake -C plugins/src ${EXTRA_ENV}
	oe_runmake -C tools ${EXTRA_ENV}
}

do_install() {
	install -d ${D}${includedir}
	install -d ${D}${includedir}/qt3
	install -d ${D}${includedir}/qt3/private
	for f in include/*.h
	do
		install -m 0644 $f ${D}${includedir}/qt3
	done
	for f in include/private/*.h
	do
		install -m 0644 $f ${D}${includedir}/qt3/private
	done
	install -d ${D}${libdir}
	install -d ${D}${libdir}/qt3
	for f in lib/*.prl
	do
		install -m 0644 $f ${D}${libdir}/qt3
	done
	oe_libinstall -so -C lib libqt-mt ${D}${libdir}
	install -d ${D}${libdir}/qt3/plugins/
	cp -pPR plugins/imageformats plugins/sqldrivers plugins/designer ${D}${libdir}/qt3/plugins/

	# Avoid empty directory QA error
	rmdir ${D}${libdir}/qt3/plugins/sqldrivers 2>/dev/null || true
}

PACKAGES =+ " libqt-mt3 qt-x11-plugins-imageformats qt-x11-plugins-sqldrivers qt-x11-plugins-designer \
             qt-x11-designer qt-x11-assistant qt-x11-qvfb qt-x11-qtconfig"
FILES_libqt-mt3 = "${libdir}/libqt-mt.so.*"
FILES_${PN}-dev += "${libdir}/qt3/*.prl"
FILES_qt-x11-plugins-imageformats = "${libdir}/qt3/plugins/imageformats/*.so"
FILES_qt-x11-plugins-sqldrivers = "${libdir}/qt3/plugins/sqldrivers/*.so"
FILES_qt-x11-plugins-designer = "${libdir}/qt3/plugins/designer/*.so"
FILES_qt-x11-designer = "${bindir}/designer"
FILES_qt-x11-assistant = "${bindir}/assistant"
FILES_qt-x11-qtconfig = "${bindir}/qtconfig"
FILES_${PN}-dbg += "${libdir}/qt3/plugins/*/.debug"