[gcr/nielsdg/drop-gtk-library] Drop gcr-gtk3 and gcr-gtk4




commit 9d4cddcb2857712ee09680a5dab8c1146eb3e8e8
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Aug 7 23:00:18 2022 +0200

    Drop gcr-gtk3 and gcr-gtk4
    
    gcr historically consisted of 2 high-level parts: `gcr-base` and
    `gcr-ui`. `gcr-base` contains the core classes and interfaces to deal
    with crypto-related items (e.g. `GcrCertificate`), while `gcr-ui`
    contained GTK widgets to show those items (e.g. `GcrCertificateWidget`).
    
    Now: with the move to gcr4, it's becoming more and more clear to that this isn't really a path forward:
    
    On one hand, GTK4 has transitioned from a platform toolkit (usually
    GNOME was the primary target) to one that allows you to build your
    platform on top (e.g. libadwaita, libgranite, or your very own). Kepeing
    that in mind, having "GTK-based" widgets for use in general purpose
    doesn't really make sense, since it will always look out touch on
    platforms
    
    On the other hand, widgets are usually more faster-moving targets in
    both looks as well as API than an actual library, so in practice gcr-ui
    has a different lifecycle than gcr-base.
    
    Finally, @tintou has been doing an awesome effort to implement an API
    that allows consumers to write their own widgets, without having to deal
    with asn1 decoding etc. At this point, I think the certificate widget is
    likely the only widget we're seeing interest in.
    
    As such, this commit drops gcr-gtk3 and gcr-gtk4 as libraries. There's
    still a gcr-viewer debugging tool as a troubleshooting/debugging tool,
    that's it.
    
    See https://gitlab.gnome.org/GNOME/gcr/-/issues/100 for the related
    discussion.

 docs/gcr-gtk3/gcr-gtk3.toml.in                     |   59 -
 docs/gcr-gtk3/images/certificate-widget.png        |  Bin 16144 -> 0 bytes
 docs/gcr-gtk3/images/combo-selector.png            |  Bin 7065 -> 0 bytes
 docs/gcr-gtk3/images/import-button.png             |  Bin 2925 -> 0 bytes
 docs/gcr-gtk3/images/key-widget.png                |  Bin 10159 -> 0 bytes
 docs/gcr-gtk3/images/list-selector.png             |  Bin 10123 -> 0 bytes
 docs/gcr-gtk3/images/tree-selector.png             |  Bin 10628 -> 0 bytes
 docs/gcr-gtk3/images/viewer-widget.png             |  Bin 13167 -> 0 bytes
 docs/gcr-gtk3/meson.build                          |   35 -
 docs/gcr-gtk3/urlmap.js                            |    6 -
 docs/gcr-gtk3/widget-gallery.md                    |   20 -
 docs/gcr-gtk4/gcr-gtk4.toml.in                     |   45 -
 docs/gcr-gtk4/meson.build                          |   31 -
 docs/gcr-gtk4/urlmap.js                            |    6 -
 docs/meson.build                                   |   10 -
 gcr-gtk3/fixtures/ca-certificates.crt              | 2560 --------------------
 gcr-gtk3/fixtures/der-certificate.crt              |  Bin 747 -> 0 bytes
 gcr-gtk3/fixtures/der-rsa-2048.p10                 |  Bin 681 -> 0 bytes
 gcr-gtk3/fixtures/email.p12                        |  Bin 2488 -> 0 bytes
 gcr-gtk3/fixtures/pem-dsa-1024.key                 |   12 -
 gcr-gtk3/frob-certificate.c                        |  113 -
 gcr-gtk3/gcr-certificate-widget.c                  |  200 --
 gcr-gtk3/gcr-certificate-widget.h                  |   33 -
 gcr-gtk3/gcr-crypto-types.xml                      |  169 --
 gcr-gtk3/gcr-gtk3.h                                |   40 -
 gcr-gtk3/gcr-gtk3.pc.in                            |   15 -
 gcr-gtk3/gcr-section.c                             |  233 --
 gcr-gtk3/gcr-section.h                             |   24 -
 gcr-gtk3/gcr-secure-entry-buffer.c                 |  215 --
 gcr-gtk3/gcr-secure-entry-buffer.h                 |   65 -
 gcr-gtk3/gcr.gresource.xml                         |    7 -
 gcr-gtk3/libgcr-gtk3.map                           |    8 -
 gcr-gtk3/meson.build                               |  157 --
 gcr-gtk4/gcr-gtk4.h                                |   20 -
 gcr-gtk4/libgcr-gtk4.map                           |    8 -
 gcr-gtk4/meson.build                               |  132 -
 meson.build                                        |   13 -
 meson_options.txt                                  |    5 -
 tools/gtk3/meson.build                             |    7 -
 tools/gtk3/viewer.c                                |  139 --
 tools/gtk4/meson.build                             |    7 -
 tools/meson.build                                  |    6 +-
 .../viewer}/gcr-certificate-widget.c               |    0
 .../viewer}/gcr-certificate-widget.h               |    0
 {gcr-gtk4 => tools/viewer}/gcr-section.c           |    0
 {gcr-gtk4 => tools/viewer}/gcr-section.h           |    0
 tools/viewer/meson.build                           |   26 +
 tools/{gtk4 => viewer}/viewer.c                    |    2 +-
 48 files changed, 28 insertions(+), 4400 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
