diff --git a/pkgs/flatpak/com.github.rafostar.Clapper.json b/pkgs/flatpak/com.github.rafostar.Clapper.json index f5019174..2f40189e 100644 --- a/pkgs/flatpak/com.github.rafostar.Clapper.json +++ b/pkgs/flatpak/com.github.rafostar.Clapper.json @@ -34,7 +34,8 @@ "flathub/lib/ffmpeg.json", "flathub/lib/uchardet.json", "flathub/gstreamer-1.0/gstreamer.json", - "flathub/lib/libadwaita.json", + "testing/gtk4.json", + "testing/libadwaita.json", "testing/gtuber.json", { "name": "clapper", diff --git a/pkgs/flatpak/testing/gtk4-disable-meson-gnome-post-install.patch b/pkgs/flatpak/testing/gtk4-disable-meson-gnome-post-install.patch new file mode 100644 index 00000000..d4ea86a8 --- /dev/null +++ b/pkgs/flatpak/testing/gtk4-disable-meson-gnome-post-install.patch @@ -0,0 +1,13 @@ +diff --git a/meson.build b/meson.build +index 38d23ed61c..68dea864a0 100644 +--- a/meson.build ++++ b/meson.build +@@ -799,7 +799,7 @@ subdir('docs/tools') + subdir('docs/reference') + + if not meson.is_cross_build() +- if meson.version().version_compare('>=0.57.0') ++ if false + gnome.post_install( + glib_compile_schemas: true, + gio_querymodules: gio_module_dirs, diff --git a/pkgs/flatpak/testing/gtk4-latest-gcc-fix.patch b/pkgs/flatpak/testing/gtk4-latest-gcc-fix.patch new file mode 100644 index 00000000..58d2c812 --- /dev/null +++ b/pkgs/flatpak/testing/gtk4-latest-gcc-fix.patch @@ -0,0 +1,114 @@ +From 4dcd02e85315f487310e2e01fe9412706a77dc35 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Tue, 19 Apr 2022 15:33:21 +0100 +Subject: [PATCH] Quench the anger of GCC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Direct access of the fields of the union trips compiler warnings with +GCC 12, such as: + + ../gtk/gtkimagedefinition.c:135:13: error: array subscript + ‘GtkImageDefinition {aka union _GtkImageDefinition}[0]’ is partly + outside array bounds of ‘GtkImageDefinitionEmpty[1]’ {aka + ‘struct _GtkImageDefinitionEmpty[1]’} [-Werror=array-bounds] +--- + gtk/gtkimagedefinition.c | 38 ++++++++++++++++++++++++++++---------- + 1 file changed, 28 insertions(+), 10 deletions(-) + +diff --git a/gtk/gtkimagedefinition.c b/gtk/gtkimagedefinition.c +index 1b7c9e51d9..3cf785b01c 100644 +--- a/gtk/gtkimagedefinition.c ++++ b/gtk/gtkimagedefinition.c +@@ -132,7 +132,9 @@ gtk_image_definition_new_paintable (GdkPaintable *paintable) + GtkImageDefinition * + gtk_image_definition_ref (GtkImageDefinition *def) + { +- def->empty.ref_count++; ++ GtkImageDefinitionEmpty *empty = (GtkImageDefinitionEmpty *) def; ++ ++ empty->ref_count++; + + return def; + } +@@ -140,9 +142,11 @@ gtk_image_definition_ref (GtkImageDefinition *def) + void + gtk_image_definition_unref (GtkImageDefinition *def) + { +- def->empty.ref_count--; ++ GtkImageDefinitionEmpty *empty = (GtkImageDefinitionEmpty *) def; ++ ++ empty->ref_count--; + +- if (def->empty.ref_count > 0) ++ if (empty->ref_count > 0) + return; + + switch (def->type) +@@ -152,13 +156,22 @@ gtk_image_definition_unref (GtkImageDefinition *def) + g_assert_not_reached (); + break; + case GTK_IMAGE_PAINTABLE: +- g_object_unref (def->paintable.paintable); ++ { ++ GtkImageDefinitionPaintable *paintable = (GtkImageDefinitionPaintable *) def; ++ g_object_unref (paintable->paintable); ++ } + break; + case GTK_IMAGE_ICON_NAME: +- g_free (def->icon_name.icon_name); ++ { ++ GtkImageDefinitionIconName *icon_name = (GtkImageDefinitionIconName *) def; ++ g_free (icon_name->icon_name); ++ } + break; + case GTK_IMAGE_GICON: +- g_object_unref (def->gicon.gicon); ++ { ++ GtkImageDefinitionGIcon *gicon = (GtkImageDefinitionGIcon *) def; ++ g_object_unref (gicon->gicon); ++ } + break; + } + +@@ -189,27 +202,32 @@ gtk_image_definition_get_scale (const GtkImageDefinition *def) + const char * + gtk_image_definition_get_icon_name (const GtkImageDefinition *def) + { ++ const GtkImageDefinitionIconName *icon_name = (const GtkImageDefinitionIconName *) def; ++ + if (def->type != GTK_IMAGE_ICON_NAME) + return NULL; + +- return def->icon_name.icon_name; ++ return icon_name->icon_name; + } + + GIcon * + gtk_image_definition_get_gicon (const GtkImageDefinition *def) + { ++ const GtkImageDefinitionGIcon *gicon = (const GtkImageDefinitionGIcon *) def; ++ + if (def->type != GTK_IMAGE_GICON) + return NULL; + +- return def->gicon.gicon; ++ return gicon->gicon; + } + + GdkPaintable * + gtk_image_definition_get_paintable (const GtkImageDefinition *def) + { ++ const GtkImageDefinitionPaintable *paintable = (const GtkImageDefinitionPaintable *) def; ++ + if (def->type != GTK_IMAGE_PAINTABLE) + return NULL; + +- return def->paintable.paintable; ++ return paintable->paintable; + } +- +-- +GitLab + diff --git a/pkgs/flatpak/testing/gtk4-popover-unrealize.patch b/pkgs/flatpak/testing/gtk4-popover-unrealize.patch new file mode 100644 index 00000000..c5b90efd --- /dev/null +++ b/pkgs/flatpak/testing/gtk4-popover-unrealize.patch @@ -0,0 +1,31 @@ +From b413ee2c7d458c7005d3d3d1da8822cd86893ac0 Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Fri, 4 Dec 2020 19:25:34 +0100 +Subject: [PATCH] popover: Call unrealize on hide + +When popover is shown "realize" method is called which creates a new +surface for popup. Unfortunately this causes performance drop on Wayland until that +surface is destroyed what happens inside "unrealize" method during popover destruction. + +This commit changes default behavior in a way that surface will be destroyed +when popover is closed and app will ragain the performance it lost when +popover was shown. +--- + gtk/gtkpopover.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c +index 504dcd6cc1..a7a764d483 100644 +--- a/gtk/gtkpopover.c ++++ b/gtk/gtkpopover.c +@@ -951,6 +951,7 @@ gtk_popover_hide (GtkWidget *widget) + + gtk_popover_set_mnemonics_visible (GTK_POPOVER (widget), FALSE); + _gtk_widget_set_visible_flag (widget, FALSE); ++ gtk_widget_unrealize (widget); + gtk_widget_unmap (widget); + g_signal_emit (widget, signals[CLOSED], 0); + } +-- +GitLab + diff --git a/pkgs/flatpak/testing/gtk4.json b/pkgs/flatpak/testing/gtk4.json new file mode 100644 index 00000000..b8bb877e --- /dev/null +++ b/pkgs/flatpak/testing/gtk4.json @@ -0,0 +1,41 @@ +{ + "name": "gtk", + "buildsystem": "meson", + "config-opts": [ + "--buildtype=release", + "--wrap-mode=nodownload", + + "-Dbroadway-backend=true", + "-Dwin32-backend=false", + "-Dmacos-backend=false", + "-Dmedia-ffmpeg=disabled", + "-Dprint-cups=disabled", + "-Dintrospection=enabled", + "-Ddemos=false", + "-Dbuild-examples=false", + "-Dbuild-tests=false" + ], + "cleanup": [ + "/bin/gtk4-builder-tool", + "/bin/gtk4-encode-symbolic-svg" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/gtk.git", + "branch": "gtk-4-4" + }, + { + "type": "patch", + "path": "gtk4-popover-unrealize.patch" + }, + { + "type": "patch", + "path": "gtk4-disable-meson-gnome-post-install.patch" + }, + { + "type": "patch", + "path": "gtk4-latest-gcc-fix.patch" + } + ] +} diff --git a/pkgs/flatpak/testing/libadwaita.json b/pkgs/flatpak/testing/libadwaita.json new file mode 100644 index 00000000..e171302f --- /dev/null +++ b/pkgs/flatpak/testing/libadwaita.json @@ -0,0 +1,21 @@ +{ + "name": "libadwaita", + "buildsystem": "meson", + "config-opts": [ + "--buildtype=release", + "--wrap-mode=nofallback", + "-Dintrospection=enabled", + "-Dvapi=false", + "-Dgtk_doc=false", + "-Dtests=false", + "-Dexamples=false" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/libadwaita.git", + "tag": "1.0.0.alpha.4", + "commit": "6b447fde8f270001a0dc29ef59d3e9bf6d32dae9" + } + ] +}