4 # Jan-Simon Moeller, jsmoeller@linuxfoundation.org
6 # This class expects a "make package" target in the makefile
7 # which creates the wgt files in the package/ subfolder.
8 # The makefile needs to use wgtpkg-pack.
11 # 'wgtpkg-pack' in af-main-native is required.
12 DEPENDS_append = " af-main-native"
14 # for bindings af-binder is required.
15 DEPENDS_append = " af-binder"
17 # for bindings that use the cmake-apps-module
18 DEPENDS_append = " cmake-apps-module-native"
20 # for hal bindings genskel is required.
21 DEPENDS_append = " af-binder-devtools-native"
23 # Set the default build type for cmake based projects
24 # NOTE: This can be removed after switching to using the autobuild
25 # script to do compilation
26 EXTRA_OECMAKE_append = " -DCMAKE_BUILD_TYPE=RELEASE"
28 # FIXME: Remove once CMake+ninja issues are resolved
29 OECMAKE_GENERATOR = "Unix Makefiles"
31 AGLWGT_EXTRA_BUILD_ARGS = "VERBOSE=TRUE ${PARALLEL_MAKE}"
33 # Only widgets with recipe names starting with agl-service- are
34 # assumed to have tests by default, set this to "true" to force
35 # building/packaging of the test widget for other widgets.
36 AGLWGT_HAVE_TESTS = "false"
38 # Warning on missing test/debug/coverage packages disabled by default
39 # for now to reduce build output clutter.
40 AGLWGT_PACKAGE_WARN = "false"
42 # There are some widgets with build issues wrt test/debug/coverage
43 # that are currently non-fatal but do not yield a widget, allow empty
44 # test and coverage packages for now to allow the build to proceed.
45 # This matches the default behavior for -dbg packages.
47 # NOTE: This should revisited after a round of autobuild script rework
48 # to address SPEC-3300.
49 ALLOW_EMPTY_${PN}-coverage = "1"
50 ALLOW_EMPTY_${PN}-test = "1"
54 bldcmd=${S}/autobuild/agl/autobuild
55 if [ ! -x "$bldcmd" ]; then
56 bbfatal "Missing autobuild/agl/autobuild script"
60 if ! $bldcmd package BUILD_DIR=${B} DEST=${B}/build-release ${AGLWGT_EXTRA_BUILD_ARGS}; then
61 bbwarn "Target: package failed"
64 if echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then
65 mkdir -p ${S}/build-test
67 if ! $bldcmd package-test BUILD_DIR=${S}/build-test DEST=${B}/build-test ${AGLWGT_EXTRA_BUILD_ARGS}; then
68 bbwarn "Target: package-test failed"
72 mkdir -p ${S}/build-debug
74 if ! $bldcmd package-debug BUILD_DIR=${S}/build-debug DEST=${B}/build-debug ${AGLWGT_EXTRA_BUILD_ARGS}; then
75 bbwarn "Target: package-debug failed"
78 mkdir -p ${S}/build-coverage
79 cd ${S}/build-coverage
80 if ! $bldcmd package-coverage BUILD_DIR=${S}/build-coverage DEST=${B}/build-coverage ${AGLWGT_EXTRA_BUILD_ARGS}; then
81 bbwarn "Target: package-coverage failed"
86 d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
89 POST_INSTALL_LEVEL ?= "10"
90 POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
92 EXTRA_WGT_POSTINSTALL ?= ""
96 if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]; then
100 if [ "$(find ${B}/build-release -name '*.wgt')" ]; then
101 install -d ${D}/usr/AGL/apps/$DEST
102 install -m 0644 ${B}/build-release/*.wgt ${D}/usr/AGL/apps/$DEST/
104 bberror "no package found in widget directory"
107 for t in test debug coverage; do
108 if [ "$(find ${B}/build-${t} -name *-${t}.wgt)" ]; then
109 install -d ${D}/usr/AGL/apps/${t}
110 install -m 0644 ${B}/build-${t}/*-${t}.wgt ${D}/usr/AGL/apps/${t}/
111 elif [ "${AGLWGT_PACKAGE_WARN}" = "true" ]; then
112 if [ "$t" != "test" ]; then
113 bbwarn "no package found in ${t} widget directory"
114 elif echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then
115 bbwarn "no package found in ${t} widget directory"
120 if [ "${AGLWGT_AUTOINSTALL_${PN}}" != "0" ]; then
121 # For now assume autoinstall of the release versions
122 rm -rf ${D}/usr/AGL/apps/autoinstall
123 ln -sf release ${D}/usr/AGL/apps/autoinstall
126 for file in ${D}/usr/AGL/apps/autoinstall/*.wgt; do
127 APP_FILES="${APP_FILES} $(basename $file)";
129 install -d ${D}/${sysconfdir}/agl-postinsts
130 cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <<EOF
132 for file in ${APP_FILES}; do
133 /usr/bin/afm-install install /usr/AGL/apps/autoinstall/\$file
136 ${EXTRA_WGT_POSTINSTALL}
138 chmod a+x ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}
145 addtask aglwgt_deploy before do_package after do_install
146 addtask aglwgt_package before do_aglwgt_deploy after do_compile
148 PACKAGES += "${PN}-test ${PN}-coverage"
151 /usr/AGL/apps/release/*.wgt \
152 /usr/AGL/apps/autoinstall \
153 /usr/AGL/apps/manualinstall \
154 ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} \
156 FILES_${PN}-test = "/usr/AGL/apps/test/*.wgt"
157 FILES_${PN}-dbg = "/usr/AGL/apps/debug/*.wgt"
158 FILES_${PN}-coverage = "/usr/AGL/apps/coverage/*.wgt"
160 # Test widgets need the base widget
161 RDEPENDS_${PN}-test = "${PN}"
164 # These are default keys for development purposes !
165 # Change it for production.
166 WGTPKG_AUTOSIGN_0_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/developer.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/developer.cert.pem"
167 WGTPKG_AUTOSIGN_1_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/platform.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/platform.cert.pem"
169 export WGTPKG_AUTOSIGN_0
170 export WGTPKG_AUTOSIGN_1