From 9e1d98d3d09a4e430651067ae755ca350e71c251 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Mon, 14 Mar 2016 12:05:47 +0900 Subject: Restore gbs build ABS build system is far from being ready and it doesn't look like it will be ready in near future. To support submission into Tizen images the previous build system must have been restored. From now on two build system must be supported. Change-Id: I1dc4712104086c4bd331edcb6ab2d3cb55be99fa --- CMake/CMakeLists.txt | 69 ++++++++++++++++++++++++++++++ CMake/res/CMakeLists.txt | 8 ++++ CMake/res/edje/CMakeLists.txt | 23 ++++++++++ CMake/res/po/CMakeLists.txt | 26 ++++++++++++ org.tizen.share-panel.manifest | 5 +++ org.tizen.share-panel.xml | 16 +++++++ packaging/org.tizen.share-panel.spec | 81 ++++++++++++++++++++++++++++++++++++ src/share_panel.c | 2 +- src/utils.c | 13 ++++++ 9 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 CMake/CMakeLists.txt create mode 100644 CMake/res/CMakeLists.txt create mode 100644 CMake/res/edje/CMakeLists.txt create mode 100755 CMake/res/po/CMakeLists.txt create mode 100644 org.tizen.share-panel.manifest create mode 100644 org.tizen.share-panel.xml create mode 100755 packaging/org.tizen.share-panel.spec diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt new file mode 100644 index 0000000..4c73bc7 --- /dev/null +++ b/CMake/CMakeLists.txt @@ -0,0 +1,69 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(share-panel C) + +SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin") +SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res") +SET(INSTALL_IMAGEDIR "${INSTALL_RESDIR}/images") +SET(EDJEDIR "${INSTALL_RESDIR}/edje") +SET(LOCALEDIR "${INSTALL_RESDIR}/locale") +SET(CMAKE_VERBOSE_MAKEFILE 0) + +SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}/..") +SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res") +SET(PROJECT_EDC_DIR "${PROJECT_RESOURCES_DIR}/edje") +SET(PROJECT_IMAGES_DIR "${PROJECT_RESOURCES_DIR}/images") +SET(PROJECT_PO_DIR "${PROJECT_RESOURCES_DIR}/po") + +INCLUDE(FindPkgConfig) +pkg_check_modules(MENU_PKGS REQUIRED + aul + capi-appfw-application + capi-appfw-app-manager + capi-system-system-settings + capi-base-common + capi-content-mime-type + capi-ui-efl-util + dlog + elementary + evas + feedback + isf + notification + efl-extension +) + +ADD_DEFINITIONS("-DINSTALL_RESDIR=\"${INSTALL_RESDIR}\"") + +FOREACH (flag ${MENU_PKGS_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIC") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") + +INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc) + +ADD_EXECUTABLE(${PROJECT_NAME} + ${PROJECT_ROOT_DIR}/src/index.c + ${PROJECT_ROOT_DIR}/src/grid.c + ${PROJECT_ROOT_DIR}/src/ui_manager.c + ${PROJECT_ROOT_DIR}/src/list.c + ${PROJECT_ROOT_DIR}/src/page.c + ${PROJECT_ROOT_DIR}/src/scroller.c + ${PROJECT_ROOT_DIR}/src/share_panel.c + ${PROJECT_ROOT_DIR}/src/utils.c +) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MENU_PKGS_LDFLAGS}) + +# Install +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX}) + +INSTALL(FILES ${PROJECT_ROOT_DIR}/org.tizen.share-panel.xml DESTINATION ${SYS_PACKAGES_DIR}) +INSTALL(DIRECTORY DESTINATION ${PREFIX}/data) +INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/share-panel.png DESTINATION ${SYS_ICONS_DIR}) + +# End of a file +ADD_SUBDIRECTORY(res) diff --git a/CMake/res/CMakeLists.txt b/CMake/res/CMakeLists.txt new file mode 100644 index 0000000..6d73268 --- /dev/null +++ b/CMake/res/CMakeLists.txt @@ -0,0 +1,8 @@ +ADD_SUBDIRECTORY(edje) +ADD_SUBDIRECTORY(po) + +INSTALL(FILES + ${PROJECT_RESOURCES_DIR}/A01-1_icon_Menu.png +DESTINATION + ${INSTALL_IMAGEDIR} +) diff --git a/CMake/res/edje/CMakeLists.txt b/CMake/res/edje/CMakeLists.txt new file mode 100644 index 0000000..e8e3c4d --- /dev/null +++ b/CMake/res/edje/CMakeLists.txt @@ -0,0 +1,23 @@ +ADD_CUSTOM_TARGET(item.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/item.edc item.edj + DEPENDS ${PROJECT_EDC_DIR}/item.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} item.edj) +INSTALL(FILES item.edj DESTINATION ${EDJEDIR}) + +ADD_CUSTOM_TARGET(layout.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/layout.edc layout.edj + DEPENDS ${PROJECT_EDC_DIR}/layout.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} layout.edj) +INSTALL(FILES layout.edj DESTINATION ${EDJEDIR}) + +ADD_CUSTOM_TARGET(page.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/page.edc page.edj + DEPENDS ${PROJECT_EDC_DIR}/page.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} page.edj) +INSTALL(FILES page.edj DESTINATION ${EDJEDIR}) diff --git a/CMake/res/po/CMakeLists.txt b/CMake/res/po/CMakeLists.txt new file mode 100755 index 0000000..1ac0fc9 --- /dev/null +++ b/CMake/res/po/CMakeLists.txt @@ -0,0 +1,26 @@ +# for i18n + +SET(POFILES ar.po az.po bg.po ca.po cs.po da.po de.po el_GR.po en_PH.po en.po en_US.po + es_ES.po es_US.po et.po eu.po fi.po fr_CA.po fr.po ga.po gl.po hi.po hr.po + hu.po hy.po is.po it_IT.po ja_JP.po ka.po kk.po ko_KR.po lt.po lv.po mk.po + nb.po nl.po pl.po pt_BR.po pt_PT.po ro.po ru_RU.po sk.po sl.po sr.po sv.po + tr_TR.po uk.po uz.po zh_CN.po zh_HK.po zh_TW.po) +SET(MSGFMT "/usr/bin/msgfmt") + +MESSAGE(STATUS "po files ---") +FOREACH(pofile ${POFILES}) + SET(pofile ${PROJECT_PO_DIR}/${pofile}) + MESSAGE(STATUS " ${pofile}") + GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE) + SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND( + OUTPUT ${moFile} + COMMAND ${MSGFMT} -o ${moFile} ${absPofile} + DEPENDS ${absPofile} + ) + INSTALL(FILES ${moFile} DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) diff --git a/org.tizen.share-panel.manifest b/org.tizen.share-panel.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/org.tizen.share-panel.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/org.tizen.share-panel.xml b/org.tizen.share-panel.xml new file mode 100644 index 0000000..cd333b5 --- /dev/null +++ b/org.tizen.share-panel.xml @@ -0,0 +1,16 @@ + + + + Jin Yoon + Moonkyoung Park + SHARE PANEL APPLICATION + + + + + + http://tizen.org/privilege/packagemanager.info + http://tizen.org/privilege/appmanager.launch + + + diff --git a/packaging/org.tizen.share-panel.spec b/packaging/org.tizen.share-panel.spec new file mode 100755 index 0000000..0c7062d --- /dev/null +++ b/packaging/org.tizen.share-panel.spec @@ -0,0 +1,81 @@ +Name: org.tizen.share-panel +Summary: Share Panel +Version: 0.1.0 +Release: 0 +Group: Applications/Core Applications +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz + +%if "%{?tizen_profile_name}" == "wearable" +ExcludeArch: %{arm} %ix86 x86_64 +%endif + +%if "%{?tizen_profile_name}" == "tv" +ExcludeArch: %{arm} %ix86 x86_64 +%endif + +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-tools + +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(aul) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-system-system-settings) +BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(capi-content-mime-type) +BuildRequires: pkgconfig(capi-ui-efl-util) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(efl-extension) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(feedback) +BuildRequires: pkgconfig(isf) +BuildRequires: pkgconfig(notification) +BuildRequires: pkgconfig(libtzplatform-config) + +%description +Description: Share Panel + +%prep +%setup -q + +%build +%define _pkg_dir %{TZ_SYS_RO_APP}/%{name} +%define _pkg_shared_dir %{_pkg_dir}/shared +%define _pkg_data_dir %{_pkg_dir}/data +%define _sys_icons_dir %{_pkg_shared_dir}/res +%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES} +%define _sys_license_dir %{TZ_SYS_SHARE}/license + +cd CMake +cmake . -DINSTALL_PREFIX=%{_pkg_dir} \ + -DSYS_ICONS_DIR=%{_sys_icons_dir} \ + -DSYS_PACKAGES_DIR=%{_sys_packages_dir} +make %{?jobs:-j%jobs} +cd - + +%install +cd CMake +%make_install +cd - + +%define tizen_sign 1 +%define tizen_sign_base %{_pkg_dir} +%define tizen_sign_level public +%define tizen_author_sign 1 +%define tizen_dist_sign 1 +%find_lang share-panel + +%files -f share-panel.lang +%manifest %{name}.manifest +%{_pkg_dir}/bin/share-panel +%{_pkg_dir}/res/edje/*.edj +%{_pkg_dir}/res/images/*.png +%{_sys_packages_dir}/%{name}.xml +%{_sys_icons_dir}/share-panel.png + + diff --git a/src/share_panel.c b/src/share_panel.c index ac7aa12..a4ff383 100644 --- a/src/share_panel.c +++ b/src/share_panel.c @@ -297,7 +297,7 @@ static void _language_changed(app_event_info_h event_info, void *data) } -int main(int argc, char **argv) +EAPI int main(int argc, char **argv) { int ret; ui_app_lifecycle_callback_s lifecycle_callback = {0, }; diff --git a/src/utils.c b/src/utils.c index e1a810a..48cae7e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -24,6 +24,18 @@ char *utils_get_res_file_path(char *sub_path) { +/* Fix for support for global and user installation + * In case of global installation resoureces should be fetched from + * predefined directory + * + * In case of multi-user installation resources shoudl be fetched using + * app_get_resource_path API. + */ +#ifdef INSTALL_RESDIR + char buf[1024]; + snprintf(buf, sizeof(buf), "%s/%s", INSTALL_RESDIR, sub_path); + return strdup(buf); +#else char *res_path = app_get_resource_path(); if(!res_path) return NULL; @@ -41,4 +53,5 @@ char *utils_get_res_file_path(char *sub_path) free(res_path); return absolute_path; +#endif } -- cgit v1.2.3