[includes patch] print/gimp-gutenprint fails to build on 14.0-CURRENT 1400079

From: José_Pérez <fbl_at_aoek.com>
Date: Sun, 12 Feb 2023 23:37:31 UTC
Hi,
I get the following error when poudriere building print/gimp-gutenprint 
on 14.0-CURRENT 1400079:
/usr/local/include/glib-2.0/glib/gmacros.h:1211:44: note: expanded from 
macro 'G_DEPRECATED_FOR'
#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' 
instead")))
                                            ^
print.c:117:29: error: incompatible pointer to integer conversion 
passing 'void *' to parameter of type 'gint32' (aka 'int') 
[-Wint-conversion]
   gint x = gimp_image_width(image_ID);
                             ^~~~~~~~
/usr/local/include/gimp-2.0/libgimp/gimpimage_pdb.h:49:86: note: passing 
argument to parameter 'image_ID' here
gint                     gimp_image_width                      (gint32   
             image_ID);
                                                                          
             ^
print.c:118:30: error: incompatible pointer to integer conversion 
passing 'void *' to parameter of type 'gint32' (aka 'int') 
[-Wint-conversion]
   gint y = gimp_image_height(image_ID);
                              ^~~~~~~~
/usr/local/include/gimp-2.0/libgimp/gimpimage_pdb.h:50:86: note: passing 
argument to parameter 'image_ID' here
gint                     gimp_image_height                     (gint32   
             image_ID);
                                                                          
             ^
print.c:234:14: warning: 'gimp_drawable_get' is deprecated: Use 
'gimp_drawable_get_buffer' instead [-Wdeprecated-declarations]
   drawable = gimp_drawable_get (drawable_ID);
              ^
/usr/local/include/gimp-2.0/libgimp/gimpdrawable.h:51:1: note: 
'gimp_drawable_get' has been explicitly marked deprecated here
GIMP_DEPRECATED_FOR(gimp_drawable_get_buffer)
^
/usr/local/include/gimp-2.0/libgimpbase/gimpbasetypes.h:43:32: note: 
expanded from macro 'GIMP_DEPRECATED_FOR'
#define GIMP_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
                                ^
/usr/local/include/glib-2.0/glib/gmacros.h:1211:44: note: expanded from 
macro 'G_DEPRECATED_FOR'
#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' 
instead")))
                                            ^
print.c:254:52: warning: 'gimp_gamma' is deprecated 
[-Wdeprecated-declarations]
   stp_set_float_parameter(gimp_vars.v, "AppGamma", gimp_gamma());
                                                    ^
/usr/local/include/gimp-2.0/libgimp/gimp.h:347:1: note: 'gimp_gamma' has 
been explicitly marked deprecated here
GIMP_DEPRECATED
^
/usr/local/include/gimp-2.0/libgimpbase/gimpbasetypes.h:42:25: note: 
expanded from macro 'GIMP_DEPRECATED'
#define GIMP_DEPRECATED G_DEPRECATED
                         ^
/usr/local/include/glib-2.0/glib/gmacros.h:1201:37: note: expanded from 
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
                                     ^
print.c:514:7: warning: 'gimp_tile_cache_ntiles' is deprecated 
[-Wdeprecated-declarations]
       gimp_tile_cache_ntiles ((drawable->height + gimp_tile_width () - 
1) /
       ^
/usr/local/include/gimp-2.0/libgimp/gimptile.h:59:1: note: 
'gimp_tile_cache_ntiles' has been explicitly marked deprecated here
GIMP_DEPRECATED
^
/usr/local/include/gimp-2.0/libgimpbase/gimpbasetypes.h:42:25: note: 
expanded from macro 'GIMP_DEPRECATED'
#define GIMP_DEPRECATED G_DEPRECATED
                         ^
/usr/local/include/glib-2.0/glib/gmacros.h:1201:37: note: expanded from 
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
                                     ^
print.c:517:7: warning: 'gimp_tile_cache_ntiles' is deprecated 
[-Wdeprecated-declarations]
       gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) 
/
       ^
/usr/local/include/gimp-2.0/libgimp/gimptile.h:59:1: note: 
'gimp_tile_cache_ntiles' has been explicitly marked deprecated here
GIMP_DEPRECATED
^
/usr/local/include/gimp-2.0/libgimpbase/gimpbasetypes.h:42:25: note: 
expanded from macro 'GIMP_DEPRECATED'
#define GIMP_DEPRECATED G_DEPRECATED
                         ^
/usr/local/include/glib-2.0/glib/gmacros.h:1201:37: note: expanded from 
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
                                     ^
print.c:539:3: warning: 'gimp_drawable_detach' is deprecated 
[-Wdeprecated-declarations]
   gimp_drawable_detach (drawable);
   ^
/usr/local/include/gimp-2.0/libgimp/gimpdrawable.h:53:1: note: 
'gimp_drawable_detach' has been explicitly marked deprecated here
GIMP_DEPRECATED
^
/usr/local/include/gimp-2.0/libgimpbase/gimpbasetypes.h:42:25: note: 
expanded from macro 'GIMP_DEPRECATED'
#define GIMP_DEPRECATED G_DEPRECATED
                         ^
/usr/local/include/glib-2.0/glib/gmacros.h:1201:37: note: expanded from 
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
                                     ^
7 warnings and 2 errors generated.
gmake[1]: *** [Makefile:549: print.o] Error 1
gmake[1]: Leaving directory 
'/wrkdirs/usr/ports/print/gimp-gutenprint/work/gutenprint-5.3.3/src/gimp2'
*** Error code 1

Stop.
make: stopped in /usr/ports/print/gimp-gutenprint

I fixed with this patch:
--- src/gimp2/print.c.orig      2023-02-13 00:19:26.381303000 +0100
+++ src/gimp2/print.c   2023-02-13 00:20:10.617649000 +0100
@@ -114,8 +114,8 @@
  {
    if (gimp_thumbnail_data)
      g_free(gimp_thumbnail_data);
-  gint x = gimp_image_width(image_ID);
-  gint y = gimp_image_height(image_ID);
+  gint x = gimp_image_width(p2gint(image_ID));
+  gint y = gimp_image_height(p2gint(image_ID));
    if (*width > x)
      *width = x;
    if (*height > y)


This is a bug that gets triggered by the use of llvm 15 and I think 
should be pushed upstream. Anyone with upstream contacts?

BR,

-- 
José Pérez