From owner-svn-ports-all@FreeBSD.ORG Mon Aug 27 18:22:56 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 411DE106564A; Mon, 27 Aug 2012 18:22:56 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C12F8FC1F; Mon, 27 Aug 2012 18:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RIMukw037714; Mon, 27 Aug 2012 18:22:56 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RIMtX9037708; Mon, 27 Aug 2012 18:22:55 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201208271822.q7RIMtX9037708@svn.freebsd.org> From: Rene Ladan Date: Mon, 27 Aug 2012 18:22:55 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r303241 - in head/astro/boinc-astropulse: . files X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 18:22:56 -0000 Author: rene Date: Mon Aug 27 18:22:55 2012 New Revision: 303241 URL: http://svn.freebsd.org/changeset/ports/303241 Log: - Fix build with WITHOUT_X11, adjust pkg-descr - Activate OPTIONS, convert to optionsNG while here - Replace pkgconfig by pkgconf - Bump PORTREVISION - Added svn keywords with psvn Added: head/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp (contents, props changed) head/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp (contents, props changed) head/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp (contents, props changed) Modified: head/astro/boinc-astropulse/Makefile (contents, props changed) head/astro/boinc-astropulse/pkg-descr (contents, props changed) Modified: head/astro/boinc-astropulse/Makefile ============================================================================== --- head/astro/boinc-astropulse/Makefile Mon Aug 27 18:02:21 2012 (r303240) +++ head/astro/boinc-astropulse/Makefile Mon Aug 27 18:22:55 2012 (r303241) @@ -6,7 +6,7 @@ PORTNAME= boinc-astropulse PORTVERSION= 6.01 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= astro MASTER_SITES= ftp://rene-ladan.nl/pub/distfiles/ DISTNAME= astropulse-svn-1280 @@ -26,7 +26,7 @@ USE_XZ= yes USE_AUTOTOOLS= autoconf:env automake:env libtool GNU_CONFIGURE= yes USE_GMAKE= yes -USE_GNOME= pkgconfig +USE_PKGCONFIG= build WRKSRC= ${WRKDIR}/${DISTNAME}/client CFLAGS+= -O2 -I${LOCALBASE}/include/boinc -I${LOCALBASE}/include \ @@ -40,7 +40,11 @@ BOINC_CLIENT_USER?= boinc BOINC_CLIENT_GROUP?= nobody BOINC_CLIENT_HOME?= /var/db/boinc -#OPTIONS= X11 "Build screensaver (requires net/boinc-client with X11)" on +OPTIONS_DEFINE= X11 + +X11_DESC= Build screensaver (requires net/boinc-client with X11) + +OPTIONS_DEFAULT= .include # stolen and adapted from bsd.port.mk @@ -48,12 +52,7 @@ BOINC_CLIENT_HOME?= /var/db/boinc BUILD_DEPENDS+= ${LOCALBASE}/bin/xz:${PORTSDIR}/archivers/xz .endif -# TODO fix upstream -.if defined(WITHOUT_X11) -BROKEN=Currently Astropulse requires X11 to build -.endif - -.if !defined(WITHOUT_X11) +.if ${PORT_OPTIONS:MX11} LIB_DEPENDS+= jpeg:${PORTSDIR}/graphics/jpeg \ xcb:${PORTSDIR}/x11/libxcb USE_GL= gl glu glut @@ -101,7 +100,7 @@ do-install: ${BOINC_CLIENT_HOME}/projects/${SETI_SITE} ${INSTALL_PROGRAM} -o ${BOINC_CLIENT_USER} -g ${BOINC_CLIENT_GROUP} \ ${WRKSRC}/${AP_BINARY} ${BOINC_CLIENT_HOME}/projects/${SETI_SITE}/ -.if !defined(WITHOUT_X11) +.if ${PORT_OPTIONS:MX11} ${INSTALL_PROGRAM} -o ${BOINC_CLIENT_USER} -g ${BOINC_CLIENT_GROUP} \ ${WRKSRC}/ap_graphics ${BOINC_CLIENT_HOME}/projects/${SETI_SITE}/ .endif Added: head/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp Mon Aug 27 18:22:55 2012 (r303241) @@ -0,0 +1,107 @@ +--- ap_client_main.cpp.orig 2009-04-01 02:11:24.000000000 +0200 ++++ ap_client_main.cpp 2012-06-23 00:27:10.000000000 +0200 +@@ -19,6 +19,8 @@ + #include "ap_config.h" + #ifdef _WIN32 + #include "boinc_win.h" ++#elif !defined(__EMX__) ++#include + #endif + + #ifdef HAVE_UNISTD_H +@@ -37,6 +39,7 @@ + #include "boinc_api.h" + #include "util.h" + #include "str_util.h" ++#include "shmem.h" + + #include "astropulse.h" + #include "diagnostics.h" +@@ -276,6 +279,56 @@ + + APP_INIT_DATA app_init_data; + ++#ifndef BOINC_APP_GRAPHICS ++/* copy some code from boinc-client */ ++ ++#ifdef __EMX__ ++static key_t get_shmem_name(const char* prog_name) { ++ char cwd[256], path[256]; ++ boinc_getcwd(cwd); ++ sprintf(path, "%s/init_data.xml", cwd); ++ return ftok(path, 2); ++} ++#else ++// Unix/Linux/Mac applications always use mmap() for gfx communication ++// ++static void get_shmem_name(const char* prog_name, char* shmem_name) { ++ APP_INIT_DATA aid; ++ int retval = boinc_get_init_data(aid); ++ if (retval) aid.slot = 0; ++ sprintf(shmem_name, "boinc_%s_%d", prog_name, aid.slot); ++} ++#endif ++ ++void* boinc_graphics_make_shmem(const char* prog_name, int size) { ++#ifdef _WIN32 ++ HANDLE shmem_handle; ++ char shmem_name[256]; ++ void* p; ++ get_shmem_name(prog_name, shmem_name); ++ shmem_handle = create_shmem(shmem_name, size, &p); ++ if (shmem_handle == NULL) return 0; ++ return p; ++#else ++ void* p; ++#ifdef __EMX__ ++ key_t key = get_shmem_name(prog_name); ++ int retval = create_shmem(key, size, 0, &p); ++#else ++ // V6 Unix/Linux/Mac applications always use mmap() shared memory for graphics communication ++ char shmem_name[256]; ++ get_shmem_name(prog_name, shmem_name); ++ int retval = create_shmem_mmap(shmem_name, size, &p); ++ // Graphics app may be run by a different user & group than worker app ++ // Although create_shmem passed 0666 to open(), it was modified by umask ++ if (retval == 0) chmod(shmem_name, 0666); ++#endif ++ if (retval) return 0; ++ return p; ++#endif ++} ++#endif /* !BOINC_APP_GRAPHICS */ ++ + /* Main Program */ + int main(int argc, char *argv[]) { + +@@ -315,7 +368,30 @@ + boinc_get_init_data(app_init_data); + // We've moved the state variable into the graphics shmem segment, + // so we always need to initialize graphics. ++#ifdef BOINC_APP_GRAPHICS + ap_graphics_init(app_init_data); ++#else /* BOINC_APP_GRAPHICS */ ++ // Checking for blank statefile ++ AP_SHMEM* &ap_shmem=Astropulse::client.ap_shmem; ++ // ap_shmem is defined extern in ap_gfx_main.h XXX ++ ap_shmem = (AP_SHMEM *)(boinc_graphics_make_shmem("astropulse", sizeof(AP_SHMEM)));//XXX ++ if (!ap_shmem) { ++ fprintf(stderr, "boinc_graphics_make_shmem failed: %d\n", errno); ++ exit(ERR_SHMEM_NAME); ++ } ++ ++ // initialize ap_shmem with placement new. ++ // VC++ doesn't support placement new in debug mode!?!?! What the hell? ++#if !defined(_DEBUG) || !defined(_MSC_VER) ++ ap_shmem = new (ap_shmem) AP_SHMEM(); ++#else ++ // VC++ doesn't support placement new in debug mode!?!?! What the hell? ++ // Fortunately AP_SHMEM doesn't contain any self-referential pointers. ++ AP_SHMEM *tmp=new AP_SHMEM(); ++ memcpy(ap_shmem,tmp,sizeof(AP_SHMEM)); ++ delete tmp; ++#endif ++#endif /* BOINC_APP_GRAPHICS no case */ + + + /* Possible arguments: Added: head/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp Mon Aug 27 18:22:55 2012 (r303241) @@ -0,0 +1,14 @@ +--- ap_gfx_main.cpp 2008-07-22 00:47:52.000000000 +0200 ++++ ap_gfx_main.cpp 2012-05-12 22:28:57.000000000 +0200 +@@ -34,7 +34,11 @@ + + REDUCED_ARRAY_GEN rarray; + AP_GDATA* ap_gdata; ++#ifdef BOINC_APP_GRAPHICS + bool nographics_flag = false; ++#else ++bool nographics_flag = true; ++#endif + + void update_shmem() { + } Added: head/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp Mon Aug 27 18:22:55 2012 (r303241) @@ -0,0 +1,8 @@ +--- ap_remove_radar.cpp.orig 2012-01-26 07:53:16.000000000 +0100 ++++ ap_remove_radar.cpp 2012-08-12 00:14:40.000000000 +0200 +@@ -1,5 +1,4 @@ + #include "astropulse.h" +-#include "ap_graphics.h" + #include "fftw3.h" + #include "sbtf.h" + #include "ap_debug.h" Modified: head/astro/boinc-astropulse/pkg-descr ============================================================================== --- head/astro/boinc-astropulse/pkg-descr Mon Aug 27 18:02:21 2012 (r303240) +++ head/astro/boinc-astropulse/pkg-descr Mon Aug 27 18:22:55 2012 (r303241) @@ -7,8 +7,4 @@ pulsars or exploding primordial black ho The port automatically optimizes for the host CPU using the CPUTYPE variable in /etc/make.conf -Currently it requires X to build, but at runtime X is only required for the -screen saver. This requirement is an artifact of the current upstream design -of the port. - WWW: http://setiathome.berkeley.edu/