Package Details: dia-git 6883.78c75625d-1

Git Clone URL: https://aur.archlinux.org/dia-git.git (read-only, click to copy)
Package Base: dia-git
Description: A GTK+ based diagram creation program
Upstream URL: https://gitlab.gnome.org/GNOME/dia
Licenses: GPL-2.0-or-later
Conflicts: dia
Provides: dia
Submitter: lilac
Maintainer: a821
Last Packager: a821
Votes: 2
Popularity: 0.012055
First Submitted: 2019-05-08 01:07 (UTC)
Last Updated: 2024-11-10 14:29 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 Next › Last »

bertieb commented on 2023-09-22 13:11 (UTC) (edited on 2023-09-22 13:49 (UTC) by bertieb)

This currently fails nearly the end of the ninja build process:

Writing index.html for book(index)
[563/565] Generating sheets/BPMN.sheet with a custom command
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...
:: Unable to build dia-git - makepkg exited with code: 4

It does not report what failed in the subcommand, which seems to be defined in build.ninja as (I am using trizen as an AUR helper, datadirs may be different):

build sheets/BPMN.sheet: CUSTOM_COMMAND ../sheets/BPMN.sheet
 COMMAND = /usr/bin/meson --internal msgfmthelper --msgfmt=/usr/bin/msgfmt --datadirs=/tmp/trizen-bertieb/dia-git/src/dia/po ../sheets/BPMN.sheet sheets/BPMN.sheet xml /tmp/trizen-bertieb/dia-git/src/dia/po
 description = Generating$ sheets/BPMN.sheet$ with$ a$ custom$ command

Interestingly, running that command by itself seems to work- it generates sheets/BPMN.sheet and exits with status 0.

