# Set required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control app-checker rua glib-2.0 ecore-x ecore-input evas vconf pkgmgr-info app2sd privacy-manager-client)
+OPTION(WITH_WAYLAND "Build with wayland" OFF)
+IF(WITH_WAYLAND)
+ ADD_DEFINITIONS("-DWAYLAND")
+ pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control app-checker rua glib-2.0 ecore-wayland ecore-input evas vconf pkgmgr-info app2sd privacy-manager-client)
+ELSE()
+ ADD_DEFINITIONS("-DX11")
+ pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control app-checker rua glib-2.0 ecore-x ecore-input evas vconf pkgmgr-info app2sd privacy-manager-client)
+ENDIF(WITH_WAYLAND)
+
pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime app-checker libsmack)
PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 gio-2.0 dlog bundle)
*
*/
-#include <Ecore_X.h>
-#include <Ecore_Input.h>
-#include <utilX.h>
#include <Ecore.h>
#include <Evas.h>
+#include <Ecore_Input.h>
+#ifdef X11
+#include <Ecore_X.h>
+#include <utilX.h>
+#endif
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#endif
#include <aul.h>
#include <glib.h>
int _key_init()
{
+#ifdef X11
key_info.win = ecore_x_window_input_new(0, 0, 0, 1, 1);
if (!key_info.win) {
_D("Failed to create hidden window");
if (!key_info.key_down) {
_D("Failed to register a key down event handler");
}
+#endif // X11
return 0;
}
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <Ecore_X.h>
-#include <Ecore_Input.h>
-#include <utilX.h>
#include <Ecore.h>
+#include <Ecore_Input.h>
#include <Evas.h>
+#ifdef X11
+#include <Ecore_X.h>
+#include <utilX.h>
+#endif
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#endif
#include <aul.h>
#include <vconf.h>
#include <app-checker-server.h>
ecore_init();
evas_init();
ecore_event_init();
+#ifdef X11
ecore_x_init(NULL);
+#endif
+#ifdef WAYLAND
+ ecore_wl_init(NULL);
+#endif
appinfo_init(&amd.af);
cgutil_create(MOUNT_PATH, AGENT_PATH, &amd.cg);
+%bcond_with wayland
+
Name: aul
Summary: App utility library
Version: 0.0.282
BuildRequires: pkgconfig(app-checker)
BuildRequires: pkgconfig(app-checker-server)
BuildRequires: pkgconfig(rua)
+%if %{with wayland}
+BuildRequires: pkgconfig(ecore-wayland)
+%else
BuildRequires: pkgconfig(ecore-x)
+%endif
BuildRequires: pkgconfig(ecore-input)
BuildRequires: pkgconfig(utilX)
BuildRequires: pkgconfig(vconf)
CFLAGS="%{optflags} -D__emul__"; export CFLAGS
%endif
-%cmake .
+%if %{with wayland}
+%cmake . -DWITH_WAYLAND=On
+%else
+%cmake . -DWITH_WAYLAND=Off
+%endif
make %{?jobs:-j%jobs}
systemctl restart ac.service
fi
-%postun -p /sbin/ldconfig
+%postun
+/sbin/ldconfig
systemctl daemon-reload
%files