echawk / kiss-xorg

A KISS Linux Repository for Xorg
MIT License
33 stars 9 forks source link

gtk+3: patches to remove atk dependency #81

Closed apprehensions closed 1 year ago

apprehensions commented 2 years ago

the 3 patches from the primary KISS repositories do not work as they require 2 extra patches:

--- a/gtk/a11y/gtkplugaccessible.h
+++ b/gtk/a11y/gtkplugaccessible.h
@@ -24,48 +24,4 @@

 #include <gtk/a11y/gtkwindowaccessible.h>

-#if ATK_CHECK_VERSION(2,35,1)
-
-#define GTK_HAVE_ATK_PLUG_SET_CHILD
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PLUG_ACCESSIBLE                         (gtk_plug_accessible_get_type ())
-#define GTK_PLUG_ACCESSIBLE(obj)                         (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessible))
-#define GTK_PLUG_ACCESSIBLE_CLASS(klass)                 (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
-#define GTK_IS_PLUG_ACCESSIBLE(obj)                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLUG_ACCESSIBLE))
-#define GTK_IS_PLUG_ACCESSIBLE_CLASS(klass)              (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG_ACCESSIBLE))
-#define GTK_PLUG_ACCESSIBLE_GET_CLASS(obj)               (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
-
-typedef struct _GtkPlugAccessible        GtkPlugAccessible;
-typedef struct _GtkPlugAccessibleClass   GtkPlugAccessibleClass;
-typedef struct _GtkPlugAccessiblePrivate GtkPlugAccessiblePrivate;
-
-/**
- * GtkPlugAccessible:
- *
- * Since: 3.24.30
- */
-struct _GtkPlugAccessible
-{
-  GtkWindowAccessible parent;
-
-  GtkPlugAccessiblePrivate *priv;
-};
-
-struct _GtkPlugAccessibleClass
-{
-  GtkWindowAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_plug_accessible_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-gchar *gtk_plug_accessible_get_id (GtkPlugAccessible *plug);
-
-G_END_DECLS
-
-#endif /* ATK_CHECK_VERSION(2,35,1) */
-
 #endif /* __GTK_PLUG_ACCESSIBLE_H__ */
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -178,8 +178,6 @@ gtk_plug_class_init (GtkPlugClass *class)
   widget_class->unmap = gtk_plug_unmap;
   widget_class->focus = gtk_plug_focus;

-  gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_PANEL);
-
   container_class->check_resize = gtk_plug_check_resize;

   window_class->set_focus = gtk_plug_set_focus;
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index ffdaf8bee4..18b3d5563d 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -271,7 +271,6 @@ gtk_socket_class_init (GtkSocketClass *class)
          G_TYPE_BOOLEAN, 0);

-  gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_SOCKET_ACCESSIBLE);
 }

 static void
@@ -1432,7 +1431,6 @@ _gtk_socket_accessible_embed (GtkWidget *socket, GdkWindow *window)
       return;
     }

-  gtk_socket_accessible_embed (GTK_SOCKET_ACCESSIBLE (gtk_widget_get_accessible (socket)), (gchar*) data);
   XFree (data);

   return;

anything that was already compiled for atk (eg. firefox) needs to be recompiled.

echawk commented 2 years ago

I can confirm that gtk+3 does build with this extra patch, however I'd like to make sure that the rest of the software that 'depends' on atk in community can be built without atk being present.

apprehensions commented 2 years ago

i am unable to test the following:

the following work:

echawk commented 2 years ago

I'm also not opposed to moving atk to community/ and removing all 'fake' dependencies on atk - I've gotten wxWidgets to build, and netsurf, currently building palemoon, and I'll move onto the webkit browsers next.

echawk commented 2 years ago

It does seem like 'goffice' and it's dependents will be a problem though.

apprehensions commented 2 years ago

however; i am not against removing atk entirely, only if all packages that do already rely on it can be compiled without it then it can simply be removed at that point

echawk commented 2 years ago

I think I will merge it with the following diff to the build:

diff --git a/extra/gtk+3/build b/extra/gtk+3/build
index 883c7256..0d293b25 100755
--- a/extra/gtk+3/build
+++ b/extra/gtk+3/build
@@ -2,7 +2,15 @@

 export DESTDIR="$1"

-patch -p1 < no-fribidi.patch
+# Some packages in community/ requrire that gtk+3 have atk methods, so this is
+# the workaround
+if pkg-config --exists atk; then
+    patch -p1 < 01-no-fribidi.patch
+else
+    for p in *.patch; do
+        patch -p1 < $p
+    done
+fi

 # Disable native language support, disable atk-bridge, don't compile schemas.
 sed -e '/compile_schemas/s/true/false/' \

atk will then get moved to community - I still need to do more testing of some stuff in community/ just to figure out exactly what packages have a hard dependency on atk

apprehensions commented 2 years ago

however if gtk+3 was built without atk and the package depends on both, atk gets buily and gtk+3 doesn't have atk support, wouldnt it not function? considering atk hasn't been built in the first place for gtk+3 to get recompiled for it.

echawk commented 2 years ago

That's correct, but I think this could easily be remedied by just adding a post-install script that tells the user to rebuild gtk+3 after they install atk.

echawk commented 1 year ago

gtk+3 now has an optional dependency on atk - no release bump yet, but if you force remove atk and rebuild all of the software that depends on gtk+3 you should be able to have an atk-less system.