aboutsummaryrefslogtreecommitdiff
path: root/math/scilab-toolbox-swt/Makefile
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/Makefile
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/Makefile')
-rw-r--r--math/scilab-toolbox-swt/Makefile44
1 files changed, 40 insertions, 4 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