Package Details: dia-git 6871.4139f5aff-2

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://wiki.gnome.org/action/show/Apps/Dia
Licenses: GPL-2.0-or-later
Conflicts: dia
Provides: dia
Submitter: lilac
Maintainer: a821
Last Packager: a821
Votes: 1
Popularity: 0.000000
First Submitted: 2019-05-08 01:07 (UTC)
Last Updated: 2024-05-11 10:29 (UTC)

Latest Comments

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

a821 commented on 2024-03-23 11:44 (UTC)

@Richardk2n is correct. The issue/regression seems to be dblatex. I found two workarounds:

  1. Downgrade dblatex and use version 0.3.12-7 (can be found in the archive) or
  2. patch /usr/bin/dblatex: line 5 should be package_base = os.path.join(os.path.dirname(sys.argv[0]), "../share/dblatex")

RAMChYLD commented on 2024-03-10 09:49 (UTC)

@Richardk2n Thanks for the heads up!

Richardk2n commented on 2024-03-08 09:26 (UTC)

@RAMChYLD The package shipping latex_book_fast.xsl and mkdoclist.xsl is dblatex, which recently got updated. The files still exist but on a different path (/usr/share/dblatex/xsl/ instead of /usr/xsl/)

RAMChYLD commented on 2024-03-07 21:01 (UTC)

I found two issues with the current dia upstream. This might not be necessary in the future once it is future once it is fixed but I hope it will come in handy for those who needs Dia but run into trouble building it.

The first issue is it's not compatible with the current version of OGDF, Elderberry. Apparently Elderberry no longer ships with some headers that Dia wants to use, breaking it. I have yet to investigate what is the last version of OGDF Dia will build with, but what I can see is that it can be built without OGDF as a workaround for the time being.

The second issue is that the docs depend on some xsl files that no longer exists. For this I edited the PKGBUILD manually to set -Ddoc=false. I'm not sure what packages holds those files.

hildigerr commented on 2023-10-22 20:17 (UTC) (edited on 2023-10-24 00:27 (UTC) by hildigerr)

Here are a couple patches to enable XDG Base Directory Specification compliance.

0-the_asnwer_is_no.patch:

diff --git a/app/app_procs.c b/app/app_procs.c
index 3199a8dea..86964f7e0 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -1041,24 +1041,10 @@ create_user_dirs (void)
 {
   gchar *dir, *subdir;

-#ifdef G_OS_WIN32
-  /* not necessary to quit the program with g_error, everywhere else
-   * dia_config_filename appears to be used. Spit out a warning ...
-   */
-  if (!g_get_home_dir ()) {
-    g_warning (_("Could not create per-user Dia configuration directory"));
-    return; /* ... and return. Probably removes my one and only FAQ. --HB */
-  }
-#endif
-  dir = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S ".dia", NULL);
+  dir = dia_config_filename (NULL);
   if (g_mkdir (dir, 0755) && errno != EEXIST) {
-#ifndef G_OS_WIN32
-    g_critical (_("Could not create per-user Dia configuration directory"));
-    exit (1);
-#else /* HB: it this really a reason to exit the program on *nix ? */
-    g_warning (_("Could not create per-user Dia configuration directory. Please make "
-                 "sure that the environment variable HOME points to an existing directory."));
-#endif
+    g_warning (_("Could not create per-user Dia configuration directory"));
+    return;
   }

   /* it is no big deal if these directories can't be created */

1-xdg_data_home.patch:

index 6440f9e71..162d15a81 100644
--- a/lib/dia_dirs.c
+++ b/lib/dia_dirs.c
@@ -119,7 +119,7 @@ dia_get_locale_directory (void)
  * dia_config_filename:
  * @subfile: Name of the subfile.
  *
- * Get the name of a file under the Dia config directory. If no home
+ * Get the name of a file under the Dia config directory. If no config
  * directory can be found, uses a temporary directory.
  *
  * Returns: A string with the full path of the desired file. This string
@@ -132,12 +132,12 @@ dia_config_filename (const char *subfile)
 {
   const char *homedir;

-  homedir = g_get_home_dir ();
+  homedir = g_get_user_data_dir ();
   if (!homedir) {
     homedir = g_get_tmp_dir (); /* put config stuff in /tmp -- not ideal, but
                                  * we should not reach this state */
   }
-  return g_build_filename (homedir, ".dia", subfile, NULL);
+  return g_build_filename (homedir, "dia", subfile, NULL);
 }

mistersmee commented on 2023-09-28 12:58 (UTC) (edited on 2023-09-28 13:00 (UTC) by mistersmee)

It makes no sense to flag a -git package out of date, without there needing changes to fix sources moving or actual breakage fixing, which in this case, it doesn't, the package builds fine as of 2023-09-28, so can it please be unflagged?

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;
 }