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
35 bldcmd=${S}/autobuild/agl/autobuild
36 if [ ! -x "$bldcmd" ]; then
37 bldcmd=${S}/conf.d/autobuild/agl/autobuild
38 if [ -x "$bldcmd" ]; then
39 bbwarn "OBSOLETE: Your autobuild script should be located in :"
40 bbwarn "autobuild/agl/ from the project root source folder"
41 bbwarn "and generate a .wgt file using wgtpack in the build"
42 bbwarn "root folder calling:"
43 bbwarn "./autobuild/agl/autobuild package DEST=<BUILDDIR>"
44 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"
59 if ! $bldcmd package BUILD_DIR=${B} DEST=${S}/widgets VERBOSE=TRUE; then
60 bbwarn "Target: package failed"
64 if ! $bldcmd package-test BUILD_DIR=${S}/build-test DEST=${S}/widgets VERBOSE=TRUE; then
65 bbwarn "Target: package-test failed"
69 if ! $bldcmd package-debug BUILD_DIR=${S}/build-debug DEST=${S}/widgets VERBOSE=TRUE; then
70 bbwarn "Target: package-debug failed"
73 cd ${S}/build-coverage
74 if ! $bldcmd package-coverage BUILD_DIR=${S}/build-coverage DEST=${S}/widgets VERBOSE=TRUE; then
75 bbwarn "Target: package-coverage failed"
80 d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
84 POST_INSTALL_LEVEL ?= "10"
85 POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
87 EXTRA_WGT_POSTINSTALL ?= ""
91 DEBUG_WGT="*-debug.wgt"
92 COVERAGE_WGT="*-coverage.wgt"
93 if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]
95 install -d ${D}/usr/AGL/apps/manualinstall
96 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/manualinstall || \
97 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/manualinstall
99 install -d ${D}/usr/AGL/apps/autoinstall
100 install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/autoinstall || \
101 install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/autoinstall
103 install -m 0644 ${S}/widgets/*.wgt ${D}/usr/AGL/apps/autoinstall || \
104 ( bbwarn "no package found in widget directory")
106 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${TEST_WGT})" ]
108 install -d ${D}/usr/AGL/apps/testwgt
109 mv ${D}/usr/AGL/apps/autoinstall/*-test.wgt ${D}/usr/AGL/apps/testwgt
112 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${DEBUG_WGT})" ]
114 install -d ${D}/usr/AGL/apps/debugwgt
115 mv ${D}/usr/AGL/apps/autoinstall/*-debug.wgt ${D}/usr/AGL/apps/debugwgt
118 if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${COVERAGE_WGT})" ]
120 install -d ${D}/usr/AGL/apps/coveragewgt
121 mv ${D}/usr/AGL/apps/autoinstall/*-coverage.wgt ${D}/usr/AGL/apps/coveragewgt
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}
142 FILES_${PN} += "/usr/AGL/apps/autoinstall/*.wgt \
143 /usr/AGL/apps/manualinstall/*.wgt \
144 /usr/AGL/apps/testwgt/*.wgt \
145 /usr/AGL/apps/debugwgt/*.wgt \
146 /usr/AGL/apps/coveragewgt/*.wgt \
147 ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} \
153 addtask aglwgt_deploy before do_package after do_install
154 addtask aglwgt_package before do_aglwgt_deploy after do_compile
157 # These are default keys for development purposes !
158 # Change it for production.
159 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"
160 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"
162 export WGTPKG_AUTOSIGN_0
163 export WGTPKG_AUTOSIGN_1