index 3ae63b09..ddda3e88 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -2,19 +2,9 @@ gi_docgen = find_program('gi-docgen')
 
 subdir('gck')
 subdir('gcr')
-gtk_docs_targets = []
-if get_option('gtk3')
-  subdir('gcr-gtk3')
-  gtk_docs_targets += gcr_gtk3_docs
-endif
-if get_option('gtk4')
-  subdir('gcr-gtk4')
-  gtk_docs_targets += gcr_gtk4_docs
-endif
 
 # Create a pseudo target that build all docs at once
 alias_target('docs',
   gck_docs,
   gcr_docs,
-  gtk_docs_targets,
 )
diff --git a/meson.build b/meson.build
index f66d0cc2..3210f8d8 100644
--- a/meson.build
+++ b/meson.build
@@ -37,8 +37,6 @@ podir = source_root / 'po'
 gck_basename = 'gck-@0@'.format(gck_api_version)
 gcr_base_basename = 'gcr-base-@0@'.format(gcr_api_version)
 gcr_basename = 'gcr-@0@'.format(gcr_api_version)
-gcr_gtk3_basename = 'gcr-@0@-gtk3'.format(gcr_api_version)
-gcr_gtk4_basename = 'gcr-@0@-gtk4'.format(gcr_api_version)
 
 # Dependencies
 min_glib_version = '2.68'
@@ -76,11 +74,6 @@ if libsystemd.found() and systemd.found()
   with_systemd = true
 endif
 
-if get_option('gtk3')
-  gtk3_min_version = '3.22'
-  gtk3_dep = dependency('gtk+-3.0', version: '>=' + gtk3_min_version)
-endif
-
 if get_option('gtk4')
   gtk4_dep = dependency('gtk4')
 endif
@@ -117,12 +110,6 @@ subdir('po')
 subdir('egg')
 subdir('gck')
 subdir('gcr')
-if get_option('gtk3')
-  subdir('gcr-gtk3')
-endif
-if get_option('gtk4')
-  subdir('gcr-gtk4')
-endif
 subdir('tools')
 if get_option('gtk_doc')
   if not get_option('introspection')
diff --git a/meson_options.txt b/meson_options.txt
index 66d1567b..6840e445 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,11 +8,6 @@ option('vapi',
   value: true,
   description: 'Generate vapi data (requires vapigen and introspection option)',
 )
-option('gtk3',
-  type: 'boolean',
-  value: true,
-  description: 'Enable the GTK3 library and utilities',
-)
 option('gtk4',
   type: 'boolean',
   value: true,
diff --git a/tools/meson.build b/tools/meson.build
index 4db190ed..80002de8 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -1,7 +1,3 @@
-if get_option('gtk3')
-  subdir('gtk3')
-endif
-
 if get_option('gtk4')
-  subdir('gtk4')
+  subdir('viewer')
 endif
diff --git a/gcr-gtk4/gcr-certificate-widget.c b/tools/viewer/gcr-certificate-widget.c
similarity index 100%
rename from gcr-gtk4/gcr-certificate-widget.c
rename to tools/viewer/gcr-certificate-widget.c
diff --git a/gcr-gtk4/gcr-certificate-widget.h b/tools/viewer/gcr-certificate-widget.h
similarity index 100%
rename from gcr-gtk4/gcr-certificate-widget.h
rename to tools/viewer/gcr-certificate-widget.h
diff --git a/gcr-gtk4/gcr-section.c b/tools/viewer/gcr-section.c
similarity index 100%
rename from gcr-gtk4/gcr-section.c
rename to tools/viewer/gcr-section.c
diff --git a/gcr-gtk4/gcr-section.h b/tools/viewer/gcr-section.h
similarity index 100%
rename from gcr-gtk4/gcr-section.h
rename to tools/viewer/gcr-section.h
diff --git a/tools/viewer/meson.build b/tools/viewer/meson.build
new file mode 100644
index 00000000..9829c1e9
--- /dev/null
+++ b/tools/viewer/meson.build
@@ -0,0 +1,26 @@
+gcr_viewer_gtk4_sources = files(
+  'gcr-certificate-widget.c',
+  'gcr-section.c',
+  'viewer.c',
+)
+
+gcr_viewer_gtk4_deps = [
+  gck_dep,
+  gcr_dep,
+  p11kit_dep,
+  gtk4_dep,
+]
+
+gcr_viewer_gtk4_cflags = [
+  '-DGCK_API_SUBJECT_TO_CHANGE',
+  '-DGCR_API_SUBJECT_TO_CHANGE',
+  '-DP11_KIT_FUTURE_UNSTABLE_API',
+]
+
+gcr_viewer_gtk4 = executable('gcr-viewer-gtk4',
+  gcr_viewer_gtk4_sources,
+  dependencies: gcr_viewer_gtk4_deps,
+  c_args: gcr_viewer_gtk4_cflags,
+  include_directories: config_h_dir,
+  install: true,
+)
diff --git a/tools/gtk4/viewer.c b/tools/viewer/viewer.c
similarity index 99%
rename from tools/gtk4/viewer.c
rename to tools/viewer/viewer.c
index 9440b288..3e3d65e8 100644
--- a/tools/gtk4/viewer.c
+++ b/tools/viewer/viewer.c
@@ -8,9 +8,9 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <gcr-gtk4/gcr-gtk4.h>
 
 #include "config.h"
+#include "gcr-certificate-widget.h"
 
 static gchar **remaining_args = NULL;
 


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