The issue /seems/ to be building dia.pdf, dblatex seems broken (running it gives "ModuleNotFoundError: No module named 'dbtexmf').

I decided it wasn't worth the time figuring out how to fix dblatex (a gentoo bug implies later python versions break it: https://bugs.gentoo.org/723412), so I decided to skip building the docs by adding the following to the prepare() step in PKGBUILD sed -i '159,161d' meson.build.

There's probably a better way of doing this as 'docs' are an option that meson should check for, but no option (I tried removing the 'docs' option or setting '!docs' (followed by meson setup --wipe) could persuade meson not to build it.

haawda commented on 2022-11-01 15:30 (UTC)

I thing the line numbers are partially wrong, try this:

--- plug-ins/pdf/pdf-import.cpp 2022-05-25 17:35:28.000000000 +0200
+++ plug-ins/pdf/pdf-import.cpp 2022-09-27 20:25:47.183817900 +0200
@@ -152,13 +152,12 @@ public :
   void
   updateLineDash (GfxState *state)
   {
-    double *dashPattern;
-    int dashLength;
-    double dashStart;
-
-    state->getLineDash (&dashPattern, &dashLength, &dashStart);
-    this->dash_length = dashLength ? dashPattern[0] * scale : 1.0;
-
+    const double *dashPattern=NULL;
+    int dashLength=0;
+    double dashStart=0;
+    const std::vector<double> &dash = state->getLineDash(&dashStart);  // > Poppler 22.09 ...
+    dashPattern = dash.data();
+    dashLength = dash.size();
     if (dashLength == 0)
       this->line_style = DIA_LINE_STYLE_SOLID;
     else if (dashLength > 5)
@@ -318,10 +317,10 @@ public :
     //FIXME: Dia is really unhappy about zero size fonts
     if (!(state->getFontSize() > 0.0))
       return;
-    GfxFont *f = state->getFont();
-
+   const std::shared_ptr<GfxFont> f = state->getFont();  // poppler 22.05 ... header changed
+   gconstpointer f1 = &f;  // GLib typedef const void * gconstpointer;
     // instead of building the same font over and over again
-    if (g_hash_table_lookup (this->font_map, f)) {
+    if (g_hash_table_lookup (this->font_map, f1)) {
       ++font_map_hits;
       return;
     }
@@ -333,8 +332,9 @@ public :
     gchar *family = g_strdup (f->getFamily() ? f->getFamily()->c_str() : "sans");

     // we are (not anymore) building the same font over and over again
+    f1  = &f;
     g_print ("Font 0x%x: '%s' size=%g (* %g)\n",
-        GPOINTER_TO_INT (f), family, state->getTransformedFontSize(), scale);
+        GPOINTER_TO_INT (f1), family, state->getTransformedFontSize(), scale);

     // now try to make a fontname Dia/Pango can cope with
     // strip style postfix - we already have extracted the style bits above
@@ -353,8 +353,9 @@ public :
     if (fm[0] != 0)
       fsize *= fabs(fm[3] / fm[0]);
     font = dia_font_new (family, style, fsize * scale / 0.8);
-
-    g_hash_table_insert (this->font_map, f, font);
+   f1  = &f;
+   gpointer f2 = (gpointer)f1;  // GLib typedef void* gpointer;
+    g_hash_table_insert (this->font_map, f2, font);
     g_free (family);
   }
   void updateTextShift(GfxState *state, double shift)
@@ -721,11 +722,15 @@ DiaOutputDev::drawString(GfxState *state
     return;
   if (!(state->getFontSize() > 0.0))
     return;
-  font = (DiaFont *)g_hash_table_lookup (this->font_map, state->getFont());
+gconstpointer f_1 = &state->getFont();
+// g_print ("f_1 %p\n", f_1);
+font = (DiaFont *)g_hash_table_lookup (this->font_map, f_1);
+//  font = (DiaFont *)g_hash_table_lookup (this->font_map, &(state->getFont()));

   // we have to decode the string data first
   {
-    GfxFont *f = state->getFont();
+//    GfxFont *f = state->getFont();
+   const std::shared_ptr<GfxFont> f = state->getFont();
     const char *p = s->c_str();
     CharCode code;
     int   j = 0, m, n;
@@ -870,8 +875,10 @@ import_pdf(const gchar *filename, Diagra
   std::unique_ptr<PDFDoc> doc;
   GooString *fileName = new GooString(filename);
   // no passwords yet
-  GooString *ownerPW = NULL;
-  GooString *userPW = NULL;
+  //GooString *ownerPW = NULL;
+  //GooString *userPW = NULL;
+  const std::optional<GooString> ownerPW;
+  const std::optional<GooString> userPW;
   gboolean ret = FALSE;

   // without this we will get strange crashes (at least with /O2 build)
@@ -899,7 +906,8 @@ import_pdf(const gchar *filename, Diagra
     delete diaOut;
     ret = TRUE;
   }
-  delete fileName;
+ doc.reset();
+ delete fileName;

   return ret;
 }

porcaror commented on 2022-10-15 10:45 (UTC)

Sorry to disturb you again. I tried it but it didn't work. This is the error message:

==> Making package: dia-git 6672.4cd048d43-2 (Sat Oct 15 12:40:32 2022) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... -> Updating dia git repo... -> Found pdf-import.patch ==> Validating source files with md5sums... dia ... Skipped pdf-import.patch ... Skipped ==> Extracting sources... -> Creating working copy of dia git repo... Reset branch 'makepkg' ==> Starting prepare()... patching file plug-ins/pdf/pdf-import.cpp Hunk #3 FAILED at 332. 1 out of 7 hunks FAILED -- saving rejects to file plug-ins/pdf/pdf-import.cpp.rej ==> ERROR: A failure occurred in prepare(). Aborting...

yoshi3 commented on 2022-10-05 14:30 (UTC) (edited on 2022-10-05 14:31 (UTC) by yoshi3)

working patch pdf-import & poppler 22.09 :

--- plug-ins/pdf/pdf-import.cpp 2022-05-25 17:35:28.000000000 +0200
+++ plug-ins/pdf/pdf-import.cpp 2022-09-27 20:25:47.183817900 +0200
@@ -152,13 +152,12 @@
   void
   updateLineDash (GfxState *state)
   {
-    double *dashPattern;
-    int dashLength;
-    double dashStart;
-
-    state->getLineDash (&dashPattern, &dashLength, &dashStart);
-    this->dash_length = dashLength ? dashPattern[0] * scale : 1.0;
-
+    const double *dashPattern=NULL;
+    int dashLength=0;
+    double dashStart=0;
+    const std::vector<double> &dash = state->getLineDash(&dashStart);  // > Poppler 22.09 ...
+    dashPattern = dash.data();
+    dashLength = dash.size();
     if (dashLength == 0)
       this->line_style = DIA_LINE_STYLE_SOLID;
     else if (dashLength > 5)
@@ -318,10 +317,10 @@
     //FIXME: Dia is really unhappy about zero size fonts
     if (!(state->getFontSize() > 0.0))
       return;
-    GfxFont *f = state->getFont();
-
+   const std::shared_ptr<GfxFont> f = state->getFont();  // poppler 22.05 ... header changed
+   gconstpointer f1 = &f;  // GLib typedef const void * gconstpointer;
     // instead of building the same font over and over again
-    if (g_hash_table_lookup (this->font_map, f)) {
+    if (g_hash_table_lookup (this->font_map, f1)) {
       ++font_map_hits;
       return;
     }
@@ -333,8 +332,8 @@
     gchar *family = g_strdup (f->getFamily() ? f->getFamily()->c_str() : "sans");

     // we are (not anymore) building the same font over and over again
-    g_print ("Font 0x%x: '%s' size=%g (* %g)\n",
-        GPOINTER_TO_INT (f), family, state->getTransformedFontSize(), scale);
+   f1  = &f;
+    g_print ("Font 0x%x: '%s' size=%g (* %g)\n", GPOINTER_TO_INT (f1), family, state->getTransformedFontSize(), scale);

     // now try to make a fontname Dia/Pango can cope with
     // strip style postfix - we already have extracted the style bits above
@@ -353,8 +352,9 @@
     if (fm[0] != 0)
       fsize *= fabs(fm[3] / fm[0]);
     font = dia_font_new (family, style, fsize * scale / 0.8);
-
-    g_hash_table_insert (this->font_map, f, font);
+   f1  = &f;
+   gpointer f2 = (gpointer)f1;  // GLib typedef void* gpointer;
+    g_hash_table_insert (this->font_map, f2, font);
     g_free (family);
   }
   void updateTextShift(GfxState *state, double shift)
@@ -721,11 +721,15 @@
     return;
   if (!(state->getFontSize() > 0.0))
     return;
-  font = (DiaFont *)g_hash_table_lookup (this->font_map, state->getFont());
+gconstpointer f_1 = &state->getFont();
+// g_print ("f_1 %p\n", f_1);
+font = (DiaFont *)g_hash_table_lookup (this->font_map, f_1);   
+//  font = (DiaFont *)g_hash_table_lookup (this->font_map, &(state->getFont()));

   // we have to decode the string data first
   {
-    GfxFont *f = state->getFont();
+//    GfxFont *f = state->getFont();
+   const std::shared_ptr<GfxFont> f = state->getFont();      
     const char *p = s->c_str();
     CharCode code;
     int   j = 0, m, n;
@@ -870,8 +874,10 @@
   std::unique_ptr<PDFDoc> doc;
   GooString *fileName = new GooString(filename);
   // no passwords yet
-  GooString *ownerPW = NULL;
-  GooString *userPW = NULL;
+  //GooString *ownerPW = NULL;
+  //GooString *userPW = NULL;
+  const std::optional<GooString> ownerPW;
+  const std::optional<GooString> userPW;
   gboolean ret = FALSE;

   // without this we will get strange crashes (at least with /O2 build)
@@ -899,7 +905,8 @@
     delete diaOut;
     ret = TRUE;
   }
-  delete fileName;
+ doc.reset();
+ delete fileName;

   return ret;
 }

jfernandz commented on 2022-10-04 13:08 (UTC)

The PKGBUILD @haawda posted is fine, but he has a typo at L15, that line should just be 'libblockdev' 'libgexiv2')

Also you will have to regenerate the .SRCINFO, but still I'm not able to build it, there's still a problem with pdf-import plugin

[410/447] Compiling C++ object plug-ins/libpdf_filter.so.p/pdf_pdf-import.cpp.o
FAILED: plug-ins/libpdf_filter.so.p/pdf_pdf-import.cpp.o 
c++ -Iplug-ins/libpdf_filter.so.p -Iplug-ins -I../plug-ins -I. -I.. -Ilib -I../lib -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/poppler -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_2_24 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_2_24 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_58 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_58 -DGSEAL_ENABLE -DGTK_DISABLE_DEPRECATED -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -mfpmath=sse -msse -msse2 -pthread -MD -MQ plug-ins/libpdf_filter.so.p/pdf_pdf-import.cpp.o -MF plug-ins/libpdf_filter.so.p/pdf_pdf-import.cpp.o.d -o plug-ins/libpdf_filter.so.p/pdf_pdf-import.cpp.o -c ../plug-ins/pdf/pdf-import.cpp
../plug-ins/pdf/pdf-import.cpp: In member function ‘virtual void DiaOutputDev::updateLineDash(GfxState*)’:
../plug-ins/pdf/pdf-import.cpp:159:24: error: no matching function for call to ‘GfxState::getLineDash(double**, int*, double*)’
  159 |     state->getLineDash (&dashPattern, &dashLength, &dashStart);
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/poppler/OutputDev.h:45,
                 from ../plug-ins/pdf/pdf-import.cpp:34:
/usr/include/poppler/GfxState.h:1506:32: note: candidate: ‘const std::vector<double>& GfxState::getLineDash(double*)’
 1506 |     const std::vector<double> &getLineDash(double *start)
      |                                ^~~~~~~~~~~
/usr/include/poppler/GfxState.h:1506:32: note:   candidate expects 1 argument, 3 provided
[419/447] Linking target plug-ins/libvdx_filter.so
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...

Not sure how may I improve the patch for this file in order to get a sucessful build.

porcaror commented on 2022-09-25 17:11 (UTC) (edited on 2022-09-25 17:11 (UTC) by porcaror)

Hi. I tried to compile with python instead of python2 (which is now declared obsolete) using your makepkg for python3 (by the way I think there is a typo in 6 after 'libgexiv2'), but it didin't work. Can you help me, please? This is my console error in building the package:

ninja: build stopped: subcommand failed. ==> ERROR: A failure occurred in build(). Aborting...

haawda commented on 2022-08-31 15:28 (UTC)

it is possible

# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Gregor Ibic <gregor.ibic@intelicom.si>

pkgname=dia-git
_pkgname=dia
pkgver=6672.4cd048d43
pkgrel=2
pkgdesc="A GTK+ based diagram creation program (GIT VERSION)"
arch=('x86_64')
license=('GPL')
url="http://live.gnome.org/Dia"
depends=('poppler' 'python' 'libxslt' 'gtk2' 'freetype2' 'graphene' 'gst-python' 'libibus'
     'libblockdev' 'libgexiv2'6)
makedepends=('git' 'cmake' 'meson' 'intltool' 'dblatex' 'python' 'docbook-xsl')
provides=('dia')
conflicts=('dia')
options=('docs' '!emptydirs')
source=("git+https://gitlab.gnome.org/GNOME/dia.git" "pdf-import.patch")
md5sums=('SKIP'
         '741e89bf69b002e7bf40f62631bb1e7b')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  patch -p0 < ../pdf-import.patch
}

build() {
  cd "${srcdir}/${_pkgname}"

  arch-meson . build
  ninja -C build
}

package() {
  cd "${srcdir}/${_pkgname}"
  DESTDIR="${pkgdir}" ninja -C build install
}

haawda commented on 2022-08-28 04:56 (UTC)

having python2 as both hard and optional dependency makes no sense. Can we get rid entirely of python2?