From nobody@FreeBSD.org  Wed Jun  6 13:20:09 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4466D106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Jun 2012 13:20:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 2EC278FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Jun 2012 13:20:09 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q56DK86s048238
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 Jun 2012 13:20:08 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q56DK87D048237;
	Wed, 6 Jun 2012 13:20:08 GMT
	(envelope-from nobody)
Message-Id: <201206061320.q56DK87D048237@red.freebsd.org>
Date: Wed, 6 Jun 2012 13:20:08 GMT
From: Alexey Shuvaev <bugsbeastie@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net/boinc-client fix build for C programs and seti
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168756
>Category:       ports
>Synopsis:       net/boinc-client fix build for C programs and seti
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pav
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 06 13:30:10 UTC 2012
>Closed-Date:    Sun Jun 10 14:39:40 UTC 2012
>Last-Modified:  Sun Jun 10 14:40:15 UTC 2012
>Originator:     Alexey Shuvaev
>Release:        10.0-CURRENT
>Organization:
Vienna University of Technology
>Environment:
FreeBSD lexx.ifp.tuwien.ac.at 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r235447: Tue May 15 13:33:48 CEST 2012     root@lexx.ifp.tuwien.ac.at:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
First, repair the brain damage of including C++ header inside pure C programs. Although the final linking stage has to be done with C++ linker anyway as boinc is written in C++, the compilation could be done with C compiler. Moreover, it is supported by the boinc_api.h with clean separation of C and C++ namespaces. This fix does not seem to affect anything, both boinc-client and setiathome compile cleanly (tested when both have WITHOUN_X11).

Second, in order to actually fix the build of C programs, the changeset 25543 from the upstream is also incorporated. Now I was able to compile C boinc application.

Third, if boinc-client is compiled WITHOUT_X11, the build for setiathome is broken, even if it is also configured WITHOUT_X11. It still needs reduce.h (see client/gdata.h at line 39 in setiathome sources). So, install it unconditionally in boinc-client. With this fix setiathome compiles cleanly too (WITHOUT_X11 is set in both boinc-client and setitahome).

P.S. I am currently working with Greg Childers from NFS@home to provide native FreeBSD applications, so these fixes are from the real life.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN boinc-client.orig/Makefile boinc-client/Makefile
--- boinc-client.orig/Makefile	2012-05-03 18:04:19.000000000 +0200
+++ boinc-client/Makefile	2012-06-06 14:43:41.000000000 +0200
@@ -154,9 +154,10 @@
 .endif
 	${INSTALL_DATA} ${WRKSRC}/config.h ${PREFIX}/include/boinc
 	${INSTALL_DATA} ${WRKSRC}/lib/std_fixes.h ${PREFIX}/include/boinc
+	${INSTALL_DATA} ${WRKSRC}/api/reduce.h ${PREFIX}/include/boinc
 .if !defined(WITHOUT_X11)
 . for name in api/boinc_gl.h api/graphics_api.h api/graphics_data.h \
-	api/reduce.h api/txf_util.h
+	api/txf_util.h
 	${INSTALL_DATA} ${WRKSRC}/${name} ${PREFIX}/include/boinc
 . endfor
 . if defined(WITHOUT_MANAGER)
diff -ruN boinc-client.orig/files/patch-api__boinc_api.h boinc-client/files/patch-api__boinc_api.h
--- boinc-client.orig/files/patch-api__boinc_api.h	2012-04-23 22:49:14.000000000 +0200
+++ boinc-client/files/patch-api__boinc_api.h	2012-06-06 14:41:04.000000000 +0200
@@ -1,11 +1,18 @@
---- api/boinc_api.h.orig	2012-04-20 16:15:13.000000000 +0200
-+++ api/boinc_api.h	2012-04-20 16:17:11.000000000 +0200
-@@ -29,6 +29,8 @@
- extern "C" {
- #endif
+--- api/boinc_api.h.orig	2012-04-13 09:59:23.000000000 +0200
++++ api/boinc_api.h	2012-06-06 14:40:16.000000000 +0200
+@@ -83,7 +83,6 @@
+ 
+ extern int boinc_init(void);
+ extern int boinc_finish(int status);
+-extern int boinc_temporary_exit(int delay, const char* reason=NULL);
+ extern int boinc_get_init_data_p(struct APP_INIT_DATA*);
+ extern int boinc_parse_init_data_file(void);
+ extern int boinc_send_trickle_up(char* variety, char* text);
+@@ -139,6 +138,7 @@
+     double cpu_time, double checkpoint_cpu_time, double _fraction_done,
+     int other_pid, double bytes_sent, double bytes_received
+ );
++extern int boinc_temporary_exit(int delay, const char* reason=NULL);
+ 
+ /////////// API ENDS HERE
  
-+#include <cstddef>
-+
- // parameters passed to the BOINC runtime system
- //
- typedef struct BOINC_OPTIONS {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->pav 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Jun 6 22:14:54 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168756 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Sun Jun 10 14:38:01 UTC 2012 
State-Changed-Why:  
Committed, thanks! 

I'd love to see more native FreeBSD app on BOINC platform! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/168756: commit references a PR
Date: Sun, 10 Jun 2012 14:39:16 +0000 (UTC)

 pav         2012-06-10 14:39:02 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/boinc-client     Makefile 
     net/boinc-client/files patch-api__boinc_api.h 
   Log:
   - Fix header files integrity when X11 option is disabled
   - Fix header files to allow pure C client app to be built
   - OPTIONSng
   
   PR:             ports/168714, ports/168756
   Submitted by:   Alexey Shuvaev <bugsbeastie@gmail.com>, Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
   
   Revision  Changes    Path
   1.55      +44 -40    ports/net/boinc-client/Makefile
   1.2       +17 -10    ports/net/boinc-client/files/patch-api__boinc_api.h
 _______________________________________________
 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:
