From 2df2f49124102caa437d57db868df03446178e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 19 Nov 2026 09:56:12 +0700 Subject: [PATCH] dia: update to 0.98.0pre20260221. --- srcpkgs/dia/patches/gcc14.patch | 35 --- srcpkgs/dia/patches/isinf.patch | 16 -- srcpkgs/dia/patches/libxml2.patch | 23 ++ srcpkgs/dia/patches/poppler-26.06.patch | 26 ++ .../revert_xpm_loader_replacement.patch | 232 ++++++++++++++++++ srcpkgs/dia/template | 24 +- 6 files changed, 294 insertions(+), 62 deletions(-) delete mode 100644 srcpkgs/dia/patches/gcc14.patch delete mode 100644 srcpkgs/dia/patches/isinf.patch create mode 100644 srcpkgs/dia/patches/libxml2.patch create mode 100644 srcpkgs/dia/patches/poppler-26.06.patch create mode 100644 srcpkgs/dia/patches/revert_xpm_loader_replacement.patch diff --git a/srcpkgs/dia/patches/gcc14.patch b/srcpkgs/dia/patches/gcc14.patch deleted file mode 100644 index 64897e989a07bc..00000000000000 --- a/srcpkgs/dia/patches/gcc14.patch +++ /dev/null @@ -1,35 +0,0 @@ -Source: https://src.fedoraproject.org/rpms/dia/blob/7ebdbadff67fe2ee482d8655fcb3d361b31742f3/f/dia-configure-c99.patch - -C99 removes support for implicit ints, so declare the return type -of main explicitly. Future compilers are likely to require explicit -type declarations. - -Upstream has switched to Meson, and it does not seem to use this -particular check anymore. - -diff --git a/configure b/configure -index 14cdc757c3ee0f15..504ae93d8e3a4f48 100755 ---- a/configure -+++ b/configure -@@ -17571,7 +17571,7 @@ $as_echo_n "checking for png_structp in png.h... " >&6; } - png_structp pp; - png_infop info; - png_colorp cmap; -- main() { void*foo = png_create_read_struct; } -+ int main(void) { void*foo = png_create_read_struct; } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : - png_ok=yes -diff --git a/configure.in b/configure.in -index c5edeeddf766d5fb..f90ed4ef953af139 100644 ---- a/configure.in -+++ b/configure.in -@@ -197,7 +197,7 @@ if test "$png_ok" = yes; then - png_structp pp; - png_infop info; - png_colorp cmap; -- main() { void*foo = png_create_read_struct; }], -+ int main(void) { void*foo = png_create_read_struct; }], - png_ok=yes, - png_ok=no) - LDFLAGS="${old_LDFLAGS}" diff --git a/srcpkgs/dia/patches/isinf.patch b/srcpkgs/dia/patches/isinf.patch deleted file mode 100644 index 0f55c0f2928d58..00000000000000 --- a/srcpkgs/dia/patches/isinf.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/configure -+++ b/configure -@@ -17436,11 +17436,11 @@ - #ifdef __cplusplus - extern "C" - #endif --char isinf (); -+#include - int - main () - { --return isinf (); -+return isinf (0.0); - ; - return 0; - } diff --git a/srcpkgs/dia/patches/libxml2.patch b/srcpkgs/dia/patches/libxml2.patch new file mode 100644 index 00000000000000..9d162617086881 --- /dev/null +++ b/srcpkgs/dia/patches/libxml2.patch @@ -0,0 +1,23 @@ +--- a/meson.build ++++ b/meson.build +@@ -17,7 +17,7 @@ conf.set_quoted('DIA_APPLICATION_PATH', + libglib_dep = dependency('glib-2.0', version: '>= 2.80') + gio_dep = dependency('gio-2.0', version: '>= 2.80') + libgtk_dep = dependency('gtk+-3.0', version: '>= 3.24') +-libxml_dep = dependency('libxml-2.0', version: '>= 2.14.0') ++libxml_dep = dependency('libxml-2.0', version: '>= 2.10.0') + #TODO: what are the minimum versions? + gmodule_dep = dependency('gmodule-2.0') + libcairo_dep = dependency('cairo') +--- a/lib/dia-io.c ++++ b/lib/dia-io.c +@@ -351,6 +351,9 @@ write_context_new (GFile *file, DiaConte + + g_set_object (&self->dia_ctx, ctx); + ++#if LIBXML_VERSION < 21400 ++#define XML_SAVE_EMPTY (1 << 8) ++#endif + self->xml_ctx = xmlSaveToIO (write_context_write, + write_context_close, + self, diff --git a/srcpkgs/dia/patches/poppler-26.06.patch b/srcpkgs/dia/patches/poppler-26.06.patch new file mode 100644 index 00000000000000..60a75704cae3be --- /dev/null +++ b/srcpkgs/dia/patches/poppler-26.06.patch @@ -0,0 +1,26 @@ +Description: Fix FTBFS with poppler >= 26.06 + poppler 26.06 changed the Page box accessors to return a const reference + instead of a pointer. Take the address of the result, guarded by a version + check so older poppler still builds +Author: Nadzeya Hutsko +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dia/+bug/2161428 +Forwarded: https://gitlab.gnome.org/GNOME/dia/-/merge_requests/146 +Last-Update: 2026-07-21 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/plug-ins/pdf/pdf-import.cpp ++++ b/plug-ins/pdf/pdf-import.cpp +@@ -93,8 +93,13 @@ + (Annot *annot, void *user_data) G_GNUC_UNUSED, + void *annotDisplayDecideCbkData G_GNUC_UNUSED) + { ++#if POPPLER_VERSION_MAJOR > 26 || (POPPLER_VERSION_MAJOR == 26 && POPPLER_VERSION_MINOR >= 6) ++ const PDFRectangle *mediaBox = &page->getMediaBox(); ++ const PDFRectangle *clipBox = &page->getCropBox (); ++#else + const PDFRectangle *mediaBox = page->getMediaBox(); + const PDFRectangle *clipBox = page->getCropBox (); ++#endif + + if (page->isOk()) { + real w1 = (clipBox->x2 - clipBox->x1); diff --git a/srcpkgs/dia/patches/revert_xpm_loader_replacement.patch b/srcpkgs/dia/patches/revert_xpm_loader_replacement.patch new file mode 100644 index 00000000000000..b02f99ef1dbc61 --- /dev/null +++ b/srcpkgs/dia/patches/revert_xpm_loader_replacement.patch @@ -0,0 +1,232 @@ +From: Philippe SWARTVAGHER +Subject: Revert switch from gdk_pixbuf_new_from_xpm_data to xpm_pixbuf_load +Last-Update: 2025-09-02 +Forwarded: not-needed + + +diff --git a/app/dia-colour-area.c b/app/dia-colour-area.c +index 50e8432..397be3d 100644 +--- a/app/dia-colour-area.c ++++ b/app/dia-colour-area.c +@@ -22,8 +22,6 @@ + + #include + +-#include +- + #include "attributes.h" + #include "persistence.h" + +@@ -299,8 +297,8 @@ dia_colour_area_class_init (DiaColourAreaClass *class) + static void + dia_colour_area_init (DiaColourArea *self) + { +- self->reset = xpm_pixbuf_load (default_xpm); +- self->swap = xpm_pixbuf_load (swap_xpm); ++ self->reset = gdk_pixbuf_new_from_xpm_data (default_xpm); ++ self->swap = gdk_pixbuf_new_from_xpm_data (swap_xpm); + + gtk_widget_set_events (GTK_WIDGET (self), GDK_BUTTON_PRESS_MASK); + } +diff --git a/app/dia-page-layout.c b/app/dia-page-layout.c +index 6256a88..f6abd1e 100644 +--- a/app/dia-page-layout.c ++++ b/app/dia-page-layout.c +@@ -25,8 +25,6 @@ + + #include + +-#include +- + #include "dia-page-layout.h" + + #include "pixmaps/portrait.xpm" +@@ -148,7 +146,7 @@ dia_page_layout_init (DiaPageLayout *self) + + self->orient_portrait = gtk_radio_button_new (NULL); + +- wid = gtk_image_new_from_pixbuf (xpm_pixbuf_load (portrait_xpm)); ++ wid = gtk_image_new_from_pixbuf (gdk_pixbuf_new_from_xpm_data (portrait_xpm)); + gtk_container_add (GTK_CONTAINER (self->orient_portrait), wid); + gtk_widget_show (wid); + +@@ -157,7 +155,7 @@ dia_page_layout_init (DiaPageLayout *self) + + self->orient_landscape = gtk_radio_button_new ( + gtk_radio_button_get_group (GTK_RADIO_BUTTON (self->orient_portrait))); +- wid = gtk_image_new_from_pixbuf (xpm_pixbuf_load (landscape_xpm)); ++ wid = gtk_image_new_from_pixbuf (gdk_pixbuf_new_from_xpm_data (landscape_xpm)); + gtk_container_add (GTK_CONTAINER (self->orient_landscape), wid); + gtk_widget_show (wid); + +diff --git a/app/navigation.c b/app/navigation.c +index 94ed609..4b4cd1c 100644 +--- a/app/navigation.c ++++ b/app/navigation.c +@@ -24,8 +24,6 @@ + + #include + +-#include +- + #include "diagram.h" + #include "display.h" + #include "renderer/diacairo.h" +@@ -489,7 +487,7 @@ navigation_popup_new (DDisplay *ddisp) + "released", G_CALLBACK (on_button_navigation_popup_released), + NULL); + +- pixbuf = xpm_pixbuf_load (nav_xpm); ++ pixbuf = gdk_pixbuf_new_from_xpm_data (nav_xpm); + + image = gtk_image_new_from_pixbuf (pixbuf); + +diff --git a/app/sheet-editor/sheet-editor-button.c b/app/sheet-editor/sheet-editor-button.c +index 253eaa4..185890b 100644 +--- a/app/sheet-editor/sheet-editor-button.c ++++ b/app/sheet-editor/sheet-editor-button.c +@@ -24,8 +24,6 @@ + + #include + +-#include +- + #include "sheet-editor-button.h" + #include "widgets.h" + #include "message.h" +@@ -79,7 +77,7 @@ get_object_pixbuf (SheetObject *so) + if (g_str_has_prefix ((char *) so->pixmap, "res:")) { + pixbuf = pixbuf_from_resource (((char *) so->pixmap) + 4); + } else { +- pixbuf = xpm_pixbuf_load (so->pixmap); ++ pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) so->pixmap); + } + } else { + if (so->pixmap_file != NULL) { +diff --git a/app/toolbox.c b/app/toolbox.c +index 746ede5..7bfc6c8 100644 +--- a/app/toolbox.c ++++ b/app/toolbox.c +@@ -21,9 +21,6 @@ + #include + + #include +- +-#include +- + #include "gtkwrapbox.h" + #include "gtkhwrapbox.h" + +@@ -305,7 +302,7 @@ fill_sheet_wbox(Sheet *sheet) + if (g_str_has_prefix ((const char *) sheet_obj->pixmap, "res:")) { + pixbuf = pixbuf_from_resource ((const char *) sheet_obj->pixmap + 4); + } else { +- pixbuf = xpm_pixbuf_load (sheet_obj->pixmap); ++ pixbuf = gdk_pixbuf_new_from_xpm_data (sheet_obj->pixmap); + if (pixbuf == NULL) { + g_warning ("Problem loading icon for ā€˜%s’", sheet_obj->description); + pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), +@@ -334,7 +331,7 @@ fill_sheet_wbox(Sheet *sheet) + pixbuf = cropped; + } + } else { +- pixbuf = xpm_pixbuf_load (missing); ++ pixbuf = gdk_pixbuf_new_from_xpm_data (missing); + + message_warning ("failed to load icon for file\n %s\n cause=%s", + sheet_obj->pixmap_file, +@@ -342,8 +339,8 @@ fill_sheet_wbox(Sheet *sheet) + } + } else { + DiaObjectType *type; +- type = object_get_type (sheet_obj->object_type); +- pixbuf = dia_object_type_get_icon (type); ++ type = object_get_type(sheet_obj->object_type); ++ pixbuf = gdk_pixbuf_new_from_xpm_data (type->pixmap); + } + + if (pixbuf) { +diff --git a/build-aux/flatpak/org.gnome.Dia.json b/build-aux/flatpak/org.gnome.Dia.json +index 5c08e83..fcd2202 100644 +--- a/build-aux/flatpak/org.gnome.Dia.json ++++ b/build-aux/flatpak/org.gnome.Dia.json +@@ -24,17 +24,6 @@ + "*.a" + ], + "modules": [ +- { +- "name": "xpm-pixbuf", +- "buildsystem": "meson", +- "sources": [ +- { +- "type": "git", +- "url": "https://gitlab.gnome.org/ZanderBrown/xpm-pixbuf.git", +- "branch" : "main" +- } +- ] +- }, + { + "name": "libxml2", + "buildsystem": "meson", +diff --git a/lib/meson.build b/lib/meson.build +index 779184f..4f68b13 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -245,7 +245,6 @@ libdia_deps = [ + libm_dep, + gmodule_dep, + graphene_dep, +- xpm_dep, + ] + + libdia_inc = include_directories('.') +diff --git a/lib/object.c b/lib/object.c +index c307c3b..8f409e9 100644 +--- a/lib/object.c ++++ b/lib/object.c +@@ -23,8 +23,6 @@ + #include + #include + +-#include +- + #define _DIA_OBJECT_BUILD 1 + #include "object.h" + #include "diagramdata.h" /* for Layer */ +@@ -1411,6 +1409,14 @@ dia_object_type_get_icon (const DiaObjectType *type) + + if (g_str_has_prefix ((char *) icon_data, "res:")) { + pixbuf = pixbuf_from_resource (((char *) icon_data) + 4); ++ } else if (icon_data && strncmp ((char *) icon_data, "GdkP", 4) == 0) { ++ /* GTK3: We will remove this in Dia 2.0 but is retained to maintain ++ * compatability with 0.97.3 objects */ ++ g_warning ("Object '%s' has an inline icon, this is deprecated", ++ type->name); ++ G_GNUC_BEGIN_IGNORE_DEPRECATIONS ++ pixbuf = gdk_pixbuf_new_from_inline (-1, (guint8 *) icon_data, TRUE, NULL); ++ G_GNUC_END_IGNORE_DEPRECATIONS + } else if (type->pixmap_file != NULL) { + GError *error = NULL; + pixbuf = gdk_pixbuf_new_from_file (type->pixmap_file, &error); +@@ -1419,7 +1425,8 @@ dia_object_type_get_icon (const DiaObjectType *type) + g_clear_error (&error); + } + } else { +- pixbuf = xpm_pixbuf_load (icon_data); ++ const char **pixmap_data = icon_data; ++ pixbuf = gdk_pixbuf_new_from_xpm_data (pixmap_data); + } + + return pixbuf; +diff --git a/meson.build b/meson.build +index 75d100d..4b3548f 100644 +--- a/meson.build ++++ b/meson.build +@@ -22,7 +22,6 @@ libxml_dep = dependency('libxml-2.0', version: '>= 2.14.0') + gmodule_dep = dependency('gmodule-2.0') + libcairo_dep = dependency('cairo') + graphene_dep = dependency('graphene-1.0', version: '>= 1.10') +-xpm_dep = dependency('xpm-pixbuf') + + # Not required since not all platforms ship a separate libm. + libm_dep = cc.find_library('m', required: false) diff --git a/srcpkgs/dia/template b/srcpkgs/dia/template index 5a502bc3d76fef..5b7f5bfd960fcb 100644 --- a/srcpkgs/dia/template +++ b/srcpkgs/dia/template @@ -1,18 +1,20 @@ # Template file for 'dia' pkgname=dia -version=0.97.3 -revision=4 -build_style=gnu-configure -hostmakedepends="pkg-config intltool docbook-xsl" -makedepends="gtk+-devel libxml2-devel freetype-devel libpng-devel - libart-devel libxslt-devel" +version=0.98.0pre20260221 +revision=2 +_commit=8984f704cb502a6867b67228f01708cbc57e21f0 +build_style=meson +build_helper="python3" +hostmakedepends="pkg-config gettext docbook-xsl libxslt glib-devel + AppStream" +makedepends="gtk+3-devel libxml2-devel freetype-devel libpng-devel + libglib-devel cairo-devel graphene-devel poppler-devel poppler-cpp-devel + libart-devel libxslt-devel gdk-pixbuf-devel python3-devel" short_desc="GTK+ based diagram creation program" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://wiki.gnome.org/Apps/Dia" distfiles="${GNOME_SITE}/dia/${version%.*}/dia-${version}.tar.xz" -checksum=22914e48ef48f894bb5143c5efc3d01ab96e0a0cde80de11058d3b4301377d34 - -post_patch() { - vsed -i -e 's/DATADIRNAME=lib/DATADIRNAME=share/' configure -} +distfiles="https://gitlab.gnome.org/GNOME/dia/-/archive/${_commit}/dia-${_commit}.tar.gz" +checksum=6eecdbfc21c3342ca271c0b90357c1ad01c29a8a66c71112ffe2c76622c29dd3 +python_version=3