summaryrefslogtreecommitdiff
path: root/astro
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2012-08-27 18:22:55 +0000
committerRene Ladan <rene@FreeBSD.org>2012-08-27 18:22:55 +0000
commit6d7d6fbba20d1be37eec495c4cf2b9b578d9b421 (patch)
tree157212618d88bdc429f16787e2ed47fe1a1dc606 /astro
parent- revert accidental commit (diff)
- 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
Notes
Notes: svn path=/head/; revision=303241
Diffstat (limited to 'astro')
-rw-r--r--astro/boinc-astropulse/Makefile19
-rw-r--r--astro/boinc-astropulse/files/patch-client__ap_client_main.cpp107
-rw-r--r--astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp14
-rw-r--r--astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp8
-rw-r--r--astro/boinc-astropulse/pkg-descr4
5 files changed, 138 insertions, 14 deletions
diff --git a/astro/boinc-astropulse/Makefile b/astro/boinc-astropulse/Makefile
index 6c0b3a197df0..e7a5e82f2c75 100644
--- a/astro/boinc-astropulse/Makefile
+++ b/astro/boinc-astropulse/Makefile
@@ -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 <bsd.port.pre.mk>
# 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
diff --git a/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp b/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp
new file mode 100644
index 000000000000..46521bbad3e4
--- /dev/null
+++ b/astro/boinc-astropulse/files/patch-client__ap_client_main.cpp
@@ -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 <sys/stat.h>
+ #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:
diff --git a/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp b/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp
new file mode 100644
index 000000000000..7b5eb8c8e32f
--- /dev/null
+++ b/astro/boinc-astropulse/files/patch-client__ap_gfx_main.cpp
@@ -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() {
+ }
diff --git a/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp b/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp
new file mode 100644
index 000000000000..102c63b9839b
--- /dev/null
+++ b/astro/boinc-astropulse/files/patch-client__ap_remove_radar.cpp
@@ -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"
diff --git a/astro/boinc-astropulse/pkg-descr b/astro/boinc-astropulse/pkg-descr
index e34363da227d..18531ad5594d 100644
--- a/astro/boinc-astropulse/pkg-descr
+++ b/astro/boinc-astropulse/pkg-descr
@@ -7,8 +7,4 @@ pulsars or exploding primordial black holes.
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/