From zeising@daemonic.se  Tue Jun 21 19:43:57 2011
Return-Path: <zeising@daemonic.se>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 316CE10656D0
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 19:43:57 +0000 (UTC)
	(envelope-from zeising@daemonic.se)
Received: from mail.lysator.liu.se (unknown [IPv6:2001:6b0:17:f0a0::3])
	by mx1.freebsd.org (Postfix) with ESMTP id 988038FC1C
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 19:43:56 +0000 (UTC)
Received: from mail.lysator.liu.se (localhost [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id 323BA40002
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 21:43:55 +0200 (CEST)
Received: by mail.lysator.liu.se (Postfix, from userid 1004)
	id 281BD40004; Tue, 21 Jun 2011 21:43:55 +0200 (CEST)
Received: from mx.daemonic.se (h-90-99.A163.priv.bahnhof.se [79.136.90.99])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTPSA id BFB1240002
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 21:43:54 +0200 (CEST)
Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4])
	by mx.daemonic.se (Postfix) with ESMTPS id 52B1E119C04
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 21:43:54 +0200 (CEST)
Received: from vincent.daemonic.se (login.daemonic.se [IPv6:2001:470:dca9:0:1::10])
	by mail.daemonic.se (Postfix) with ESMTPS id 2DC5512B0A0
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Jun 2011 21:43:54 +0200 (CEST)
Received: (from zeising@localhost)
	by vincent.daemonic.se (8.14.4/8.14.4/Submit) id p5LJhsx9001948;
	Tue, 21 Jun 2011 21:43:54 +0200 (CEST)
	(envelope-from zeising)
Message-Id: <201106211943.p5LJhsx9001948@vincent.daemonic.se>
Date: Tue, 21 Jun 2011 21:43:54 +0200 (CEST)
From: Niclas Zeising <niclas.zeising@gmail.com>
Reply-To: Niclas Zeising <niclas.zeising@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] fix x11-fm/xdiskusage to build using clang
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         158136
>Category:       ports
>Synopsis:       [PATCH] fix x11-fm/xdiskusage to build using clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ehaupt
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 21 19:50:11 UTC 2011
>Closed-Date:    Wed Jun 22 01:13:17 CEST 2011
>Last-Modified:  Tue Jun 21 23:20:11 UTC 2011
>Originator:     Niclas Zeising
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD vincent.daemonic.se 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Wed Apr 20 17:22:47 CEST 2011 root@vincent.daemonic.se:/usr/obj/usr/src/sys/VINCENT amd64


	
>Description:
	x11-fm/xdiskusage doesn't build with clang. It aslo hardcodes the use of g++.
>How-To-Repeat:
>Fix:

	Attached patch fixes the build with clang and also makes the port not hardcode the compiler.

--- x11-fm.xdiskusage.clangfix.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-fm/xdiskusage/Makefile,v
retrieving revision 1.30
diff -u -d -r1.30 Makefile
--- Makefile	28 Mar 2010 06:46:01 -0000	1.30
+++ Makefile	21 Jun 2011 19:41:21 -0000
@@ -26,7 +26,7 @@
 	${REINPLACE_CMD} -e '22,24d' ${WRKSRC}/Makefile
 
 do-build:
-	cd ${WRKSRC} && ${GMAKE} CXXFLAGS="`fltk-config --cxxflags`" LDFLAGS="`fltk-config --ldflags`"
+	cd ${WRKSRC} && env CC=${CC} CXX=${CXX} ${GMAKE} CXXFLAGS="`fltk-config --cxxflags`" LDFLAGS="`fltk-config --ldflags`"
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/xdiskusage ${PREFIX}/bin
Index: files/patch-xdiskusage.C
===================================================================
RCS file: /home/ncvs/ports/x11-fm/xdiskusage/files/patch-xdiskusage.C,v
retrieving revision 1.1
diff -u -d -r1.1 patch-xdiskusage.C
--- files/patch-xdiskusage.C	15 Sep 2008 19:50:59 -0000	1.1
+++ files/patch-xdiskusage.C	21 Jun 2011 19:41:21 -0000
@@ -1,5 +1,27 @@
---- xdiskusage.C.orig	2008-09-15 19:21:03.000000000 +0000
-+++ xdiskusage.C	2008-09-15 19:23:54.000000000 +0000
+--- xdiskusage.C.orig	2004-09-21 07:23:14.000000000 +0200
++++ xdiskusage.C	2011-06-21 21:34:20.000000000 +0200
+@@ -392,8 +392,8 @@
+       strncpy(pathbuf, path, 1024);
+       for (int i=0; i<10; i++) {
+ 	char *p = (char*)fl_filename_name(pathbuf);
+-	int i = readlink(pathbuf, p, 1024-(p-pathbuf));
+-	if (i < 0) {
++	int j = readlink(pathbuf, p, 1024-(p-pathbuf));
++	if (j < 0) {
+ 	  if (errno != EINVAL) {
+ 	    strcat(pathbuf, ": no such file");
+ 	    fl_alert(pathbuf);
+@@ -401,8 +401,8 @@
+ 	  }
+ 	  break;
+ 	}
+-	if (*p == '/') {memmove(pathbuf, p, i); p = pathbuf;}
+-	p[i] = 0;
++	if (*p == '/') {memmove(pathbuf, p, j); p = pathbuf;}
++	p[j] = 0;
+ 	path = pathbuf;
+       }
+     }
 @@ -988,7 +988,7 @@
  void OutputWindow::sort_cb(Fl_Widget* o, void*v) {
    OutputWindow* d = (OutputWindow*)(o->window());
--- x11-fm.xdiskusage.clangfix.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ehaupt 
Responsible-Changed-By: ehaupt 
Responsible-Changed-When: Wed Jun 22 00:37:11 CEST 2011 
Responsible-Changed-Why:  
I will take care of it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158136 
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Wed Jun 22 01:13:16 CEST 2011 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158136 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/158136: commit references a PR
Date: Tue, 21 Jun 2011 23:13:25 +0000 (UTC)

 ehaupt      2011-06-21 23:13:11 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-fm/xdiskusage    Makefile 
     x11-fm/xdiskusage/files patch-xdiskusage.C 
   Log:
   Make port build with clang. While we're here add an additional distfile
   mirror and get rid of custom do-build target.
   
   PR:             158136
   Submitted by:   Niclas Zeising <niclas.zeising@gmail.com>
   
   Revision  Changes    Path
   1.31      +7 -4      ports/x11-fm/xdiskusage/Makefile
   1.2       +24 -2     ports/x11-fm/xdiskusage/files/patch-xdiskusage.C
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
