From bartender@c0decafe.net  Tue Nov 16 16:10:40 2010
Return-Path: <bartender@c0decafe.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF3AD106567A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Nov 2010 16:10:40 +0000 (UTC)
	(envelope-from bartender@c0decafe.net)
Received: from mail.ogero.gov.lb (mail.ogero.gov.lb [205.177.180.20])
	by mx1.freebsd.org (Postfix) with ESMTP id E79448FC24
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Nov 2010 16:10:39 +0000 (UTC)
Received: from absolut.c0decafe.net (Not Verified[94.187.124.121]) by mail.ogero.gov.lb with MailMarshal (v6,8,3,9481)
	id <B4ce2acf70000>; Tue, 16 Nov 2010 18:10:31 +0200
Received: from absolut.c0decafe.net (localhost [127.0.0.1])
	by absolut.c0decafe.net (8.14.4/8.14.4) with ESMTP id oAGGAYnB097834;
	Tue, 16 Nov 2010 18:10:34 +0200 (EET)
	(envelope-from bartender@c0decafe.net)
Received: (from bartender@localhost)
	by absolut.c0decafe.net (8.14.4/8.14.4/Submit) id oAGGAXp5097822;
	Tue, 16 Nov 2010 18:10:33 +0200 (EET)
	(envelope-from bartender)
Message-Id: <201011161610.oAGGAXp5097822@absolut.c0decafe.net>
Date: Tue, 16 Nov 2010 18:10:33 +0200 (EET)
From: "ports@c0decafe.net" <ports@c0decafe.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gnome@freebsd.org
Subject: [PATCH] devel/libnotify: optional stdin patch
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         152302
>Category:       ports
>Synopsis:       [PATCH] devel/libnotify: optional stdin patch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 16 16:20:08 UTC 2010
>Closed-Date:    Sat Dec 18 20:17:41 UTC 2010
>Last-Modified:  Sat Dec 18 20:17:41 UTC 2010
>Originator:     ports@c0decafe.net
>Release:        FreeBSD 8.1-RELEASE-p1 amd64
>Organization:
c0decafe networks
>Environment:
System: FreeBSD absolut.c0decafe.net 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #1: Tue Sep 21 14:11:34 EEST 2010
>Description:

optional stdin patch from:
- http://www.floodgap.com/software/ttytter/libnotifypatch.txt

Added file(s):
- files/extra-patch-stdin

