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.
12 # 'wgtpkg-pack' in af-main-native is required.
13 DEPENDS_append = " af-main-native"
15 # for bindings af-binder is required.
16 DEPENDS_append = " af-binder"
18 # for bindings that use the cmake-apps-module
19 DEPENDS_append = " cmake-apps-module-native"
21 # for hal bindings genskel is required.
22 DEPENDS_append = " af-binder-devtools-native"
24 EXTRA_OECMAKE_append_agl-ptest = " -DBUILD_TEST_WGT=TRUE"
26 # FIXME: Remove once CMake+ninja issues are resolved
27 OECMAKE_GENERATOR = "Unix Makefiles"
31 mkdir -p ${S}/build-test
32 mkdir -p ${S}/build-debug
33 mkdir -p ${S}/build-coverage
36 ${S}/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${S}/widgets VERBOSE=TRUE || \
37 ( ${S}/conf.d/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B}/package VERBOSE=TRUE && \
38 ( bbwarn "OBSOLETE: Your autobuild script should be located in :" ; \
39 bbwarn "autobuild/agl/ from the project root source folder"; \
40 bbwarn "and generate a .wgt file using wgtpack in the build"; \
41 bbwarn "root folder calling:" ; \
42 bbwarn "./autobuild/agl/autobuild package DEST=<BUILDDIR>" ; \
43 bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes" \
46 ( bbwarn "OBSOLETE: You must have an autobuild script located in:" ; \
47 bbwarn "autobuild/agl/ from the project root source folder"; \
48 bbwarn "with filename autobuild which should generate"; \
49 bbwarn "a .wgt file using wgtpack in the build"; \
50 bbwarn "root folder calling:" ; \
51 bbwarn "./autobuild/agl/autobuild package DEST=<BUILDDIR>" ; \
52 bbwarn "Fix your package as it will not work within the SDK" ; \
53 bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes"; \
57 ${S}/autobuild/agl/autobuild package-test BUILD_DIR=${S}/build-test DEST=${S}/widgets VERBOSE=TRUE || \
58 ( bbwarn "Target: package-test failed")
61 ${S}/autobuild/agl/autobuild package-debug BUILD_DIR=${S}/build-debug DEST=${S}/widgets VERBOSE=TRUE || \
62 ( bbwarn "Target: package-debug failed")
64 cd ${S}/build-coverage
65 ${S}/autobuild/agl/autobuild package-coverage BUILD_DIR=${S}/build-coverage DEST=${S}/widgets VERBOSE=TRUE || \
66 ( bbwarn "Target: package-coverage failed")
70 d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
74 POST_INSTALL_LEVEL ?= "10"
75 POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
77 EXTRA_WGT_POSTINSTALL ?= ""
81 DEBUG_WGT="*-debug.wgt"
82 COVERAGE_WGT="*-coverage.wgt"
83 if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]
85 install -d ${D}/usr/AGL/apps/manualinstall
86 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/manualinstall || \
87 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/manualinstall
89 install -d ${D}/usr/AGL/apps/autoinstall
90 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/autoinstall || \
91 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/autoinstall
93 install -m 0644 ${S}/widgets/*.wgt ${D}/usr/AGL/apps/autoinstall || \
94 ( bbwarn "no package found in widget directory")
96 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${TEST_WGT})" ]
98 install -d ${D}/usr/AGL/apps/testwgt
99 mv ${D}/usr/AGL/apps/autoinstall/*-test.wgt ${D}/usr/AGL/apps/testwgt
102 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${DEBUG_WGT})" ]
104 install -d ${D}/usr/AGL/apps/debugwgt
105 mv ${D}/usr/AGL/apps/autoinstall/*-debug.wgt ${D}/usr/AGL/apps/debugwgt
108 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${COVERAGE_WGT})" ]
110 install -d ${D}/usr/AGL/apps/coveragewgt
111 mv ${D}/usr/AGL/apps/autoinstall/*-coverage.wgt ${D}/usr/AGL/apps/coveragewgt
117 for file in ${D}/usr/AGL/apps/autoinstall/*.wgt;do
118 APP_FILES="${APP_FILES} $(basename $file)";
120 install -d ${D}/${sysconfdir}/agl-postinsts
121 cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <<EOF
123 for file in ${APP_FILES}; do
124 /usr/bin/afm-install install /usr/AGL/apps/autoinstall/\$file
127 ${EXTRA_WGT_POSTINSTALL}
129 chmod a+x ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}
132 FILES_${PN} += "/usr/AGL/apps/autoinstall/*.wgt \
133 /usr/AGL/apps/manualinstall/*.wgt \
134 /usr/AGL/apps/testwgt/*.wgt \
135 /usr/AGL/apps/debugwgt/*.wgt \
136 /usr/AGL/apps/coveragewgt/*.wgt \
137 ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} \
143 addtask aglwgt_deploy before do_package after do_install
144 addtask aglwgt_package before do_aglwgt_deploy after do_compile