Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions srcpkgs/dia/patches/gcc14.patch

This file was deleted.

16 changes: 0 additions & 16 deletions srcpkgs/dia/patches/isinf.patch

This file was deleted.

23 changes: 23 additions & 0 deletions srcpkgs/dia/patches/libxml2.patch
Original file line number Diff line number Diff line change
@@ -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,
26 changes: 26 additions & 0 deletions srcpkgs/dia/patches/poppler-26.06.patch
Original file line number Diff line number Diff line change
@@ -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 <nadzeya@ubuntu.com>
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);
232 changes: 232 additions & 0 deletions srcpkgs/dia/patches/revert_xpm_loader_replacement.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
From: Philippe SWARTVAGHER <phil.swart@gmx.fr>
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 <stdio.h>

-#include <xpm-pixbuf.h>
-
#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 <glib/gi18n-lib.h>

-#include <xpm-pixbuf.h>
-
#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 <gtk/gtk.h>

-#include <xpm-pixbuf.h>
-
#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 <glib/gi18n-lib.h>

-#include <xpm-pixbuf.h>
-
#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 <glib/gi18n-lib.h>

#include <gtk/gtk.h>
-
-#include <xpm-pixbuf.h>
-
#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 <stdio.h>
#include <string.h>

-#include <xpm-pixbuf.h>
-
#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)
24 changes: 13 additions & 11 deletions srcpkgs/dia/template
Original file line number Diff line number Diff line change
@@ -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

Check failure on line 4 in srcpkgs/dia/template

View workflow job for this annotation

GitHub Actions / Lint templates

Template Lint

revision should be set to 1 on update
_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 <orphan@voidlinux.org>"
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
Loading