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 BUILD_ARGS="${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}-debug = "1"
51 ALLOW_EMPTY_${PN}-test = "1"
55 bldcmd=${S}/autobuild/agl/autobuild
56 if [ ! -x "$bldcmd" ]; then
57 bbfatal "Missing autobuild/agl/autobuild script"
61 if ! $bldcmd package BUILD_DIR=${B} DEST=${B}/build-release ${AGLWGT_EXTRA_BUILD_ARGS}; then
62 bbwarn "Target: package failed"
65 mkdir -p ${S}/build-debug
67 if ! $bldcmd package-debug BUILD_DIR=${S}/build-debug DEST=${B}/build-debug ${AGLWGT_EXTRA_BUILD_ARGS}; then
68 bbwarn "Target: package-debug failed"
71 if echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then
72 mkdir -p ${S}/build-test
74 if ! $bldcmd package-test BUILD_DIR=${S}/build-test DEST=${B}/build-test ${AGLWGT_EXTRA_BUILD_ARGS}; then
75 bbwarn "Target: package-test 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"
87 d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
90 POST_INSTALL_LEVEL ?= "10"
91 POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
93 EXTRA_WGT_POSTINSTALL ?= ""
97 if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]; then
101 if [ "$(find ${B}/build-release -name '*.wgt' -maxdepth 1)" ]; then
102 install -d ${D}/usr/AGL/apps/$DEST
103 install -m 0644 ${B}/build-release/*.wgt ${D}/usr/AGL/apps/$DEST/
105 bbfatal "no package found in widget directory"
108 for t in test debug coverage; do
109 if [ "$(find ${B}/build-${t} -name *-${t}.wgt -maxdepth 1)" ]; then
110 install -d ${D}/usr/AGL/apps/${t}
111 install -m 0644 ${B}/build-${t}/*-${t}.wgt ${D}/usr/AGL/apps/${t}/
112 elif [ "${AGLWGT_PACKAGE_WARN}" = "true" ]; then
113 if [ "$t" != "test" -a "$t" != "coverage" ]; then
114 bbwarn "no package found in ${t} widget directory"
115 elif echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then
116 bbwarn "no package found in ${t} widget directory"
121 if [ "${AGLWGT_AUTOINSTALL_${PN}}" != "0" ]; then
122 # For now assume autoinstall of the release versions
123 rm -rf ${D}/usr/AGL/apps/autoinstall
124 ln -sf release ${D}/usr/AGL/apps/autoinstall
127 for file in ${D}/usr/AGL/apps/autoinstall/*.wgt; do
128 APP_FILES="${APP_FILES} $(basename $file)";
130 install -d ${D}/${sysconfdir}/agl-postinsts
131 cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <<EOF
133 for file in ${APP_FILES}; do
134 /usr/bin/afm-install install /usr/AGL/apps/autoinstall/\$file
137 ${EXTRA_WGT_POSTINSTALL}
139 chmod a+x ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}
146 addtask aglwgt_deploy before do_package after do_install
147 addtask aglwgt_package before do_aglwgt_deploy after do_compile
149 PACKAGES += "${PN}-test ${PN}-debug ${PN}-coverage"
152 /usr/AGL/apps/release/*.wgt \
153 /usr/AGL/apps/autoinstall \
154 /usr/AGL/apps/manualinstall \
155 ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} \
157 FILES_${PN}-test = "/usr/AGL/apps/test/*.wgt"
158 FILES_${PN}-debug = "/usr/AGL/apps/debug/*.wgt"
159 FILES_${PN}-coverage = "/usr/AGL/apps/coverage/*.wgt"
161 # Test widgets need the parent widget and the test framework
162 RDEPENDS_${PN}-test = "${PN} afb-test"
165 # These are default keys for development purposes !
166 # Change it for production.
167 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"
168 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"
170 export WGTPKG_AUTOSIGN_0
171 export WGTPKG_AUTOSIGN_1