Port maintainer (gnome@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- libnotify-0.4.5_4.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/devel/libnotify.orig/Makefile /usr/ports/devel/libnotify/Makefile
--- /usr/ports/devel/libnotify.orig/Makefile	2010-06-01 01:52:34.000000000 +0300
+++ /usr/ports/devel/libnotify/Makefile	2010-11-16 17:55:59.000000000 +0200
@@ -22,8 +22,15 @@
 USE_GMAKE=	yes
 USE_LDCONFIG=	yes
 USE_AUTOTOOLS=	libtool:22
-CONFIGURE_ARGS= --without-gtk-doc
+CONFIGURE_ARGS=	--without-gtk-doc
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib"
 
+OPTIONS=	STDIN "With stdin patch" off
+
+post-patch:
+.if !defined(WITHOUT_STDIN)
+	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-stdin
+.endif
+
 .include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/devel/libnotify.orig/distinfo /usr/ports/devel/libnotify/distinfo
--- /usr/ports/devel/libnotify.orig/distinfo	2009-01-10 07:21:26.000000000 +0200
+++ /usr/ports/devel/libnotify/distinfo	2010-11-16 17:56:10.000000000 +0200
@@ -1,3 +1,2 @@
-MD5 (libnotify-0.4.5.tar.gz) = 472e2c1f808848365572a9b024d9e8f5
 SHA256 (libnotify-0.4.5.tar.gz) = 0799db8ea1500b65a477421a8c930cc8c8b0bbc0596e55ea1601e2542f3fb0d9
 SIZE (libnotify-0.4.5.tar.gz) = 364142
diff -ruN --exclude=CVS /usr/ports/devel/libnotify.orig/files/extra-patch-stdin /usr/ports/devel/libnotify/files/extra-patch-stdin
--- /usr/ports/devel/libnotify.orig/files/extra-patch-stdin	1970-01-01 02:00:00.000000000 +0200
+++ /usr/ports/devel/libnotify/files/extra-patch-stdin	2010-11-16 17:48:25.000000000 +0200
@@ -0,0 +1,120 @@
+--- tools/notify-send.c.old	2007-10-15 20:19:20.000000000 -0400
++++ tools/notify-send.c	2007-10-15 21:44:19.000000000 -0400
+@@ -124,12 +124,70 @@
+ 	return TRUE;
+ }
+ 
++static gchar *
++get_file_contents(const gchar *filename)
++{
++	GError *error = NULL;
++	gchar *contents = NULL;
++	gsize length = 0;
++
++	if (!strcmp(filename, "-"))
++	{
++		GIOChannel *channel = NULL;
++		GIOStatus status = G_IO_STATUS_NORMAL;
++
++#if G_OS_WIN32
++		channel = g_io_channel_win32_new_fd(0);
++#else
++		channel = g_io_channel_unix_new(0);
++#endif
++		if (!channel)
++		{
++			fprintf(stderr, "%s\n", error->message);
++			g_error_free(error);
++			exit(1);
++		}
++
++		do {
++			status = g_io_channel_read_to_end(channel,
++					&contents, &length, &error);
++		} while (status == G_IO_STATUS_AGAIN);
++		if (status != G_IO_STATUS_NORMAL)
++		{
++			fprintf(stderr, "%s\n", error->message);
++			g_error_free(error);
++			exit(1);
++		}
++
++		g_io_channel_unref(channel);
++	}
++	else if (!g_file_get_contents(filename, &contents, &length, &error))
++	{
++		fprintf(stderr, "%s\n", error->message);
++		g_error_free(error);
++		exit(1);
++	}
++
++	/* Remove the end-of-file newline */
++	/* Not using g_chomp() to allow users to end with newlines if they like */
++	if (contents[length-2] == '\r' && contents[length-1] == '\n')
++		contents[length-2] = '\0';
++	else if (contents[length-1] == '\n')
++		contents[length-1] = '\0';
++	else if (contents[length-1] == '\r')
++		contents[length-1] = '\0';
++
++	return contents;
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+ 	static const gchar *summary = NULL;
+-	static const gchar *body = "";
+ 	static const gchar *type = NULL;
++	static gchar *body = "";
++	static gchar *body_file = NULL;
++	static gboolean body_allocated = FALSE;
+ 	static gchar *icon_str = NULL;
+ 	static gchar *icons = NULL;
+ 	static gchar **n_text = NULL;
+@@ -147,6 +205,9 @@
+ 		{ "urgency", 'u', 0, G_OPTION_ARG_CALLBACK, g_option_arg_urgency_cb,
+ 		  N_("Specifies the urgency level (low, normal, critical)."),
+ 		  N_("LEVEL") },
++		{ "file", 'f', 0, G_OPTION_ARG_FILENAME, &body_file,
++		  N_("Specifies a file whose contents will form the body of the "
++			 "notification."), N_("FILENAME") },
+ 		{ "expire-time", 't', 0,G_OPTION_ARG_INT, &expire_timeout,
+ 		  N_("Specifies the timeout in milliseconds at which to expire the "
+ 			 "notification."), N_("TIME") },
+@@ -199,7 +260,12 @@
+ 		exit(1);
+ 	}
+ 
+-	if (n_text[1] != NULL)
++	if (n_text[1] != NULL && body_file != NULL)
++	{
++		fprintf(stderr, "%s\n", N_("Only one notification body may be given."));
++		exit(1);
++	}
++	else if (n_text[1] != NULL)
+ 	{
+ 		body = n_text[1];
+ 
+@@ -209,6 +275,11 @@
+ 			exit(1);
+ 		}
+ 	}
++	else if (body_file != NULL)
++	{
++		body = get_file_contents(body_file);
++		body_allocated = TRUE;
++	}
+ 
+ 	if (icons != NULL)
+ 	{
+@@ -273,6 +344,9 @@
+ 
+ 	g_object_unref(G_OBJECT(notify));
+ 
++	if (body_allocated)
++		g_free(body);
++
+ 	notify_uninit();
+ 
+ 	exit(hint_error);
\ No newline at end of file
--- libnotify-0.4.5_4.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Nov 16 16:20:16 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152302 
State-Changed-From-To: open->suspended 
State-Changed-By: marcus 
State-Changed-When: Mon Nov 29 00:40:46 UTC 2010 
State-Changed-Why:  
The patch no longer applies to 0.5.2.  Can you resubmit with an updated patch? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152302 
State-Changed-From-To: suspended->closed 
State-Changed-By: mezz 
State-Changed-When: Sat Dec 18 20:16:59 UTC 2010 
State-Changed-Why:  
Feedback timeout. It's one of reason why I don't support the third-party patch 
if it's not support by the upstream as the patch usually get out of sync 
often. Therefore, it's not worth to maintain it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152302 
>Unformatted:
