From 8bc1d1a99ea538f17928531c2ee84d4f3de34b64 Mon Sep 17 00:00:00 2001 From: Prachi Kumar Date: Wed, 12 Sep 2018 18:01:59 +0530 Subject: Added gbs build support Change-Id: Iabf2ce67f23972f382d1311721da4f24b3750ef6 Signed-off-by: Prachi Kumar --- .cproject | 3 +- CMakeLists.txt | 98 +++++++++++++++++++++++++++++ inc/watch-face-editor.h | 1 - org.tizen.watch-face-editor.manifest | 5 ++ org.tizen.watch-face-editor.xml.in | 13 ++++ packaging/org.tizen.watch-face-editor.spec | 66 +++++++++++++++++++ shared/res/org.tizen.watch-face-editor.png | Bin 0 -> 4605 bytes shared/res/watch-face-editor.png | Bin 4605 -> 0 bytes 8 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 org.tizen.watch-face-editor.manifest create mode 100644 org.tizen.watch-face-editor.xml.in create mode 100644 packaging/org.tizen.watch-face-editor.spec create mode 100644 shared/res/org.tizen.watch-face-editor.png delete mode 100644 shared/res/watch-face-editor.png diff --git a/.cproject b/.cproject index 86c9945..890925b 100755 --- a/.cproject +++ b/.cproject @@ -107,6 +107,7 @@ + @@ -236,6 +237,7 @@ + @@ -299,7 +301,6 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..afdee32 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,98 @@ +# Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Flora License, Version 1.1 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://floralicense.org/license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT("watch-face-editor" C) + + +IF(NOT DEFINED PACKAGE_NAME) + SET(PACKAGE_NAME "org.tizen.watch-face-editor") +ENDIF(NOT DEFINED PACKAGE_NAME) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +IF(NOT DEFINED BINDIR) + SET(BINDIR"${PREFIX}/bin") +ENDIF(NOT DEFINED BINDIR) +IF(NOT DEFINED MANIFESTDIR) + SET(MANIFESTDIR "/usr/share/packages") +ENDIF(NOT DEFINED MANIFESTDIR) +IF(NOT DEFINED DESKTOP_ICONDIR) + SET(DESKTOP_ICONDIR "/usr/share/icons/default/small") +ENDIF(NOT DEFINED DESKTOP_ICONDIR) +IF(NOT DEFINED DESKTOP_ICON) + SET(DESKTOP_ICON ${PACKAGE_NAME}.png) +ENDIF(DESKTOP_ICON) + +SET(SHAREDIR "${PREFIX}/shared") +SET(RESDIR "${PREFIX}/res") +SET(EDJDIR "${RESDIR}/edje") +SET(SRCS + src/main.c + src/view.c + src/utils.c +) + +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_SOURCE_DIR}/inc + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/res +) + +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"") +ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") + +INCLUDE(FindPkgConfig) +pkg_check_modules(PKGS REQUIRED + glib-2.0 + dlog + elementary + efl-extension + bundle + capi-appfw-application + capi-system-system-settings + capi-appfw-watch-application + watchface-editor + screen_connector_watcher + screen_connector_watcher_evas + capi-appfw-app-manager + watch-control + vconf + ) + +FOREACH(flag ${PKGS_CFLAGS}) + SET(EXTRA_CFLGAS "${EXTRA_CFLGAS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLGAS} -fPIE") +SET(CMAKE_EXE_LINKER_FLAGS "-pie -Wl,--as-needed") +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS}) + +ADD_CUSTOM_TARGET(main.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images "${EDJEFLAGS}" + ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/main.edc + ${CMAKE_CURRENT_BINARY_DIR}/main.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/main.edc + ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/color_classes.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} main.edj) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/main.edj DESTINATION ${EDJDIR}) + +CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) +INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR}) + +INSTALL(FILES ${CMAKE_SOURCE_DIR}/shared/res/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR}) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/shared/res DESTINATION ${SHAREDIR} FILES_MATCHING PATTERN "*.png") diff --git a/inc/watch-face-editor.h b/inc/watch-face-editor.h index 7c2222e..6a12e4d 100644 --- a/inc/watch-face-editor.h +++ b/inc/watch-face-editor.h @@ -24,7 +24,6 @@ #include #include #include -#include #ifdef LOG_TAG #undef LOG_TAG diff --git a/org.tizen.watch-face-editor.manifest b/org.tizen.watch-face-editor.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/org.tizen.watch-face-editor.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/org.tizen.watch-face-editor.xml.in b/org.tizen.watch-face-editor.xml.in new file mode 100644 index 0000000..c822dae --- /dev/null +++ b/org.tizen.watch-face-editor.xml.in @@ -0,0 +1,13 @@ + + + + + + watch-face-editor.png + + + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/datasharing + http://tizen.org/privilege/widget.viewer + + diff --git a/packaging/org.tizen.watch-face-editor.spec b/packaging/org.tizen.watch-face-editor.spec new file mode 100644 index 0000000..feea7f2 --- /dev/null +++ b/packaging/org.tizen.watch-face-editor.spec @@ -0,0 +1,66 @@ +Name: org.tizen.watch-face-editor +Summary: PUT SUMMARY HERE +Version: 0.1 +Release: 1 +Group: TO_BE/FILLED_IN +License: Apache +Source0: %{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(bundle) +BuildRequires: pkgconfig(efl-extension) +BuildRequires: pkgconfig(capi-system-system-settings) +BuildRequires: pkgconfig(capi-appfw-watch-application) +BuildRequires: pkgconfig(watchface-editor) +BuildRequires: pkgconfig(screen_connector_watcher) +BuildRequires: pkgconfig(screen_connector_watcher_evas) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(watch-control) +BuildRequires: pkgconfig(vconf) +BuildRequires: gettext-devel + +%define _pkgdir /usr/apps/%{name} +%define _bindir %{_pkgdir}/bin +%define _resdir %{_pkgdir}/res +%define _sharedir %{_pkgdir}/shared +%define _datadir %{_pkgdir}/data +%define _manifestdir /usr/share/packages +%define _desktop_icondir /opt/share/icons/default/small + +%description +PUT DESCRIPTION HERE + +%prep +%setup -q + +%build +cmake \ + -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \ + -DPACKAGE_NAME=%{name} \ + -DBINDIR=%{_bindir} \ + -DMANIFESTDIR=%{_manifestdir} \ + -DDESKTOP_ICONDIR=%{_desktop_icondir} \ + -DDESKTOP_ICON=%{name}.png \ + -DVERSION=%{version} + +make %{?jobs:-j%jobs} + +%install +%make_install +install --directory %{buildroot}/%{_datadir} + +%clean +rm -rf %{buildroot} + +%files +%manifest org.tizen.watch-face-editor.manifest +%defattr(-,root,root,-) +%{_bindir}/* +%{_resdir}/* +%{_sharedir}/* +%{_datadir} +%{_manifestdir}/%{name}.xml +%{_desktop_icondir}/%{name}.png diff --git a/shared/res/org.tizen.watch-face-editor.png b/shared/res/org.tizen.watch-face-editor.png new file mode 100644 index 0000000..8e479c4 Binary files /dev/null and b/shared/res/org.tizen.watch-face-editor.png differ diff --git a/shared/res/watch-face-editor.png b/shared/res/watch-face-editor.png deleted file mode 100644 index 8e479c4..0000000 Binary files a/shared/res/watch-face-editor.png and /dev/null differ -- cgit v1.2.3