Index: Portfile
===================================================================
--- Portfile	(revision 118846)
+++ Portfile	(working copy)
@@ -5,7 +5,7 @@
 PortGroup           archcheck 1.0
 
 name                librsvg
-version             2.40.1
+version             2.40.2
 license             {GPL-2+ LGPL-2+}
 set branch          [join [lrange [split ${version} .] 0 1] .]
 categories          graphics gnome
@@ -19,10 +19,11 @@
 master_sites        gnome:sources/${name}/${branch}/
 use_xz              yes
 
-checksums           rmd160  6e0212214c7acc6d570d1dbb196bde3678e84525 \
-                    sha256  8813b4fe776d5e7acbce28bacbaed30ccb0cec3734eb3632c711a16ebe2961d7
+checksums           rmd160  06350bcebfa20965afcd15e1ced92e689277e9f9 \
+                    sha256  48049b643294636df7de1a4b997414d699666f5dc44776945c218a257d2a291c
 
-depends_build       port:pkgconfig
+depends_build       port:pkgconfig \
+                    port:gtk-doc
 
 depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                     path:lib/pkgconfig/cairo.pc:cairo \
@@ -30,7 +31,6 @@
                     port:libcroco \
                     port:libxml2 \
                     port:gdk-pixbuf2 \
-                    port:gtk3 \
                     port:vala
 
 
@@ -43,8 +43,6 @@
                     lib/libpangocairo-1.0.dylib \
                     lib/libxml2.dylib
 
-patchfiles          patch-replace-canonicalize-file-name.diff
-
 configure.args      --enable-introspection=yes \
                     --enable-vala=yes \
                     --disable-Bsymbolic
@@ -72,6 +70,19 @@
     close $fp
 }
 
+variant viewer description "Enable the build of the rsvg-viewer-3 utility." {
+    depends_lib-append  port:gtk3
+}
+
+default_variants +viewer
+
+if {![variant_isset viewer]} {
+    patchfiles      patch-disable-viewer.diff
+
+    use_autoreconf  yes
+    autoreconf.args -fvi
+}
+
 post-destroot {
     set python.branch ${pyversion}
     set python.bin ${frameworks_dir}/Python.framework/Versions/${python.branch}/bin/python${python.branch}
Index: files/patch-disable-viewer.diff
===================================================================
--- files/patch-disable-viewer.diff	(revision 0)
+++ files/patch-disable-viewer.diff	(working copy)
@@ -0,0 +1,15 @@
+--- Makefile.am.orig	2014-04-12 10:51:16.000000000 -0700
++++ Makefile.am	2014-04-12 10:52:04.000000000 -0700
+@@ -8,9 +8,9 @@
+ lib_LTLIBRARIES = librsvg-@RSVG_API_MAJOR_VERSION@.la
+ 
+ bin_PROGRAMS = rsvg-convert
+-if HAVE_GTK_3
+-bin_PROGRAMS += rsvg-view-3
+-endif
++#if HAVE_GTK_3
++#bin_PROGRAMS += rsvg-view-3
++#endif
+ 
+ headers = \
+ 	rsvg.h	\
Index: files/patch-replace-canonicalize-file-name.diff
===================================================================
--- files/patch-replace-canonicalize-file-name.diff	(revision 118846)
+++ files/patch-replace-canonicalize-file-name.diff	(working copy)
@@ -1,45 +0,0 @@
-From 02cb19835cb52bd84b0b5eaca1b4d6338417d261 Mon Sep 17 00:00:00 2001
-From: Antoine Jacoutot <ajacoutot@gnome.org>
-Date: Tue, 15 Oct 2013 07:36:30 +0000
-Subject: portability: canonicalize_file_name -> realpath
-
-canonicalize_file_name() is a GNU extension so let's use the portable
-realpath() instead.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=710163
----
-diff --git a/rsvg-base.c b/rsvg-base.c
-index cb9f64a..fb829e7 100644
---- rsvg-base.c
-+++ rsvg-base.c
-@@ -50,6 +50,8 @@
- #include <math.h>
- #include <string.h>
- #include <stdarg.h>
-+#include <limits.h>
-+#include <stdlib.h>
- 
- #include "rsvg-path.h"
- #include "rsvg-paint-server.h"
-@@ -2190,8 +2192,7 @@ _rsvg_handle_allow_load (RsvgHandle *handle,
-     dir = g_file_get_path (base);
-     g_object_unref (base);
- 
--    /* FIXME portability */
--    cdir = canonicalize_file_name (dir);
-+    cdir = realpath (dir, NULL);
-     g_free (dir);
-     if (cdir == NULL)
-         goto deny;
-@@ -2200,8 +2201,7 @@ _rsvg_handle_allow_load (RsvgHandle *handle,
-     if (path == NULL)
-         goto deny;
- 
--    /* FIXME portability */
--    cpath = canonicalize_file_name (path);
-+    cpath = realpath (path, NULL);
-     g_free (path);
- 
-     if (cpath == NULL)
---
-cgit v0.9.2
