Fix qml-radio-plugin compilation with security flags
[AGL/meta-agl-demo.git] / recipes-qt / qml-radio-plugin / qml-radio-plugin_0.2.bb
1 SUMMARY = "AM/FM Radio QML plugin (for RTL2832U hardware)"
2 DESCRIPTION = "This provides a simple QML plugin able to detect and use \
3 radio hardware, most notably RTL2832U chipsets (although it can easily \
4 be extended). Among other things, it provides generic APIs to display \
5 status, switch between AM/FM mode, choose frequency, mute sound..."
6 HOMEPAGE = "https://github.com/iotbzh/qml_radio_plugin"
7
8 LICENSE = "GPLv2+"
9 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
10                     file://qml_radio.cpp;endline=16;md5=10a65c128e3a6cff2a61bb38556ceb04"
11
12 DEPENDS = "qtbase-native qtdeclarative rtl-sdr pulseaudio alsa-lib"
13 RDEPENDS_${PN}-examples = "qtdeclarative-tools qtquickcontrols-qmlplugins"
14
15 SRC_URI = "git://github.com/iotbzh/qml_radio_plugin"
16 SRCREV = "36e6bbaaa6637abab344d38d8a0c4794fa42fb03"
17 S = "${WORKDIR}/git"
18
19 inherit autotools pkgconfig
20
21 EXTRA_OECONF = "--with-moc-dir=${STAGING_BINDIR_NATIVE}/qt5"
22
23 QML_LIBDIR = "${libdir}/qt5/qml"
24
25 do_configure_append() {
26      # when building with "security_flags.inc", libtool thinks that
27      # "-pie" means we want an executable, and links with related C
28      # runtime objects. Work around this until libtool is fixed.
29      sed -i 's/".\+Scrt1.o/"/g' ${B}/*libtool
30      sed -i 's/ .\+Scrt1.o/ /g' ${B}/*libtool
31      sed -i 's/-lgcc / /g' ${B}/*libtool
32      sed -i 's/-lgcc"/"/g' ${B}/*libtool
33 }
34
35 do_install_append() {
36      # Remove .la files for loadable module
37      rm -f ${D}/${QML_LIBDIR}/radio/*.la
38      # Install QML example
39      install -d ${D}/${datadir}/qt5/examples/radio
40      install -m 0644 ${S}/radio.qml ${D}/${datadir}/qt5/examples/radio
41 }
42
43 PACKAGES += "${PN}-examples"
44
45 FILES_${PN} += "${QML_LIBDIR}/radio/*.so ${QML_LIBDIR}/radio/qmldir"
46 FILES_${PN}-dbg += "${QML_LIBDIR}/radio/.debug"
47 FILES_${PN}-examples += "${datadir}"