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"; \
58 ${S}/autobuild/agl/autobuild package-test BUILD_DIR=${S}/build-test DEST=${S}/widgets VERBOSE=TRUE || \
59 ( bbwarn "Target: package-test failed")
62 pushd ${S}/build-debug
63 ${S}/autobuild/agl/autobuild package-debug BUILD_DIR=${S}/build-debug DEST=${S}/widgets VERBOSE=TRUE || \
64 ( bbwarn "Target: package-debug failed")
67 pushd ${S}/build-coverage
68 ${S}/autobuild/agl/autobuild package-coverage BUILD_DIR=${S}/build-coverage DEST=${S}/widgets VERBOSE=TRUE || \
69 ( bbwarn "Target: package-coverage failed")
74 d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
78 POST_INSTALL_LEVEL ?= "10"
79 POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
81 EXTRA_WGT_POSTINSTALL ?= ""
85 DEBUG_WGT="*-debug.wgt"
86 COVERAGE_WGT="*-coverage.wgt"
87 if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]
89 install -d ${D}/usr/AGL/apps/manualinstall
90 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/manualinstall || \
91 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/manualinstall
93 install -d ${D}/usr/AGL/apps/autoinstall
94 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/autoinstall || \
95 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/autoinstall
97 install -m 0644 ${S}/widgets/*.wgt ${D}/usr/AGL/apps/autoinstall || \
98 ( bbwarn "no package found in widget directory")
100 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${TEST_WGT})" ]
102 install -d ${D}/usr/AGL/apps/testwgt
103 mv ${D}/usr/AGL/apps/autoinstall/*-test.wgt ${D}/usr/AGL/apps/testwgt
106 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${DEBUG_WGT})" ]
108 install -d ${D}/usr/AGL/apps/debugwgt
109 mv ${D}/usr/AGL/apps/autoinstall/*-debug.wgt ${D}/usr/AGL/apps/debugwgt
112 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${COVERAGE_WGT})" ]
114 install -d ${D}/usr/AGL/apps/coveragewgt
115 mv ${D}/usr/AGL/apps/autoinstall/*-coverage.wgt ${D}/usr/AGL/apps/coveragewgt
121 for file in ${D}/usr/AGL/apps/autoinstall/*.wgt;do
122 APP_FILES="${APP_FILES} $(basename $file)";
124 install -d ${D}/${sysconfdir}/agl-postinsts
125 cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <<EOF
127 for file in ${APP_FILES}; do
128 /usr/bin/afm-install install /usr/AGL/apps/autoinstall/\$file
131 ${EXTRA_WGT_POSTINSTALL}
133 chmod a+x ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}
136 FILES_${PN} += "/usr/AGL/apps/autoinstall/*.wgt \
137 /usr/AGL/apps/manualinstall/*.wgt \
138 /usr/AGL/apps/testwgt/*.wgt \
139 /usr/AGL/apps/debugwgt/*.wgt \
140 /usr/AGL/apps/coveragewgt/*.wgt \
141 ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} \
147 addtask aglwgt_deploy before do_package after do_install
148 addtask aglwgt_package before do_aglwgt_deploy after do_compile