This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch dev/dimmus/test
in repository efl.

View the commit online.

commit 2fc758b7fa386cb71973669efe33178170073398
Author: dimmus <dmitri.chudi...@gmail.com>
AuthorDate: Mon Oct 21 15:39:52 2024 +0500

    meson: wl - refactor
---
 meson/deps/meson.build           |   4 +-
 src/lib/ecore_wl2/meson.build    |  14 +--
 src/tests/ecore_wl2/meson.build  |  21 +++--
 src/wayland_protocol/meson.build | 189 ++++++++++++++++++++++++++++-----------
 4 files changed, 158 insertions(+), 70 deletions(-)

diff --git a/meson/deps/meson.build b/meson/deps/meson.build
index 894f3d97f5..9c38844b5a 100644
--- a/meson/deps/meson.build
+++ b/meson/deps/meson.build
@@ -137,9 +137,9 @@ if get_option('opengl') == 'es-egl'
 endif
 
 if get_option('opengl') != 'none'
-  if get_option('opengl') != 'es-egl'
+  # if get_option('opengl') != 'es-egl' # to run tests
     gl_dep = dependency('gl')
-  endif
+  # endif
 endif
 
 ## ECORE_FB
diff --git a/src/lib/ecore_wl2/meson.build b/src/lib/ecore_wl2/meson.build
index cfbf21395c..66df4c870a 100644
--- a/src/lib/ecore_wl2/meson.build
+++ b/src/lib/ecore_wl2/meson.build
@@ -1,11 +1,11 @@
 ecore_wl2_deps = [ecore, ecore_input, buildsystem]
 ecore_wl2_pub_deps = [eina, ecore]
-ecore_wl2_ext_deps = [dependency('wayland-client'), dependency('wayland-server'), dependency('xkbcommon'),
-  wayland_protocol, libdrm, buildsystem_simple, dl, m]
+ecore_wl2_ext_deps = [wl_client_dep, wl_server_dep, xkb_dep, wayland_protocol, libdrm,
+                      buildsystem_simple, dl, m]
 
-ecore_wl2_header_src = [
+ecore_wl2_header_src = files(
   'Ecore_Wl2.h'
-]
+)
 
 if WITH_EMBEDDED_DRM
   config_h.set('EMBEDDED_DRM', '1') # added default samsung's exynos support
@@ -46,9 +46,9 @@ ecore_wl2_internal_headers = declare_dependency(
   dependencies: [
     wayland_protocol_simple,
     libdrm,
-    dependency('wayland-client'),
-    dependency('wayland-server'),
-    dependency('xkbcommon'),
+    wl_client_dep,
+    wl_server_dep,
+    xkb_dep,
   ],
 )
 
diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build
index 0dc1b1dbbf..da06b8087d 100644
--- a/src/tests/ecore_wl2/meson.build
+++ b/src/tests/ecore_wl2/meson.build
@@ -1,4 +1,4 @@
-ecore_wl2_suite_src = [
+ecore_wl2_suite_src = files(
   'ecore_wl2_suite.c',
   'ecore_wl2_suite.h',
   'ecore_wl2_tests_helpers.h',
@@ -6,24 +6,27 @@ ecore_wl2_suite_src = [
   'ecore_wl2_test_display.c',
   'ecore_wl2_test_window.c',
   'ecore_wl2_test_input.c',
-  'ecore_wl2_test_output.c'
-]
+  'ecore_wl2_test_output.c',
+)
 
 wl2_test_gl_deps = []
 
 if OPENGL == 'es-egl'
     ecore_wl2_suite_src += 'ecore_wl2_tests_helper_egl.h'
-    wl2_test_gl_deps += dependency('egl')
-    wl2_test_gl_deps += dependency('gl')
+    wl2_test_gl_deps += egl_dep
+    wl2_test_gl_deps += gl_dep
 endif
 
 ecore_wl2_suite = executable('ecore_wl2_suite',
   ecore_wl2_suite_src,
-  dependencies: [ecore_wl2, ecore, ecore_input, check_dep, wayland_protocol, wayland_client, dependency('wayland-egl'), wl2_test_gl_deps],
-
+  dependencies: [
+    wayland_protocol, wl_client_dep, wl_egl_dep, wl2_test_gl_deps,
+    ecore_wl2, ecore, ecore_input, check_dep
+  ],
   c_args : [
-  '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"',
-  '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"']
+    '-DTESTS_BUILD_DIR="' + meson.current_build_dir() + '"',
+    '-DTESTS_SRC_DIR="' + meson.current_source_dir() + '"'
+  ]
 )
 
 test('ecore_wl2-suite', ecore_wl2_suite,
diff --git a/src/wayland_protocol/meson.build b/src/wayland_protocol/meson.build
index b61379a6e0..8a41d69f8a 100644
--- a/src/wayland_protocol/meson.build
+++ b/src/wayland_protocol/meson.build
@@ -1,67 +1,152 @@
-wayland_scanner_bin = find_program('wayland-scanner')
+wl_scanner_exe = find_program('wayland-scanner')
 
-#make it typo proof
-_wayland_protocols = dependency('wayland-protocols')
-wayland_client = dependency('wayland-client')
+protocols_dir = wl_proto_dep.get_variable('pkgdatadir')
+assert(protocols_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc')
 
-wl_protocol_local = [
-  'efl-aux-hints.xml',
-  'efl-hints.xml',
-  'session-recovery.xml'
+wl_server_headers = []
+wl_client_headers = []
+wl_proto_sources  = []
+
+wayland_protocols = [
+  
+### Stable upstream protocols
+  [ 'xdg-shell',                  'stable',        ],  # wlroot, mutter, weston, efl
+# [ 'linux-dmabuf',               'stable',   'v1' ],  # wlroot, mutter,       , 
+# [ 'presentation-time',          'stable',        ],  # wlroot, mutter, weston, 
+# [ 'viewporter',                 'stable',        ],  # wlroot, mutter, weston, 
+  
+### Staging upstream protocols
+# [ 'fractional-scale',           'staging',  'v1' ],  # wlroot, mutter, weston, 
+# [ 'single-pixel-buffer',        'staging',  'v1' ],  # wlroot, mutter, weston, 
+# [ 'xdg-activation',             'staging',  'v1' ],  # wlroot, mutter,       , 
+# [ 'xdg-toplevel-drag',          'staging',  'v1' ],  #       ,       ,       ,
+# [ 'tearing-control',            'staging',  'v1' ],  # wlroot,       , weston, 
+# [ 'xwayland-shell',             'staging',  'v1' ],  # wlroot,       , weston, 
+# [ 'content-type',               'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'cursor-shape',               'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'drm-lease',                  'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'ext-foreign-toplevel-list',  'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'ext-idle-notify',            'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'ext-session-lock',           'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'ext-transient-seat',         'staging',  'v1' ],  # wlroot,       ,       ,
+# [ 'security-context',           'staging',  'v1' ],  # wlroot,       ,       ,
+  
+### Unstable upstream protocols
+# [ 'idle-inhibit',               'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'keyboard-shortcuts-inhibit', 'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'pointer-constraints',        'unstable', 'v1' ],  # wlroot, mutter, weston,
+# [ 'pointer-gestures',           'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'primary-selection',          'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'relative-pointer',           'unstable', 'v1' ],  # wlroot, mutter, weston,
+# [ 'tablet',                     'unstable', 'v2' ],  # wlroot, mutter, weston,
+  [ 'text-input',                 'unstable', 'v1' ],  #       ,       , weston, efl
+# [ 'text-input',                 'unstable', 'v3' ],  # wlroot, mutter,       , 
+  [ 'xdg-shell',                  'unstable', 'v6' ],  #       ,       , weston, efl
+# [ 'xdg-foreign',                'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'xdg-foreign',                'unstable', 'v2' ],  # wlroot, mutter,       ,
+# [ 'xdg-output',                 'unstable', 'v1' ],  # wlroot, mutter, weston,
+# [ 'xwayland-keyboard-grab',     'unstable', 'v1' ],  # wlroot, mutter,       ,
+# [ 'fullscreen-shell',           'unstable', 'v1' ],  # wlroot,       , weston,
+# [ 'input-method',               'unstable', 'v1' ],  #       ,       , weston,
+# [ 'input-method',               'unstable', 'v2' ],  # wlroot,       ,       ,
+# [ 'input-timestamps',           'unstable', 'v1' ],  #       ,       , weston,
+  [ 'linux-dmabuf',               'unstable', 'v1' ],  #       ,       , weston, efl
+# [ 'linux-explicit-synchronization','unstable','v1'], #       ,       , weston,
+
+### Other protocols (to take into account)
+  [ 'efl-aux-hints',              'internal',      ],  #       ,       ,       , efl
+  [ 'efl-hints',                  'internal',      ],  #       ,       ,       , efl
+  [ 'session-recovery',           'internal',      ],  #       ,       ,       , efl
+# [ 'gtk-shell',                  'internal',      ],  #       , mutter,       ,
+# [ 'linux-drm-syncobj',          'internal', 'v1' ],  #       , mutter,       ,
+# [ 'color-management',           'internal', 'v1' ],  #       ,       , weston,
+# [ 'ivi-application',            'internal',      ],  #       ,       , weston,
+# [ 'ivi-hmi-controller',         'internal',      ],  #       ,       , weston,
+# [ 'text-cursor-position',       'internal',      ],  #       ,       , weston,
+# [ 'weston-debug',               'internal',      ],  #       ,       , weston,
+# [ 'weston-desktop-shell',       'internal',      ],  #       ,       , weston,
+# [ 'weston-output-capture',      'internal',      ],  #       ,       , weston,
+# [ 'weston-content-protection',  'internal',      ],  #       ,       , weston,
+# [ 'weston-test',                'internal',      ],  #       ,       , weston,
+# [ 'weston-touch-calibration',   'internal',      ],  #       ,       , weston,
+# [ 'weston-direct-display',      'internal',      ],  #       ,       , weston,
+# [ 'wlr-data-control',           'internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'wlr-export-dmabuf',          'internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'wlr-foreign-toplevel-management','internal','v1'],# wlroot,       ,       ,
+# [ 'wlr-gamma-control',          'internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'wlr-layer-shell',            'internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'wlr-output-management',      'internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'wlr-output-power-management','internal', 'v1' ],  # wlroot,       ,       ,
+# [ 'virtual-keyboard',           'unstable', 'v1' ],  # wlroot,       ,       ,
+# [ 'drm',                        'internal',      ],  # wlroot,       ,       ,
 ]
 
-wl_unstable_protocol_sys = [
-  'xdg-shell/xdg-shell-unstable-v6.xml',
-  'linux-dmabuf/linux-dmabuf-unstable-v1.xml',
-  'text-input/text-input-unstable-v1.xml',
-]
+foreach p: wayland_protocols
+  protocol_name = p.get(0)
+  protocol_type = p.get(1)
 
-wl_stable_protocol_sys = [
-  'xdg-shell/xdg-shell.xml',
-]
+  if p.length() == 3
+    protocol_version = p.get(2)
+  endif
 
-foreach sys_protocol : wl_unstable_protocol_sys
-	wl_protocol_local += _wayland_protocols.get_pkgconfig_variable('pkgdatadir') / 'unstable' / sys_protocol
+  if protocol_type == 'stable'
+    if p.length() == 3 # 'stable' but with version
+      output_base = '@0@-@1@'.format(protocol_name, protocol_version)
+    else
+      output_base = protocol_name
+    endif
+    xml_path = protocols_dir / protocol_type / protocol_name / '@0@.xml'.format(output_base)
+  elif protocol_type == 'staging'
+    output_base = '@0@-@1@'.format(protocol_name, protocol_version)
+    xml_path = protocols_dir / protocol_type / protocol_name / '@0@.xml'.format(output_base)
+  elif protocol_type == 'unstable'
+    output_base = '@0@-unstable-@1@'.format(protocol_name, protocol_version)
+    xml_path = protocols_dir / protocol_type / protocol_name / '@0@.xml'.format(output_base)
+  elif protocol_type == 'internal'
+    output_base = protocol_name
+    xml_path = '@0@.xml'.format(protocol_name)
+  else
+    output_base = '@0@-@1@-@2@'.format(protocol_name, protocol_type, protocol_version)
+    xml_path = protocols_dir / protocol_type / protocol_name / '@0@.xml'.format(output_base)
+  endif
+
+  header_server = custom_target('@0@ server header'.format(output_base),
+    input: xml_path,
+    output: '@0@-server-protocol.h'.format(output_base),
+    command: [ wl_scanner_exe, 'server-header', '@INPUT@', '@OUTPUT@' ]
+  )
+
+  header_client = custom_target('@0@ client header'.format(output_base),
+    input: xml_path,
+    output: '@0@-client-protocol.h'.format(output_base),
+    command: [ wl_scanner_exe, 'client-header', '@INPUT@', '@OUTPUT@' ]
+  )
+
+  source_protocol = custom_target('@0@ source'.format(output_base),
+    input: xml_path,
+    output: '@0@-protocol.c'.format(output_base),
+    command: [ wl_scanner_exe, 'private-code', '@INPUT@', '@OUTPUT@' ]
+  )
+
+  wl_server_headers += header_server
+  wl_client_headers += header_client
+  wl_proto_sources  += source_protocol
 endforeach
 
-foreach sys_protocol : wl_stable_protocol_sys
-  wl_protocol_local += _wayland_protocols.get_pkgconfig_variable('pkgdatadir') / 'stable' / sys_protocol
-endforeach
+headers_wayland_protocol = wl_server_headers + wl_client_headers
 
-gen_obj_c = []
-gen_obj_header = []
-
-foreach item : wl_protocol_local
-  gen_obj_c += custom_target('wl_code_'+item.underscorify(),
-    input: item,
-    output : ['@BASENAME@-protocol.c'],
-    command: [wayland_scanner_bin, ['private-code','@INPUT@','@OUTPUT@']]
-  )
-  gen_obj_header += custom_target('wl_client_header_'+item.underscorify(),
-    input: item,
-    output : ['@BASENAME@-client-protocol.h'],
-    command: [wayland_scanner_bin, ['client-header','@INPUT@','@OUTPUT@']]
-  )
-  gen_obj_header += custom_target('wl_server_header_'+item.underscorify(),
-    input: item,
-    output : ['@BASENAME@-server-protocol.h'],
-    command: [wayland_scanner_bin, ['server-header','@INPUT@','@OUTPUT@']]
-  )
-endforeach
-
-
-wayland_protocol_lib = static_library('wayland_protocol',
-    gen_obj_c + gen_obj_header,
+lib_wayland_protocol = static_library('wayland_protocol',
+    headers_wayland_protocol + wl_proto_sources,
 )
 
 wayland_protocol = declare_dependency(
-	include_directories: include_directories('.'),
-	link_with: wayland_protocol_lib,
-  sources: gen_obj_header,
-  dependencies : [wayland_client]
+  include_directories : include_directories('.'),
+	link_with           : lib_wayland_protocol,
+  sources             : headers_wayland_protocol,
+  dependencies        : wl_client_dep
 )
 
 wayland_protocol_simple = declare_dependency(
-  include_directories: include_directories('.'),
-  sources: gen_obj_header,
-)
+  include_directories : include_directories('.'),
+  sources             : headers_wayland_protocol,
+)
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to