From lichray@gmail.com  Thu Oct  6 20:57:41 2011
Return-Path: <lichray@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A379106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  6 Oct 2011 20:57:41 +0000 (UTC)
	(envelope-from lichray@gmail.com)
Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54])
	by mx1.freebsd.org (Postfix) with ESMTP id D03C48FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  6 Oct 2011 20:57:40 +0000 (UTC)
Received: by ywp17 with SMTP id 17so3821219ywp.13
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 06 Oct 2011 13:57:40 -0700 (PDT)
Received: by 10.236.181.196 with SMTP id l44mr5999435yhm.37.1317934660084;
        Thu, 06 Oct 2011 13:57:40 -0700 (PDT)
Received: from compaq.yuetime (c-98-228-191-105.hsd1.il.comcast.net. [98.228.191.105])
        by mx.google.com with ESMTPS id w50sm9456341yhi.2.2011.10.06.13.57.37
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 06 Oct 2011 13:57:39 -0700 (PDT)
Received: by compaq.yuetime (sSMTP sendmail emulation); Thu, 06 Oct 2011 15:57:32 -0500
Message-Id: <4e8e1643.ca88ec0a.6e72.ffffecde@mx.google.com>
Date: Thu, 06 Oct 2011 15:57:32 -0500
From: Zhihao Yuan <lichray@gmail.com>
Reply-To: Zhihao Yuan <lichray@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: x11/xscreensaver: [PATCH] fixes build; improvements
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         161345
>Category:       ports
>Synopsis:       x11/xscreensaver: [PATCH] fixes build; improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 06 21:00:19 UTC 2011
>Closed-Date:    Fri Oct 07 00:55:07 UTC 2011
>Last-Modified:  Fri Oct 07 00:55:07 UTC 2011
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
Northern Illinois University
>Environment:
System: FreeBSD compaq.yuetime 8.2-STABLE FreeBSD 8.2-STABLE #9 r225739: Sat Sep 24 04:14:17 CDT 2011 lichray@compaq.yuetime:/usr/obj/home/lichray/devel/freebsd-stable/sys/HOUKAGO amd64


	
>Description:
	
	-lintl is required to build xscreensaver; restore the ldflag.
	Several improvements:
	1. Replaces cp+sed with REINPLACE_CMD;
	2. Makes p5-libwww and netpbm optional (only 2 plug-ins require them);
	3. Removes -O0 on amd64. No longer needed.
>How-To-Repeat:
	
>Fix:

	

--- patch-xscreensaver_1 begins here ---
diff -ruN --exclude=CVS /usr/ports/x11/xscreensaver.orig/Makefile /usr/ports/x11/xscreensaver/Makefile
--- /usr/ports/x11/xscreensaver.orig/Makefile	2011-10-01 01:05:36.000000000 -0500
+++ /usr/ports/x11/xscreensaver/Makefile	2011-10-06 15:41:00.112362842 -0500
@@ -7,6 +7,7 @@
 
 PORTNAME=	xscreensaver
 PORTVERSION=	5.15
+PORTREVISION=	1
 CATEGORIES?=	x11
 MASTER_SITES=	http://www.jwz.org/xscreensaver/ \
 		http://dougbarton.us/Downloads/
@@ -20,9 +21,6 @@
 		xml2.5:${PORTSDIR}/textproc/libxml2 \
 		glade-2.0.0:${PORTSDIR}/devel/libglade2
 
-RUN_DEPENDS=	${SITE_PERL}/LWP/Simple.pm:${PORTSDIR}/www/p5-libwww \
-		giftopnm:${PORTSDIR}/graphics/netpbm
-
 MAKE_JOBS_SAFE=	yes
 
 USE_XORG=	xpm
@@ -39,6 +37,7 @@
 
 OPTIONS=	KERBEROS "Add support for kerberos" off \
 		PAM "Add support for pam authentication" off \
+		WWW "Enable web access for plugins" off \
 		SETUID_HACKS "Install sonar hack suid so it can ping" off \
 		FIREF "Add extra port x11/fireflies" off \
 		XAOS1 "Add extra port graphics/xaos" off \
@@ -62,6 +61,10 @@
 CONFIGURE_ARGS+=	--without-pam
 PLIST_SUB+=		PAM="@comment not installed: "
 .endif
+.if defined(WITH_WWW)
+RUN_DEPENDS=	${SITE_PERL}/LWP/Simple.pm:${PORTSDIR}/www/p5-libwww \
+		giftopnm:${PORTSDIR}/graphics/netpbm
+.endif
 .if defined(WITH_SETUID_HACKS)
 CONFIGURE_ARGS+=	--with-setuid-hacks
 .endif
@@ -132,24 +135,18 @@
 	companioncube.6 hilbert.6 tronbit.6 \
 	xscreensaver-gl-helper.6
 
-.if ${ARCH} == "amd64"
-CFLAGS+=	-O0
-.endif
-
 post-patch:
-	@ ${CP} ${WRKSRC}/configure ${WRKSRC}/configure.Patched
-	@ ${SED} -e 's#-lpthread#${PTHREAD_LIBS}#g' \
+	@ ${REINPLACE_CMD} -e 's#-lpthread#${PTHREAD_LIBS}#g' \
 		-e 's#malloc.h#stdlib.h#g' \
 		-e 's#/usr/X11R6#${LOCALBASE}#g' \
-		${WRKSRC}/configure.Patched > ${WRKSRC}/configure
-	@ ${CP} ${WRKSRC}/hacks/vidwhacker ${WRKSRC}/hacks/vidwhacker.presed
-	@ ${SED} -e '329s#.*#      $$fn = "$$imagedir/$$fn";#' \
-	    ${WRKSRC}/hacks/vidwhacker.presed > ${WRKSRC}/hacks/vidwhacker
+		-e '/sed.*-lintl/d' \
+		${WRKSRC}/configure
+	@ ${REINPLACE_CMD} -e '329s#.*#      $$fn = "$$imagedir/$$fn";#' \
+	    ${WRKSRC}/hacks/vidwhacker
 .if defined(WITH_PAM)
 .for f in driver/passwd-pam.c driver/xscreensaver.man
-	@ ${CP} ${WRKSRC}/${f} ${WRKSRC}/${f}.presed
-	@ ${SED} -e "s#/etc/pam.d#${PREFIX}/etc/pam.d#g" \
-	    ${WRKSRC}/${f}.presed > ${WRKSRC}/${f}
+	@ ${REINPLACE_CMD} -e "s#/etc/pam.d#${PREFIX}/etc/pam.d#g" \
+	    ${WRKSRC}/${f}
 .endfor
 	@ ${CP} ${FILESDIR}/xscreensaver.pam ${WRKSRC}/driver/xscreensaver.pam
 .else
--- patch-xscreensaver_1 ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dougb 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 6 21:00:37 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161345 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Fri Oct 7 00:52:05 UTC 2011 
State-Changed-Why:  

I don't know why you think that -lintl is needed, I wouldn't have updated 
the port if it didn't build. :) 

I hate REINPLACE_CMD 

The option is a good idea, but you need to fix the plist, installation, 
etc. too. 

I'll try the -O0 thing, thanks. 

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