xdg_shell_v6: Remove 'xdg-shell-unstable-v6-server' dependency 10/278110/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 12 Jul 2022 01:17:10 +0000 (10:17 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:09:02 +0000 (14:09 +0900)
The rpm package 'xdg-shell-unstable-v6-server' isn't always provided
on every platform. So, this patch generates code and header from
wayland-protocols using wayland-scanner.

Change-Id: I8dc7e751b1f9a2d2c02fb339efd2d620dfb63f7a

packaging/libds.spec
src/xdg_shell_v6/meson.build

index 13d59cf..ac79499 100644 (file)
@@ -11,7 +11,6 @@ BuildRequires:  meson
 BuildRequires:  pkgconfig(wayland-server)
 BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(wayland-protocols)
-BuildRequires:  pkgconfig(xdg-shell-unstable-v6-server)
 BuildRequires:  pkgconfig(pixman-1)
 BuildRequires:  pkgconfig(libdrm)
 BuildRequires:  pkgconfig(xkbcommon)
index 55c9b85..d584968 100644 (file)
@@ -4,9 +4,28 @@ libds_xdg_shell_v6_files = [
   'xdg_toplevel_v6.c',
 ]
 
+protocol_name = 'xdg-shell-v6'
+protocol_path = wl_protocol_dir / 'unstable/xdg-shell/xdg-shell-unstable-v6.xml'
+
+code = custom_target(
+  protocol_name.underscorify() + '_c',
+  input: protocol_path,
+  output: '@BASENAME@-protocol.c',
+  command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
+)
+libds_xdg_shell_v6_files += code
+
+server_header = custom_target(
+  protocol_name.underscorify() + '_server_h',
+  input: protocol_path,
+  output: '@BASENAME@-server-protocol.h',
+  command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
+  build_by_default: false,
+)
+libds_xdg_shell_v6_files += server_header
+
 libds_xdg_shell_v6_deps = [
   dep_libds,
-  dependency('xdg-shell-unstable-v6-server', required: true),
 ]
 
 lib_libds_xdg_shell_v6 = shared_library('ds-xdg-shell-v6', libds_xdg_shell_v6_files,