[137432] trunk/dports/graphics/gtksee

ryandesign at macports.org ryandesign at macports.org
Wed Jun 10 22:51:32 PDT 2015


Revision: 137432
          https://trac.macports.org/changeset/137432
Author:   ryandesign at macports.org
Date:     2015-06-10 22:51:31 -0700 (Wed, 10 Jun 2015)
Log Message:
-----------
gtksee: add dependencies; add patch to build with libpng 1.5+ (#48011); revbump for libpng update; build with the right -arch flags; update homepage and master_sites to mirrors; disable livecheck because this is ancient

Modified Paths:
--------------
    trunk/dports/graphics/gtksee/Portfile

Added Paths:
-----------
    trunk/dports/graphics/gtksee/files/
    trunk/dports/graphics/gtksee/files/patch-libpng-1.5.diff

Modified: trunk/dports/graphics/gtksee/Portfile
===================================================================
--- trunk/dports/graphics/gtksee/Portfile	2015-06-11 05:35:09 UTC (rev 137431)
+++ trunk/dports/graphics/gtksee/Portfile	2015-06-11 05:51:31 UTC (rev 137432)
@@ -4,16 +4,37 @@
 
 name		gtksee
 version		0.6.0b-1
+revision            1
 description	A simple image viewer based on GTK+ 1.2.x and running on X Window System.
 long_description	${description}
 maintainers	nomaintainer
 categories	graphics x11
 license		GPL-2+
 platforms	darwin
-homepage	http://gtksee.berlios.de/
-master_sites	http://download.berlios.de/gtksee/
+
+homepage            https://web.archive.org/web/20140406223707/http://gtksee.berlios.de/
+master_sites        sourceforge:gtksee.berlios
+
 checksums	md5 faf4196ea38df0da93d9f403c03883a3
-depends_lib	lib:libgtk.1:gtk1
+
+depends_lib         port:gettext \
+                    port:glib1 \
+                    port:gtk1 \
+                    port:jpeg \
+                    port:libpng \
+                    port:tiff \
+                    port:xorg-libX11 \
+                    port:xorg-libXext \
+                    port:zlib \
+
+patchfiles          patch-libpng-1.5.diff
+
+variant universal {}
+
 configure.args	--mandir=${prefix}/share/man
-configure.cppflags-append "-L${prefix}/lib"
+
+build.args          CC="${configure.cc} [get_canonical_archflags cc]"
+
 destroot.destdir    prefix=${destroot}${prefix}
+
+livecheck.type      none

Added: trunk/dports/graphics/gtksee/files/patch-libpng-1.5.diff
===================================================================
--- trunk/dports/graphics/gtksee/files/patch-libpng-1.5.diff	                        (rev 0)
+++ trunk/dports/graphics/gtksee/files/patch-libpng-1.5.diff	2015-06-11 05:51:31 UTC (rev 137432)
@@ -0,0 +1,145 @@
+Fix build with libpng 1.5+
+--- src/detect.c.orig	2004-11-02 21:13:13.000000000 -0600
++++ src/detect.c	2015-06-11 00:22:38.000000000 -0500
+@@ -123,14 +123,16 @@
+ detect_png(guchar *filename, ImageInfo *info)
+ {
+ #ifdef HAVE_LIBPNG
+-   png_info pnginfo;
++   gint width;
++   gint height;
++   png_byte color_type;
+ 
+-   if (png_get_header(filename, &pnginfo))
++   if (png_get_header(filename, &width, &height, &color_type))
+    {
+       info->type = PNG;
+-      info->width = pnginfo.width;
+-      info->height = pnginfo.height;
+-      switch (pnginfo.color_type)
++      info->width = width;
++      info->height = height;
++      switch (color_type)
+       {
+          case PNG_COLOR_TYPE_RGB :
+             info->ncolors = 24;
+--- src/im_png.c.orig	2004-02-14 09:16:33.000000000 -0600
++++ src/im_png.c	2015-06-11 00:22:38.000000000 -0500
+@@ -55,7 +55,7 @@
+  */
+ 
+ gboolean
+-png_get_header(gchar *filename, png_info *info)
++png_get_header(gchar *filename, gint *width, gint *height, png_bytep color_type)
+ {
+    png_struct  *pp;
+    png_info    *linfo;
+@@ -99,10 +99,9 @@
+    png_init_io(pp, fp);
+    png_read_info(pp, linfo);
+ 
+-   info->width       = linfo->width;
+-   info->height      = linfo->height;
+-   info->valid       = linfo->valid;
+-   info->color_type  = linfo->color_type;
++   *width       = png_get_image_width(pp, linfo);
++   *height      = png_get_image_height(pp, linfo);
++   *color_type  = png_get_color_type(pp, linfo);
+ 
+    g_free(linfo);
+    g_free(pp);
+@@ -161,26 +160,30 @@
+    png_init_io(pp, fp);
+    png_read_info(pp, info);
+ 
+-   if (info->bit_depth < 8)
++   if (png_get_bit_depth(pp, info) < 8)
+    {
+       png_set_packing(pp);
+       png_set_expand(pp);
+ 
+-      if (info->valid & PNG_INFO_sBIT)
+-         png_set_shift(pp, &(info->sig_bit));
++      if (png_get_valid(pp, info, PNG_INFO_sBIT)) {
++         png_color_8p sig_bit;
++         png_get_sBIT(pp, info, &sig_bit);
++
++         png_set_shift(pp, sig_bit);
++      }
+    } else
+-   if (info->bit_depth == 16)
++   if (png_get_bit_depth(pp, info) == 16)
+       png_set_strip_16(pp);
+ 
+    /*
+     * Turn on interlace handling...
+     */
+-   if (info->interlace_type)
++   if (png_get_interlace_type(pp, info))
+       num_passes = png_set_interlace_handling(pp);
+    else
+       num_passes = 1;
+ 
+-   switch (info->color_type)
++   switch (png_get_color_type(pp, info))
+    {
+       case PNG_COLOR_TYPE_RGB :           /* RGB */
+          bpp = 3;
+@@ -195,22 +198,30 @@
+          bpp = 2;
+          break;
+       case PNG_COLOR_TYPE_PALETTE :       /* Indexed */
+-         bpp = info->num_trans ? 4:3;
++         {
++           png_bytep trans_alpha;
++           int num_trans;
++           png_color_16p trans_color;
++
++           png_get_tRNS(pp, info, &trans_alpha, &num_trans, &trans_color);
++
++           bpp = num_trans ? 4:3;
++         }
+          break;
+    };
+ 
+-   pixel = g_malloc(sizeof(guchar) * info->width * bpp);
++   pixel = g_malloc(sizeof(guchar) * png_get_image_width(pp, info) * bpp);
+ 
+    for (pass = 0; pass < num_passes; pass++)
+    {
+-      for (scanline = 0; scanline < info->height; scanline++)
++      for (scanline = 0; scanline < png_get_image_height(pp, info); scanline++)
+       {
+-         if (info->color_type == PNG_COLOR_TYPE_PALETTE)
++         if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE)
+             png_set_expand(pp);
+ 
+             png_read_row(pp, pixel, NULL);
+ 
+-         if ((*func) (pixel, info->width, 0, scanline, bpp, -1, 0)) goto png_read_cancelled;
++         if ((*func) (pixel, png_get_image_width(pp, info), 0, scanline, bpp, -1, 0)) goto png_read_cancelled;
+       };
+    };
+ 
+--- src/im_png.h.orig	2004-02-14 09:16:33.000000000 -0600
++++ src/im_png.h	2015-06-11 00:22:38.000000000 -0500
+@@ -31,7 +31,7 @@
+ 
+ typedef	gboolean	(*PngLoadFunc)		(guchar *buffer, gint width, gint left, gint scanline, gint components, gint pass, gint mode);
+ 
+-gboolean	png_get_header		(gchar *filename, png_info *info);
++gboolean	png_get_header		(gchar *filename, gint *, gint *, png_bytep);
+ gboolean	png_load		(gchar *filename, PngLoadFunc func);
+ 
+ #endif /* HAVE_LIBPNG */
+--- src/savefile.c.orig	2004-06-26 18:06:13.000000000 -0500
++++ src/savefile.c	2015-06-11 00:22:38.000000000 -0500
+@@ -187,7 +187,7 @@
+       return;
+    }
+ 
+-   if (setjmp(png_ptr->jmpbuf))
++   if (png_jmpbuf(png_ptr))
+    {
+       fclose(fp);
+       png_destroy_write_struct(&png_ptr,  (png_infopp)NULL);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150610/c7f44779/attachment-0001.html>


More information about the macports-changes mailing list