[gcr/main: 6/24] tools: Move gcr-promper and gcr-viewer into their own directory




commit f741adfcb7671f78c0fd102179801ffc561bf05f
Author: Corentin Noël <corentin noel collabora com>
Date:   Thu Dec 2 17:32:45 2021 +0100

    tools: Move gcr-promper and gcr-viewer into their own directory

 gcr-gtk3/meson.build                           | 47 -------------------
 meson.build                                    |  1 +
 {gcr-gtk3 => tools}/frob-unlock.c              |  2 +-
 {gcr-gtk3 => tools}/gcr-prompter-tool.c        |  0
 {gcr-gtk3 => tools}/gcr-prompter.desktop.in.in |  0
 {gcr-gtk3 => tools}/gcr-viewer-tool.c          |  0
 {gcr-gtk3 => tools}/gcr-viewer-window.c        |  0
 {gcr-gtk3 => tools}/gcr-viewer-window.h        |  0
 {gcr-gtk3 => tools}/gcr-viewer.desktop.in.in   |  0
 tools/meson.build                              | 65 ++++++++++++++++++++++++++
 10 files changed, 67 insertions(+), 48 deletions(-)
---
diff --git a/gcr-gtk3/meson.build b/gcr-gtk3/meson.build
index 49ebffe..c4cc451 100644
--- a/gcr-gtk3/meson.build
+++ b/gcr-gtk3/meson.build
@@ -35,7 +35,6 @@ gcr_gtk3_private_sources = files(
   'gcr-pkcs11-import-dialog.c',
   'gcr-pkcs11-import-interaction.c',
   'gcr-unlock-renderer.c',
-  'gcr-viewer-window.c',
 )
 
 gcr_gtk3_headers = files(
@@ -181,51 +180,6 @@ if get_option('introspection')
   )
 endif
 
