Add directories for tizen features 55/278155/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 16 Mar 2022 02:43:49 +0000 (11:43 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:58:19 +0000 (14:58 +0900)
Change-Id: Ie629354a2c689293b678cc9cc4d22227a5068a94

22 files changed:
include/libds-tizen/allocator/tbm.h [moved from include/libds/allocator/tbm.h with 76% similarity]
include/libds-tizen/backend/tdm.h [moved from include/libds/backend/tdm.h with 72% similarity]
include/meson.build
meson.build
meson_options.txt
packaging/libds.spec
src/examples/meson.build
src/examples/tdm-backend.c
src/examples/tinyds-tdm.c
src/libds-tizen/allocator/meson.build [new file with mode: 0644]
src/libds-tizen/allocator/tbm.c [moved from src/libds/allocator/tbm.c with 100% similarity]
src/libds-tizen/backend/meson.build [new file with mode: 0644]
src/libds-tizen/backend/tdm/backend.c [moved from src/libds/backend/tdm/backend.c with 100% similarity]
src/libds-tizen/backend/tdm/meson.build [new file with mode: 0644]
src/libds-tizen/backend/tdm/output.c [moved from src/libds/backend/tdm/output.c with 99% similarity]
src/libds-tizen/backend/tdm/tdm.h [moved from src/libds/backend/tdm/tdm.h with 95% similarity]
src/libds-tizen/meson.build [new file with mode: 0644]
src/libds/allocator/meson.build
src/libds/backend/meson.build
src/libds/backend/tdm/meson.build [deleted file]
src/libds/meson.build
src/meson.build

similarity index 76%
rename from include/libds/allocator/tbm.h
rename to include/libds-tizen/allocator/tbm.h
index c02aee3..3febb10 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef LIBDS_ALLOCATOR_TBM_H
-#define LIBDS_ALLOCATOR_TBM_H
+#ifndef LIBDS_TIZEN_ALLOCATOR_TBM_H
+#define LIBDS_TIZEN_ALLOCATOR_TBM_H
 
 #include <libds/allocator.h>
 
similarity index 72%
rename from include/libds/backend/tdm.h
rename to include/libds-tizen/backend/tdm.h
index e697413..d2785b2 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef LIBDS_BACKEND_TDM_H
-#define LIBDS_BACKEND_TDM_H
+#ifndef LIBDS_TIZEN_BACKEND_TDM_H
+#define LIBDS_TIZEN_BACKEND_TDM_H
 
 #include <libds/backend.h>
 
index f273424..0975c5d 100644 (file)
@@ -1,13 +1,9 @@
-exclude_files = []
-if not features.get('tdm-backend')
-  exclude_files += 'backend/tdm.h'
-endif
-
-if not features.get('tbm-allocator')
-  exclude_files += 'allocator/tbm.h'
-endif
-
 install_subdir('libds',
   install_dir: get_option('includedir'),
-  exclude_files: exclude_files,
 )
+
+if get_option('tizen')
+  install_subdir('libds-tizen',
+    install_dir: get_option('includedir'),
+  )
+endif
index 0e4e5c0..d3d2df0 100644 (file)
@@ -25,14 +25,7 @@ cdata.set('LIBDS_VERSION_MAJOR', libds_version_major)
 cdata.set('LIBDS_VERSION_MINOR', libds_version_minor)
 cdata.set('LIBDS_VERSION_PATCH', libds_version_patch)
 
-features = {
-  'tdm-backend': false,
-  'tbm-allocator': false,
-}
-
 subdir('src')
 subdir('include')
 
 configure_file(output: 'config.h', install: false, configuration: cdata)
-
-summary(features, bool_yn: true)
index 02af9b0..6ef6c8e 100644 (file)
@@ -1 +1 @@
-option('backends', type: 'array', choices: ['auto', 'tdm'], value: ['auto'], description: 'Select built-in backends')
+option('tizen', type: 'boolean', value: false, description: 'Build Tizen features')
index bd38de7..879a87d 100644 (file)
@@ -30,6 +30,12 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 Development package of Wayland Compositor Library
 
+%package tizen-devel
+Summary: Wayland Compositor development package on Tizen
+
+%description tizen-devel
+Wayland Compositor development library for Tizen platform
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -39,7 +45,8 @@ meson setup \
     --prefix /usr \
     --libdir %{_libdir} \
     --bindir %{_bindir} \
-    builddir
+    builddir \
+    -Dtizen=true
 ninja -C builddir all
 
 %install
@@ -56,7 +63,19 @@ ninja -C builddir install
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %license LICENSE
-%{_includedir}/*
+%{_includedir}/libds/*
 %{_libdir}/pkgconfig/libds.pc
 %{_libdir}/libds.so
-%{_bindir}/*
+%{_bindir}/wl-backend
+%{_bindir}/tinyds
+
+%files tizen-devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%license LICENSE
+%{_includedir}/libds-tizen/*
+%{_libdir}/pkgconfig/libds-tizen.pc
+%{_libdir}/libds-tizen.so
+%{_bindir}/tdm-backend
+%{_bindir}/tinyds-tdm
+%{_bindir}/ds-simple-tbm
index 193b4a5..f95bd50 100644 (file)
@@ -23,7 +23,9 @@ executable('tinyds',
   install : true
 )
 
-if features.get('tdm-backend')
+if get_option('tizen')
+  common_deps += dep_libds_tizen
+
   executable('tdm-backend',
     'tdm-backend.c',
     dependencies: common_deps,
index ee39f06..ba3fecb 100644 (file)
@@ -8,10 +8,10 @@
 #include <libds/log.h>
 #include <libds/backend.h>
 #include <libds/output.h>
-#include <libds/allocator/tbm.h>
-#include <libds/backend/tdm.h>
 #include <libds/swapchain.h>
 #include <libds/compositor.h>
+#include <libds-tizen/allocator/tbm.h>
+#include <libds-tizen/backend/tdm.h>
 
 #define WIDTH   1280
 #define HEIGHT  720
index 2c91a66..143d53e 100644 (file)
 #include <libds/log.h>
 #include <libds/backend.h>
 #include <libds/output.h>
-#include <libds/allocator/tbm.h>
-#include <libds/backend/tdm.h>
 #include <libds/swapchain.h>
 #include <libds/compositor.h>
 #include <libds/xdg_shell.h>
+#include <libds-tizen/allocator/tbm.h>
+#include <libds-tizen/backend/tdm.h>
 
 #define TINYDS_UNUSED   __attribute__((unused))
 
diff --git a/src/libds-tizen/allocator/meson.build b/src/libds-tizen/allocator/meson.build
new file mode 100644 (file)
index 0000000..fe869bd
--- /dev/null
@@ -0,0 +1,2 @@
+libds_tizen_files += files('tbm.c')
+libds_tizen_deps += dependency('libtbm', required: true)
diff --git a/src/libds-tizen/backend/meson.build b/src/libds-tizen/backend/meson.build
new file mode 100644 (file)
index 0000000..8a05e13
--- /dev/null
@@ -0,0 +1 @@
+subdir('tdm')
diff --git a/src/libds-tizen/backend/tdm/meson.build b/src/libds-tizen/backend/tdm/meson.build
new file mode 100644 (file)
index 0000000..39ffceb
--- /dev/null
@@ -0,0 +1,12 @@
+libds_tizen_files += files(
+  'backend.c',
+  'output.c',
+)
+
+libtdm = dependency('libtdm', required: true)
+libtbm = dependency('libtbm', required: true)
+
+libds_tizen_deps += [
+  libtdm,
+  libtbm
+]
similarity index 99%
rename from src/libds/backend/tdm/output.c
rename to src/libds-tizen/backend/tdm/output.c
index 5148853..f6b6250 100644 (file)
@@ -4,7 +4,7 @@
 #include <tbm_surface.h>
 
 #include "libds/log.h"
-#include "libds/allocator/tbm.h"
+#include "libds-tizen/allocator/tbm.h"
 
 #include "tdm.h"
 
similarity index 95%
rename from src/libds/backend/tdm/tdm.h
rename to src/libds-tizen/backend/tdm/tdm.h
index 1c80ef9..275089c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DS_BACKEND_TDM_H
-#define DS_BACKEND_TDM_H
+#ifndef DS_TIZEN_BACKEND_TDM_H
+#define DS_TIZEN_BACKEND_TDM_H
 
 #include <time.h>
 
diff --git a/src/libds-tizen/meson.build b/src/libds-tizen/meson.build
new file mode 100644 (file)
index 0000000..e9ca734
--- /dev/null
@@ -0,0 +1,29 @@
+libds_tizen_files = []
+
+libds_tizen_deps = [
+  dep_libds,
+]
+
+subdir('allocator')
+subdir('backend')
+
+lib_libds_tizen = shared_library('ds-tizen', libds_tizen_files,
+  dependencies: libds_tizen_deps,
+  include_directories: [ common_inc, include_directories('.') ],
+  version: meson.project_version(),
+  install: true
+)
+
+dep_libds_tizen = declare_dependency(
+  link_with: lib_libds_tizen,
+  dependencies: libds_tizen_deps,
+  include_directories: [ common_inc, include_directories('.') ],
+)
+
+pkgconfig = import('pkgconfig')
+pkgconfig.generate(lib_libds_tizen,
+  version: meson.project_version(),
+  filebase: 'libds-tizen',
+  name: 'libds-tizen',
+  description: 'extension of libds for tizen platform',
+)
index 361f96e..173c219 100644 (file)
@@ -1,12 +1 @@
 libds_files += files('shm.c')
-
-libtbm = dependency(
-  'libtbm',
-  required: false,
-  not_found_message: 'Required for TBM allocator support.'
-)
-if libtbm.found()
-  libds_files += files('tbm.c')
-  libds_deps += libtbm
-  features += { 'tbm-allocator': true }
-endif
index b1fff87..895ffca 100644 (file)
@@ -1,15 +1 @@
-all_backends = ['tdm']
-backends = get_option('backends')
-if 'auto' in backends and get_option('auto_features').enabled()
-  backends = all_backends
-elif 'auto' in backends and get_option('auto_features').disabled()
-  backends = []
-endif
-
-foreach backend : all_backends
-  if backend in backends or 'auto' in backends
-    subdir(backend)
-  endif
-endforeach
-
 subdir('wayland')
diff --git a/src/libds/backend/tdm/meson.build b/src/libds/backend/tdm/meson.build
deleted file mode 100644 (file)
index 82eb165..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-msg = ['Required for TDM backend support.']
-if 'tdm' in backends
-  msg += 'Install "libtdm" and "libtbm", or disable the tdm backend'
-endif
-
-libtdm = dependency(
-  'libtdm',
-  required: 'tdm' in backends,
-  not_found_message: '\n'.join(msg)
-)
-
-libtbm = dependency(
-  'libtbm',
-  required: 'tdm' in backends,
-  not_found_message: '\n'.join(msg)
-)
-
-if not libtdm.found() or not libtbm.found()
-  subdir_done()
-endif
-
-libds_files += files(
-  'backend.c',
-  'output.c',
-)
-
-libds_deps += [
-  libtdm,
-  libtbm
-]
-
-features += { 'tdm-backend': true }
index ed8c95f..50f7962 100644 (file)
@@ -68,16 +68,10 @@ lib_libds = shared_library('ds', libds_files,
   install: true
 )
 
-ds_vars = {}
-foreach name, have : features
-  ds_vars += { 'have_' + name.underscorify(): have.to_string() }
-endforeach
-
 dep_libds = declare_dependency(
   link_with: lib_libds,
   dependencies: libds_deps,
   include_directories: [ common_inc, include_directories('.') ],
-  variables: ds_vars,
 )
 
 pkgconfig = import('pkgconfig')
@@ -86,5 +80,4 @@ pkgconfig.generate(lib_libds,
   filebase: meson.project_name(),
   name: meson.project_name(),
   description: 'Wayland compositor library',
-  variables: ds_vars,
 )
index 774c7eb..d739bfe 100644 (file)
@@ -11,6 +11,9 @@ wayland_scanner = find_program(
 )
 
 subdir('libds')
+if get_option('tizen')
+  subdir('libds-tizen')
+endif
 subdir('tests')
 subdir('examples')
 subdir('clients')