AC_CONFIG_SUBDIRS(web-engine-chromium)
AC_CONFIG_SUBDIRS(image-loader)
AC_CONFIG_SUBDIRS(web-engine-lite)
+AC_CONFIG_SUBDIRS(plugin-parser)
AC_CONFIG_FILES([
Makefile
--- /dev/null
+extension_src_dir = ../../../dali-extension
+
+include ../../../dali-extension/plugin-parser/file.list
+
+lib_LTLIBRARIES =
+
+lib_LTLIBRARIES += libdali-plugin-parser.la
+
+libdali_plugin_parser_la_SOURCES = $(plugin_parser_src_files)
+
+libdali_plugin_parser_la_DEPENDENCIES =
+
+libdali_plugin_parser_la_CXXFLAGS = \
+ -I../../../dali-extension/ \
+ $(DLOG_CFLAGS) \
+ $(DALI_CFLAGS) \
+ -I${includedir}/glib-2.0 \
+ -I${libdir}/glib-2.0/include \
+ -I${includedir}/boost \
+ -I${includedir}/pkgmgr \
+ -Wall -Werror
+
+libdali_plugin_parser_la_LIBADD = \
+ $(DLOG_LIBS)
+
+
+libdali_plugin_parser_la_LDFLAGS = \
+ -rdynamic
+
--- /dev/null
+4_define([dali_version],[0.1.0])
+AC_INIT([dali], [dali_version])
+AM_INIT_AUTOMAKE([-Wall foreign])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+LT_INIT
+
+DALI_EXTENSION_VERSION=dali_version
+AC_SUBST(DALI_EXTENSION_VERSION)
+
+PKG_CHECK_MODULES([DALI], [dali-core dali-adaptor dali-toolkit])
+PKG_CHECK_MODULES(PKGMGR_INFO, pkgmgr-info)
+PKG_CHECK_MODULES(PKGMGR_INSTALLER, pkgmgr-installer)
+PKG_CHECK_MODULES(DLOG, dlog)
+PKG_CHECK_MODULES(GLIB20, glib-2.0)
+PKG_CHECK_MODULES(BOOST, boost)
+
+#devincludepath=${includedir}
+#AC_SUBST(devincludepath)
+
+AC_CONFIG_FILES([
+Makefile
+])
+
+AC_OUTPUT
--- /dev/null
+type="metadata";name="http://tizen.org/metadata/nui_vulkan_backend";path="/etc/package-manager/parserlib/metadata/libnui_vulkan_backend_plugin.so"
\ No newline at end of file
--- /dev/null
+plugin_parser_src_files = $(extension_src_dir)/plugin-parser/plugin-parser.cpp
+
+
+plugin_parser_header_files = $(extension_src_dir)/plugin-parser/plugin-parser.h
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "DALI_PLUGIN_PARSER"
+
+#include <cstring>
+#include <vector>
+#include <sstream>
+#include <glib.h>
+#include <pkgmgr-info.h>
+#include <pkgmgr_installer_info.h>
+#include <boost/filesystem.hpp>
+#include <boost/system/error_code.hpp>
+#include "plugin-parser.h"
+
+typedef struct Metadata
+{
+ const char *key;
+ const char *value;
+} Metadata;
+
+const std::string valueType = "true";
+const std::string mdKey = "http://tizen.org/metadata/nui_vulkan_backend";
+extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *appId, GList *list)
+{
+ GList *tag = NULL;
+ bool mdValue = false;
+ Metadata *mdInfo = NULL;
+ tag = g_list_first(list);
+ while (tag)
+ {
+ mdInfo = (Metadata*)tag->data;
+ if (mdInfo->key == mdKey && mdInfo->value == valueType)
+ {
+ _INFO("NUI VulkanBackend set TRUE");
+ mdValue = true;
+ }
+ tag = g_list_next(tag);
+ }
+
+ if (mdValue)
+ {
+ int ret = makeNuiVulkanBackendSymbolicLink(pkgId, mdValue);
+ _INFO("makeNuiVulkanBackendSymbolicLink()=%d", ret );
+ }
+ else
+ {
+ _INFO("No symbolic link for nui vulkan backend!");
+ }
+ return 0;
+}
+
+extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *appId, GList *list)
+{
+ return PKGMGR_MDPARSER_PLUGIN_INSTALL(pkgId, appId, list);
+}
+
+extern "C" int getRootPath(std::string pkgId, std::string& rootPath)
+{
+ int ret = 0;
+ char *path = 0;
+
+ uid_t uid = 0;
+
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0)
+ {
+ _ERR("Failed to get UID");
+ return -1;
+ }
+
+ pkgmgrinfo_pkginfo_h handle;
+ if (uid == 0)
+ {
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgId.c_str(), &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ } else
+ {
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgId.c_str(), uid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ }
+
+ ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
+ if (ret != PMINFO_R_OK)
+ {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ rootPath = path;
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return 0;
+}
+
+namespace bf = boost::filesystem;
+extern "C" int makeNuiVulkanBackendSymbolicLink(const std::string& pkgId, bool vkOn)
+{
+ std::string pkgRoot;
+ if (getRootPath(pkgId, pkgRoot) < 0)
+ {
+ _ERR("makeNuiVulkanBackendSymbolicLink() ERROR : fail to get pkgRoot!");
+ return -1;
+ }
+ _INFO("makeNuiVulkanBackendSymbolicLink() TP1 : pkgRoot=%s, vkOn=%d", static_cast<const char*>(pkgRoot.c_str()), vkOn);
+
+ const char* nuiVkBinderPath = "/usr/lib/libdali-csharp-binder-vk.so";
+
+ // if(!vkOn) {
+ // nuiVkBinderPath = "/usr/lib/libdali-csharp-binder.so";
+ // }
+
+ bf::path symbol_path = bf::path(pkgRoot) / bf::path("lib/libdali-csharp-binder.so");
+ boost::system::error_code error;
+
+ bf::create_symlink(bf::path(nuiVkBinderPath), symbol_path, error);
+ if (error)
+ {
+ _ERR("makeNuiVulkanBackendSymbolicLink() ERROR : create_symlink() error!");
+ return -1;
+ }
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#ifndef __DALI_PLUGIN_PARSER_INTERFACE__
+#define __DALI_PLUGIN_PARSER_INTERFACE__
+
+#ifndef NO_TIZEN
+#include <dlog.h>
+#define LOGX(fmt, arg...) \
+ ({ do { \
+ dlog_print(DLOG_INFO, LOG_TAG, fmt, ##arg); \
+ } while (0); })
+
+#else
+#include <stdio.h>
+#define LOGE(fmt, args...) printf(fmt, ##args)
+#define LOGD(fmt, args...) printf(fmt, ##args)
+#define LOGI(fmt, args...) printf(fmt, ##args)
+#define LOGX(fmt, args...) printf(fmt, ##args)
+#endif
+
+#ifndef _ERR
+#define _ERR(fmt, args...) LOGE(fmt "\n", ##args)
+#endif
+
+#ifndef _DBG
+#define _DBG(fmt, args...) LOGD(fmt "\n", ##args)
+#endif
+
+#ifndef _INFO
+#define _INFO(fmt, args...) LOGI(fmt "\n", ##args)
+#endif
+
+#ifndef _LOGX
+#define _LOGX(fmt, args...) LOGX(fmt "\n", ##args)
+#endif
+
+extern "C"
+{
+ typedef struct _xmlDoc xmlDoc;
+ typedef xmlDoc* xmlDocPtr;
+ int PKGMGR_PARSER_PLUGIN_PRE_INSTALL(const char *pkgId);
+ int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char *pkgId);
+ int PKGMGR_PARSER_PLUGIN_PRE_UNINSTALL(const char *pkgId);
+
+ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char* pkgId);
+ int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr doc, const char* pkgId);
+ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr doc, const char* pkgId);
+
+ int PKGMGR_PARSER_PLUGIN_POST_INSTALL(const char *pkgId);
+ int PKGMGR_PARSER_PLUGIN_POST_UPGRADE(const char *pkgId);
+ int PKGMGR_PARSER_PLUGIN_POST_UNINSTALL(const char *pkgId);
+
+ int makeNuiVulkanBackendSymbolicLink(const std::string& pkgId, bool vkOn);
+ int getRootPath(std::string pkgId, std::string& rootPath);
+}
+
+#endif /* __DALI_PLUGIN_PARSER_INTERFACE__ */
Web Engine Lite plugin to support WebView for Dali
##############################
+# Dali plugin-parser
+##############################
+%package plugin-parser
+Summary: plugin-parser for Dali
+Group: System/Libraries
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(pkgmgr-installer)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(boost)
+
+%description plugin-parser
+plugin-parser for Dali
+
+%define dali_plugin_parser_dir /etc/package-manager/parserlib/metadata/
+%define dali_plugin_parser_list_dir /usr/share/parser-plugins/
+
+
+##############################
# Preparation
##############################
%prep
cd build/tizen
%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
+mkdir -p %{buildroot}%{dali_plugin_parser_dir}
+mkdir -p %{buildroot}%{dali_plugin_parser_list_dir}
+
+rm %{buildroot}/%{_libdir}/libdali-plugin-parser.so
+rm %{buildroot}/%{_libdir}/libdali-plugin-parser.so.0
+mv %{buildroot}/%{_libdir}/libdali-plugin-parser.so.0.0.0 %{buildroot}%{dali_plugin_parser_dir}libnui_vulkan_backend_plugin.so
+cp %{_builddir}/%{name}-%{version}/build/tizen/plugin-parser/nui_vulkan_backend.txt %{buildroot}%{dali_plugin_parser_list_dir}
+
%pre
exit 0
/sbin/ldconfig
exit 0
+%post plugin-parser
+/sbin/ldconfig
+exit 0
+
##############################
# Pre Uninstall old package
##############################
/sbin/ldconfig
exit 0
+%postun plugin-parser
+/sbin/ldconfig
+exit 0
+
##############################
# Files in Binary Packages
##############################
%defattr(-,root,root,-)
%{_libdir}/libdali-web-engine-lite-plugin.so*
%license LICENSE
+
+
+%files plugin-parser
+%manifest dali-extension.manifest
+%defattr(-,root,root,-)
+%{dali_plugin_parser_dir}libnui_vulkan_backend_plugin.so
+%{dali_plugin_parser_list_dir}nui_vulkan_backend.txt
+%license LICENSE