-# gcr-viewer
-gcr_viewer = executable('gcr-viewer',
-  'gcr-viewer-tool.c',
-  dependencies: [ gcr_gtk3_dep, gcr_gtk3_deps ],
-  c_args: gcr_gtk3_cflags,
-  include_directories: config_h_dir,
-  install: true,
-)
-
-i18n.merge_file(
-  input: configure_file(
-    input: 'gcr-viewer.desktop.in.in',
-    output: '@BASENAME@',
-    configuration: { 'bindir': gcr_prefix / get_option('bindir') },
-  ),
-  output: '@BASENAME@',
-  type: 'desktop',
-  po_dir: podir,
-  install: true,
-  install_dir: get_option('datadir') / 'applications',
-)
-
-# gcr-prompter
-gcr_prompter = executable('gcr-prompter',
-  'gcr-prompter-tool.c',
-  dependencies: [ gcr_gtk3_dep, gcr_gtk3_deps ],
-  c_args: gcr_gtk3_cflags,
-  include_directories: config_h_dir,
-  install: true,
-  install_dir: get_option('libexecdir'),
-)
-
-i18n.merge_file(
-  input: configure_file(
-    input: 'gcr-prompter.desktop.in.in',
-    output: '@BASENAME@',
-    configuration: { 'libexecdir': gcr_prefix / get_option('libexecdir') },
-  ),
-  output: '@BASENAME@',
-  type: 'desktop',
-  po_dir: podir,
-  install: true,
-  install_dir: get_option('datadir') / 'applications',
-)
-
 # Register new mime types
 install_data('gcr-crypto-types.xml',
   install_dir: get_option('datadir') / 'mime' / 'packages',
@@ -242,7 +196,6 @@ gcr_gtk3_manual_tests = [
   'frob-prompt',
   'frob-request',
   'frob-system-prompt',
-  'frob-unlock',
   'frob-unlock-options',
 ]
 
diff --git a/meson.build b/meson.build
index 1ab3f70..52964aa 100644
--- a/meson.build
+++ b/meson.build
@@ -100,6 +100,7 @@ subdir('schema')
 if get_option('gtk')
   subdir('gcr-gtk3')
 endif
+subdir('tools')
 if get_option('gtk_doc')
   if not get_option('introspection')
     error('Can\'t generate docs without introspection enabled!')
diff --git a/gcr-gtk3/frob-unlock.c b/tools/frob-unlock.c
similarity index 98%
rename from gcr-gtk3/frob-unlock.c
rename to tools/frob-unlock.c
index d7ca298..83636c9 100644
--- a/gcr-gtk3/frob-unlock.c
+++ b/tools/frob-unlock.c
@@ -24,7 +24,7 @@
 #include "gcr/gcr.h"
 
 #include "gcr-gtk3/gcr-unlock-renderer.h"
-#include "gcr-gtk3/gcr-viewer-window.h"
+#include "tools/gcr-viewer-window.h"
 
 #include <gtk/gtk.h>
 
diff --git a/gcr-gtk3/gcr-prompter-tool.c b/tools/gcr-prompter-tool.c
similarity index 100%
rename from gcr-gtk3/gcr-prompter-tool.c
rename to tools/gcr-prompter-tool.c
diff --git a/gcr-gtk3/gcr-prompter.desktop.in.in b/tools/gcr-prompter.desktop.in.in
similarity index 100%
rename from gcr-gtk3/gcr-prompter.desktop.in.in
rename to tools/gcr-prompter.desktop.in.in
diff --git a/gcr-gtk3/gcr-viewer-tool.c b/tools/gcr-viewer-tool.c
similarity index 100%
rename from gcr-gtk3/gcr-viewer-tool.c
rename to tools/gcr-viewer-tool.c
diff --git a/gcr-gtk3/gcr-viewer-window.c b/tools/gcr-viewer-window.c
similarity index 100%
rename from gcr-gtk3/gcr-viewer-window.c
rename to tools/gcr-viewer-window.c
diff --git a/gcr-gtk3/gcr-viewer-window.h b/tools/gcr-viewer-window.h
similarity index 100%
rename from gcr-gtk3/gcr-viewer-window.h
rename to tools/gcr-viewer-window.h
diff --git a/gcr-gtk3/gcr-viewer.desktop.in.in b/tools/gcr-viewer.desktop.in.in
similarity index 100%
rename from gcr-gtk3/gcr-viewer.desktop.in.in
rename to tools/gcr-viewer.desktop.in.in
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..a8d2309
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,65 @@
+# gcr-viewer
+gcr_viewer = executable('gcr-viewer',
+  'gcr-viewer-tool.c',
+  'gcr-viewer-window.c',
+  dependencies: [ gcr_gtk3_dep, gcr_gtk3_deps ],
+  c_args: gcr_gtk3_cflags,
+  include_directories: config_h_dir,
+  install: true,
+)
+
+i18n.merge_file(
+  input: configure_file(
+    input: 'gcr-viewer.desktop.in.in',
+    output: '@BASENAME@',
+    configuration: { 'bindir': gcr_prefix / get_option('bindir') },
+  ),
+  output: '@BASENAME@',
+  type: 'desktop',
+  po_dir: podir,
+  install: true,
+  install_dir: get_option('datadir') / 'applications',
+)
+
+# gcr-prompter
+gcr_prompter = executable('gcr-prompter',
+  'gcr-prompter-tool.c',
+  dependencies: [ gcr_gtk3_dep, gcr_gtk3_deps ],
+  c_args: gcr_gtk3_cflags,
+  include_directories: config_h_dir,
+  install: true,
+  install_dir: get_option('libexecdir'),
+)
+
+i18n.merge_file(
+  input: configure_file(
+    input: 'gcr-prompter.desktop.in.in',
+    output: '@BASENAME@',
+    configuration: { 'libexecdir': gcr_prefix / get_option('libexecdir') },
+  ),
+  output: '@BASENAME@',
+  type: 'desktop',
+  po_dir: podir,
+  install: true,
+  install_dir: get_option('datadir') / 'applications',
+)
+
+
+# Manual UI testing programs
+gcr_tools_manual_tests = [
+  'frob-unlock',
+]
+
+gcr_tools_test_cflags = [
+  '-DSRCDIR="@0@"'.format(source_root),
+]
+
+foreach _test : gcr_tools_manual_tests
+  test_bin = executable('test-'+_test,
+    '@0@.c'.format(_test),
+    'gcr-viewer-window.c',
+    dependencies: [ gcr_gtk3_deps, gcr_gtk3_dep ],
+    c_args: [ gcr_gtk3_cflags, gcr_tools_test_cflags ],
+    include_directories: config_h_dir,
+  )
+endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]