diff options
Diffstat (limited to 'meta-application-manager/recipes-examples')
10 files changed, 274 insertions, 0 deletions
diff --git a/meta-application-manager/recipes-examples/amhelloworld/amhelloworld-extraconf.inc b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld-extraconf.inc new file mode 100644 index 0000000..139597f --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld-extraconf.inc @@ -0,0 +1,2 @@ + + diff --git a/meta-application-manager/recipes-examples/amhelloworld/amhelloworld.inc b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld.inc new file mode 100644 index 0000000..9a1f8c9 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld.inc @@ -0,0 +1,96 @@ +DESCRIPTION = "APP-CORE example app" +HOMEPAGE = "https://wiki.tizen.org/wiki/IVI/Tizen-Core-development-EFL" +SECTION = "Application Framework/Libraries" +LICENSE = "Apache-2.0" +PV = "1.0" + +SRC_URI = "" + +S = "${WORKDIR}" + +inherit autotools-brokensep + +BBCLASSEXTEND = "" +PROVIDES = "" + + +RDEPENDS = "" + +inherit tizen_cmake +DEPENDS += "app-core app-core-efl-dev" +inherit pkgconfig +DEPENDS += "ecore" +DEPENDS += "elementary" + +do_prep() { + cd ${S} + chmod -Rf a+rX,u+w,g-w,o-w ${S} + #setup -q + #cp ${S}/packaging/ail.manifest . +} + +do_patch_append() { + bb.build.exec_func('do_prep', d) +} + +do_configure() { +} + +do_compile() { + cd ${S} + LANG=C + export LANG + unset DISPLAY + LD_AS_NEEDED=1; export LD_AS_NEEDED ; + + CFLAGS="$CFLAGS -fpic" + + cmake \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \ + -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \ + -DLIB_INSTALL_DIR:PATH=${prefix}/lib \ + -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \ + -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \ + ${EXTRA_OECMAKE} . \ + -DBUILD_PKGTYPE=deb + + oe_runmake ${PARALLEL_MAKE} +} + +do_install() { + export RPM_BUILD_ROOT=${D} + cd ${S} + LANG=C + export LANG + unset DISPLAY + rm -rf ${D} + mkdir -p ${D} + + oe_runmake \ + DESTDIR=${D} \ + INSTALL_ROOT=${D} \ + BINDIR=${prefix}/bin \ + install + #rm -f ${D}${infodir}/dir + find ${D} -regex ".*\.la$" | xargs rm -f -- + find ${D} -regex ".*\.a$" | xargs rm -f -- +} + +amhelloworld_files = "" +amhelloworld_files += "${prefix}/packages/org.tizen.amhelloworld.xml" +amhelloworld_files += "${prefix}/share/packages/org.tizen.amhelloworld.xml" +amhelloworld_files += "${prefix}/bin/amhelloworld" +MANIFESTFILES_${PN} = "org.tizen.amhelloworld.manifest" + + +FILES_${PN} = "${amhelloworld_files}" + +PKG_aul= "amhelloworld" + +require amhelloworld-extraconf.inc + diff --git a/meta-application-manager/recipes-examples/amhelloworld/amhelloworld_1.0.bb b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld_1.0.bb new file mode 100644 index 0000000..6fd0107 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/amhelloworld_1.0.bb @@ -0,0 +1,15 @@ +require amhelloworld.inc + +PRIORITY = "10" + +LIC_FILES_CHKSUM ??= "file://README;md5=d41d8cd98f00b204e9800998ecf8427e" + +SRC_URI += "file://amhelloworld.h \ + file://amhelloworld.c \ + file://org.tizen.amhelloworld.manifest \ + file://org.tizen.amhelloworld.spec \ + file://org.tizen.amhelloworld.xml \ + file://README \ + file://CMakeLists.txt \ + " + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt b/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt new file mode 100644 index 0000000..affd644 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt @@ -0,0 +1,46 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(amhelloworld C) +SET(VERSION_MAJOR 1) +SET(VERSION "${VERSION_MAJOR}.0.0") + + +ADD_DEFINITIONS("-DINSTALL_DIR_APPS=\"${INSTALL_DIR_APPS}\"") + +ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"") +ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") + + +INCLUDE(FindPkgConfig) +SET(AMHELLOWORLD-1_PKG_CHECK_MODULES aul appcore-efl appcore-common) +pkg_check_modules(pkgs REQUIRED ${AMHELLOWORLD-1_PKG_CHECK_MODULES} ) + + +pkg_check_modules(libpkgs REQUIRED appcore-efl appcore-common) + +FOREACH(flag ${libpkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(TEST_CFLAGS "${TEST_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" ) +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpic") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_CFLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_C_FLAGS_RELEASE "-O2") + +ADD_EXECUTABLE(${PROJECT_NAME} + amhelloworld.c) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie" ${LIB_M}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) + +# desktop icon +set(PREFIX ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/org.tizen.amhelloworld.xml DESTINATION /usr/share/packages) + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/README b/meta-application-manager/recipes-examples/amhelloworld/files/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/README diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c new file mode 100644 index 0000000..d473c37 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c @@ -0,0 +1,55 @@ +// taken from https://wiki.tizen.org/wiki/IVI/Tizen-Core-development-EFL + +#include <stdio.h> + +#include <appcore-efl.h> +#include "amhelloworld.h" + + +static int app_create(void *data) { + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + appcore_measure_start(); + return 0; +} + +static int app_terminate(void *data) { // terminate callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + return 0; +} + +static int app_pause(void *data) { // pause callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + return 0; +} + +static int app_resume(void *data) { // resume callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + return 0; +} + +static int app_reset(bundle *b, void *data) { // reset callback + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + printf("from create to %s(): %d msec\n", __func__,appcore_measure_time()); + + return 0; +} + +int main(int argc, char *argv[]) { + struct appcore_ops ops = { // fill the appcore_ops with callback functions + .create = app_create, + .terminate = app_terminate, + .pause = app_pause, + .resume = app_resume, + .reset = app_reset, + }; + + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + return appcore_efl_main(PACKAGE, &argc, &argv, &ops); // start mainloop +} + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h new file mode 100644 index 0000000..9d53d35 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h @@ -0,0 +1,12 @@ +// taken from https://wiki.tizen.org/wiki/IVI/Tizen-Core-development-EFL +#ifndef __AMHELLOWORLD_H__ +#define __AMHELLOWORLD_H__ + +#include <Elementary.h> + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.amhelloworld" // for appcore_set_i18n() +#endif + +#endif // __AMHELLOWORLD_H__ + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest new file mode 100644 index 0000000..a5a5d94 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest @@ -0,0 +1,20 @@ +<manifest> + + <define> + + <domain name="org.tizen.amhelloworld" /> + + </define> + <assign> + + <filesystem path="/usr/share/applications/org.tizen.amhelloworld.desktop" label="_" /> + + </assign> + <request> + + <domain name="org.tizen.amhelloworld" /> + + </request> + +</manifest> + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec new file mode 100644 index 0000000..4149875 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec @@ -0,0 +1,13 @@ +%install + +rm -rf %{buildroot} +%make_install + +%files +%manifest org.tizen.amhelloworld.manifest + +%defattr(-,root,root,-) +%attr(-,inhouse,inhouse) +/usr/apps/org.tizen.amhelloworld/bin/amhelloworld +/usr/share/packages/org.tizen.amhelloworld.xml + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml new file mode 100644 index 0000000..2a61369 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> + +<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.amhelloworld" version="0.0.1" install-location="internal-only"> + + <label>AMHelloWorld</label> + <description>AMHelloWorld</description> + <ui-application appid="org.tizen.amhelloworld" exec="/usr/apps/org.tizen.amhelloworld/bin/amhelloworld" nodisplay="false" multiple="false" type="capp" taskmanage="true"> + + <label>AMHelloWorld</label> + <label xml:lang="en-us">AMHelloWorld</label> + + </ui-application> + +</manifest> + |