aboutsummaryrefslogtreecommitdiff
path: root/math/scilab-toolbox-swt
diff options
context:
space:
mode:
authorMax Brazhnikov <makc@FreeBSD.org>2012-04-26 23:15:36 +0000
committerMax Brazhnikov <makc@FreeBSD.org>2012-04-26 23:15:36 +0000
commita1eca950670275d2541bf48466b7bae4e0c36379 (patch)
treeb0702ea74be61bfb1c17b04ddb6e14b1dd83c67d /math/scilab-toolbox-swt
parentaec447c732eb607ccbb4ec267d4bb7b988bd66ef (diff)
downloadports-a1eca950670275d2541bf48466b7bae4e0c36379.tar.gz
ports-a1eca950670275d2541bf48466b7bae4e0c36379.zip
Add option to build help file
Notes
Notes: svn path=/head/; revision=295576
Diffstat (limited to 'math/scilab-toolbox-swt')
-rw-r--r--math/scilab-toolbox-swt/Makefile44
-rw-r--r--math/scilab-toolbox-swt/files/extrapatch-etc__swt.start (renamed from math/scilab-toolbox-swt/files/patch-etc__swt.start)0
-rw-r--r--math/scilab-toolbox-swt/files/patch-builder.sce17
-rw-r--r--math/scilab-toolbox-swt/pkg-plist2
4 files changed, 42 insertions, 21 deletions
diff --git a/math/scilab-toolbox-swt/Makefile b/math/scilab-toolbox-swt/Makefile
index 060df772bd86..b1d38a317854 100644
--- a/math/scilab-toolbox-swt/Makefile
+++ b/math/scilab-toolbox-swt/Makefile
@@ -7,6 +7,7 @@
PORTNAME= swt
PORTVERSION= 0.1.11
+PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= http://atoms.scilab.org/toolboxes/swt/${PORTVERSION}/files/
PKGNAMEPREFIX= scilab-toolbox-
@@ -23,8 +24,10 @@ CONTRIBDIR?= share/scilab/contrib
TOOLBOXDIR_REL?= ${CONTRIBDIR}/${PORTNAME}
TOOLBOXDIR= ${PREFIX}/${TOOLBOXDIR_REL}
PLIST_SUB= TOOLBOXDIR=${TOOLBOXDIR_REL}
+TOOLBOX_SUBDIRS= demos etc macros
-OPTIONS= SIVP "Enable Image and Video support" off
+OPTIONS= SIVP "Enable Image and Video support" off \
+ HELP "Build help files (requires scilab with gui support)" on
.include <bsd.port.options.mk>
@@ -32,14 +35,47 @@ OPTIONS= SIVP "Enable Image and Video support" off
RUN_DEPENDS+= ${LOCALBASE}/${CONTRIBDIR}/sivp/loader.sce:${PORTSDIR}/math/scilab-toolbox-sivp
.endif
+.if defined(WITHOUT_HELP)
+SCILAB_ARGS= -nogui
+PLIST_SUB+= HELP="@comment "
+EXTRA_PATCHES+= ${FILESDIR}/extrapatch-etc__swt.start
+.else
+USE_DISPLAY= yes
+MAKE_ENV= LC_ALL="C"
+PLIST_SUB+= HELP=""
+TOOLBOX_SUBDIRS+= jar
+.endif
+
post-patch:
+.if defined(WITHOUT_HELP)
+ ${REINPLACE_CMD} -e '/tbx_builder_help/d' ${WRKSRC}/builder.sce
+.endif
${REINPLACE_CMD} -e "s,SWTDIR+','${TOOLBOXDIR}/demos," \
${WRKSRC}/demos/image.sce
+ ${ECHO_CMD} quit >> ${WRKSRC}/builder.sce
+
pre-build:
- ${FIND} -d ${WRKSRC} \( -name '*.orig' -or -name '*.bak' \) | ${XARGS} ${RM}
+ ${FIND} -d ${WRKSRC} \( -name '*.orig' -or -name '*.bak' \) -delete
+.if !defined(WITHOUT_HELP) && !defined(DISPLAY)
+ @if [ -f ${WRKDIR}/.Xvfb.pid ]; then \
+ ${CAT} ${WRKDIR}/.Xvfb.pid | ${XARGS} kill || ${TRUE} ; \
+ ${RM} -f ${WRKDIR}/.Xvfb.pid ; \
+ fi
+ ${LOCALBASE}/bin/Xvfb :1001 -screen 0 800x600x24 -fp ${LOCALBASE}/lib/X11/fonts/misc > /dev/null 2>&1 & ${ECHO} $$! > ${WRKDIR}/.Xvfb.pid
+ @sleep 5
+.endif
do-build:
- cd ${WRKSRC} && ${SCILAB_CMD} -nogui -f builder.sce
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${SCILAB_CMD} ${SCILAB_ARGS} -f builder.sce
+
+post-build:
+.if !defined(WITHOUT_HELP) && !defined(DISPLAY)
+ @if [ -f ${WRKDIR}/.Xvfb.pid ]; then \
+ ${CAT} ${WRKDIR}/.Xvfb.pid | ${XARGS} kill || ${TRUE} ; \
+ ${RM} -f ${WRKDIR}/.Xvfb.pid ; \
+ fi
+.endif
do-install:
${MKDIR} ${TOOLBOXDIR}/sci_gateway/c
@@ -49,7 +85,7 @@ do-install:
cd ${WRKSRC}/sci_gateway/c && \
${INSTALL_DATA} loader.sce ${TOOLBOXDIR}/sci_gateway/c && \
${INSTALL_PROGRAM} libswt_c.so ${TOOLBOXDIR}/sci_gateway/c
-.for d in demos etc macros
+.for d in ${TOOLBOX_SUBDIRS}
cd ${WRKSRC} && ${COPYTREE_SHARE} ${d} ${TOOLBOXDIR}
.endfor
diff --git a/math/scilab-toolbox-swt/files/patch-etc__swt.start b/math/scilab-toolbox-swt/files/extrapatch-etc__swt.start
index 4b9e07f0262d..4b9e07f0262d 100644
--- a/math/scilab-toolbox-swt/files/patch-etc__swt.start
+++ b/math/scilab-toolbox-swt/files/extrapatch-etc__swt.start
diff --git a/math/scilab-toolbox-swt/files/patch-builder.sce b/math/scilab-toolbox-swt/files/patch-builder.sce
deleted file mode 100644
index 3461826356e3..000000000000
--- a/math/scilab-toolbox-swt/files/patch-builder.sce
+++ /dev/null
@@ -1,17 +0,0 @@
---- ./builder.sce.orig 2010-06-30 18:31:36.000000000 +0400
-+++ ./builder.sce 2010-07-10 20:13:24.901709864 +0400
-@@ -33,7 +33,7 @@
- tbx_builder_macros(toolbox_dir);
- //tbx_builder_src(toolbox_dir);
- tbx_builder_gateway(toolbox_dir);
--tbx_builder_help(toolbox_dir);
-+// tbx_builder_help(toolbox_dir);
- tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
- tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir);
-
-@@ -41,3 +41,5 @@
- // =============================================================================
-
- clear toolbox_dir TOOLBOX_NAME TOOLBOX_TITLE;
-+
-+quit
diff --git a/math/scilab-toolbox-swt/pkg-plist b/math/scilab-toolbox-swt/pkg-plist
index 0d8ae7c2331c..eabfaac790a6 100644
--- a/math/scilab-toolbox-swt/pkg-plist
+++ b/math/scilab-toolbox-swt/pkg-plist
@@ -15,6 +15,7 @@
%%TOOLBOXDIR%%/demos/wden.dem.sce
%%TOOLBOXDIR%%/etc/swt.quit
%%TOOLBOXDIR%%/etc/swt.start
+%%HELP%%%%TOOLBOXDIR%%/jar/scilab_en_US_help.jar
%%TOOLBOXDIR%%/loader.sce
%%TOOLBOXDIR%%/macros/ShapeAsRow.bin
%%TOOLBOXDIR%%/macros/ShapeAsRow.sci
@@ -61,6 +62,7 @@
@dirrm %%TOOLBOXDIR%%/sci_gateway/c
@dirrm %%TOOLBOXDIR%%/sci_gateway
@dirrm %%TOOLBOXDIR%%/macros
+%%HELP%%@dirrm %%TOOLBOXDIR%%/jar
@dirrm %%TOOLBOXDIR%%/etc
@dirrm %%TOOLBOXDIR%%/demos/image
@dirrm %%TOOLBOXDIR%%/demos