aboutsummaryrefslogtreecommitdiffstats
path: root/textproc
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2015-03-27 03:18:49 +0800
committermarino <marino@FreeBSD.org>2015-03-27 03:18:49 +0800
commit9127e358990e0ae9f3c241890571e634d51d0bd8 (patch)
tree33742f1efbc7c9f7fc1b515e90fd1a4ce1e4364d /textproc
parentce2cac1702e375e08970dea6e734bf5bb83e29e3 (diff)
downloadfreebsd-ports-gnome-9127e358990e0ae9f3c241890571e634d51d0bd8.tar.gz
freebsd-ports-gnome-9127e358990e0ae9f3c241890571e634d51d0bd8.tar.zst
freebsd-ports-gnome-9127e358990e0ae9f3c241890571e634d51d0bd8.zip
textproc/zorba: Modernize options, support DragonFly
* Corrected an old-style LIB_DEPENDS callout * Used OPTION_SUB (and adjusted pkg-plist as a consequence) * Brought CMAKE args into options * Used sed to allow building on DragonFly * Fix swig build on F10+ * Fix no-docs option
Diffstat (limited to 'textproc')
-rw-r--r--textproc/zorba/Makefile73
-rw-r--r--textproc/zorba/files/patch-swig_ZorbaIOStream.i18
-rw-r--r--textproc/zorba/files/patch-swig_python_zorba__api.i20
-rw-r--r--textproc/zorba/pkg-plist46
4 files changed, 90 insertions, 67 deletions
diff --git a/textproc/zorba/Makefile b/textproc/zorba/Makefile
index 4dd6ef69e7ec..06a6dd55aac1 100644
--- a/textproc/zorba/Makefile
+++ b/textproc/zorba/Makefile
@@ -3,7 +3,7 @@
PORTNAME= zorba
PORTVERSION= 2.7.0
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= textproc
MASTER_SITES= https://launchpadlibrarian.net/119058962/
DISTNAME= ${PORTNAME}-src-${PORTVERSION}
@@ -13,7 +13,7 @@ COMMENT= General purpose C++ XQuery processor
LICENSE= APACHE20
-LIB_DEPENDS= libxerces-c.so.3:${PORTSDIR}/textproc/xerces-c3 \
+LIB_DEPENDS= libxerces-c.so:${PORTSDIR}/textproc/xerces-c3 \
libicudata.so:${PORTSDIR}/devel/icu \
libcurl.so:${PORTSDIR}/ftp/curl \
libtidy.so:${PORTSDIR}/www/tidy-lib \
@@ -23,6 +23,17 @@ RUN_DEPENDS= fop:${PORTSDIR}/textproc/fop
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
OPTIONS_DEFINE= PHP PYTHON RUBY JAVA DOCS
+OPTIONS_SUB= yes
+
+DOCS_BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
+PHP_CMAKE_ON= -DWITH_PHP5:BOOL=true
+PHP_CMAKE_OFF= -DWITH_PHP5:BOOL=false
+PYTHON_CMAKE_ON= -DWITH_PYTHON:BOOL=true
+PYTHON_CMAKE_OFF= -DWITH_PYTHON:BOOL=false
+RUBY_CMAKE_ON= -DWITH_RUBY:BOOL=true
+RUBY_CMAKE_OFF= -DWITH_RUBY:BOOL=false
+JAVA_CMAKE_ON= -DWITH_JAVA:BOOL=true
+JAVA_CMAKE_OFF= -DWITH_JAVA:BOOL=false
# Both install include/xqc.h
CONFLICTS= xqilla-[0-9]*
@@ -43,42 +54,32 @@ PLIST_SUB+= FULLVERSION=${PORTVERSION} \
MIDVERSION=${PORTVERSION:R} \
MINVERSION=${PORTVERSION:R:R}
+.if exists(/usr/lib/libexecinfo.so)
+LOC_EXECINFO= /usr/lib/libexecinfo.so
+.else
+LOC_EXECINFO= ${LOCALBASE}/lib/libexecinfo.so
+.endif
+
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MPHP}
USE_PHP= tokenizer
USE_PHP_BUILD= yes
WITH_SWIG= yes
-CMAKE_ARGS+= -DWITH_PHP5:BOOL=true \
- -DPHP5_INSTALL_PATH:FILEPATH="lib/php/${PHP_EXT_DIR}"
-PLIST_SUB+= WITH_PHP="" \
- PHP_EXTLIBDIR="lib/php/${PHP_EXT_DIR}"
-.else
-CMAKE_ARGS+= -DWITH_PHP5:BOOL=false
-PLIST_SUB+= WITH_PHP="@comment "
+CMAKE_ARGS+= -DPHP5_INSTALL_PATH:FILEPATH="lib/php/${PHP_EXT_DIR}"
+PLIST_SUB+= PHP_EXTLIBDIR="lib/php/${PHP_EXT_DIR}"
.endif
.if ${PORT_OPTIONS:MPYTHON}
USES+= python
WITH_SWIG= yes
-CMAKE_ARGS+= -DWITH_PYTHON:BOOL=true \
- -DPYTHON_SWIG_INSTALL_DIR:FILEPATH=${PYTHONPREFIX_SITELIBDIR:S/${PREFIX}\///}
-PLIST_SUB+= WITH_PYTHON="" \
- PYTHON_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR:S/${PREFIX}\///}
-
-.else
-CMAKE_ARGS+= -DWITH_PYTHON:BOOL=false
-PLIST_SUB+= WITH_PYTHON="@comment "
+CMAKE_ARGS+= -DPYTHON_SWIG_INSTALL_DIR:FILEPATH=${PYTHONPREFIX_SITELIBDIR:S/${PREFIX}\///}
+PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR:S/${PREFIX}\///}
.endif
.if ${PORT_OPTIONS:MRUBY}
USE_RUBY= yes
WITH_SWIG= yes
-CMAKE_ARGS+= -DWITH_RUBY:BOOL=true
-PLIST_SUB+= WITH_RUBY=""
-.else
-CMAKE_ARGS+= -DWITH_RUBY:BOOL=false
-PLIST_SUB+= WITH_RUBY="@comment "
.endif
.if ${PORT_OPTIONS:MJAVA}
@@ -86,39 +87,23 @@ USE_JAVA= yes
CONFIGURE_ENV+= JAVA_HOME=${JAVA_HOME}
CATEGORIES+= java
WITH_SWIG= yes
-CMAKE_ARGS+= -DWITH_JAVA:BOOL=true \
- -DJAVA_LIBDIR:PATH=${JAVALIBDIR}
-PLIST_SUB+= WITH_JAVA=""
-.else
-CMAKE_ARGS+= -DWITH_JAVA:BOOL=false
-PLIST_SUB+= WITH_JAVA="@comment "
+CMAKE_ARGS+= -DJAVA_LIBDIR:PATH=${JAVALIBDIR}
.endif
.if defined(WITH_SWIG)
BUILD_DEPENDS+= swig2.0:${PORTSDIR}/devel/swig20
.endif
-.if ${PORT_OPTIONS:MDOCS}
-BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
-.endif
-
post-patch:
-.if exists(/usr/lib/libexecinfo.so)
- ${REINPLACE_CMD} -e 's|%%LIBEXECINFO%%|/usr/lib/libexecinfo.so|' \
- ${WRKSRC}/CMakeLists.txt
-.else
- ${REINPLACE_CMD} -e 's|%%LIBEXECINFO%%|${LOCALBASE}/lib/libexecinfo.so|' \
- ${WRKSRC}/CMakeLists.txt
-.endif
+ ${REINPLACE_CMD} -e 's|%%LIBEXECINFO%%|${LOC_EXECINFO}|' \
+ -e 's|FreeBSD|${OPSYS}|g' ${WRKSRC}/CMakeLists.txt
${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
- ${WRKSRC}/cmake_modules/FindPHP5.cmake
+ ${WRKSRC}/cmake_modules/FindPHP5.cmake
.if !${PORT_OPTIONS:MDOCS}
- ${REINPLACE_CMD} -e '531s|^|#|' ${WRKSRC}/CMakeLists.txt
+ ${REINPLACE_CMD} -e '/ADD_SUBDIRECTORY(doc)/d' \
+ ${WRKSRC}/CMakeLists.txt
.endif
-#pre-build:
-# ${FIND} ${WRKSRC} -name "*.orig" -delete
-
post-install:
${LN} -sf libzorba_simplestore.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libzorba_simplestore.so.${PORTVERSION:R:R}
diff --git a/textproc/zorba/files/patch-swig_ZorbaIOStream.i b/textproc/zorba/files/patch-swig_ZorbaIOStream.i
new file mode 100644
index 000000000000..c69109ad329a
--- /dev/null
+++ b/textproc/zorba/files/patch-swig_ZorbaIOStream.i
@@ -0,0 +1,18 @@
+--- swig/ZorbaIOStream.i.orig 2012-10-03 22:35:16 UTC
++++ swig/ZorbaIOStream.i
+@@ -46,7 +46,7 @@ void ZorbaIOStream::setStream(const char
+
+ void ZorbaIOStream::setStream(const char *BYTE, size_t aLen)
+ {
+- if (aLen<0) aLen=0;
++ /* if (aLen<0) aLen=0; size_t is unsigned, check always fails */
+ if (aLen > 0)
+ memcpy(buffer, BYTE, aLen*sizeof(char));
+ len = aLen;
+@@ -71,4 +71,4 @@ void ZorbaIOStream::write(const char *BY
+ %} // end Implementation
+
+
+-%include "ZorbaIOStream.h"
+\ No newline at end of file
++%include "ZorbaIOStream.h"
diff --git a/textproc/zorba/files/patch-swig_python_zorba__api.i b/textproc/zorba/files/patch-swig_python_zorba__api.i
new file mode 100644
index 000000000000..6c0e0baaa11a
--- /dev/null
+++ b/textproc/zorba/files/patch-swig_python_zorba__api.i
@@ -0,0 +1,20 @@
+--- swig/python/zorba_api.i.orig 2012-10-03 22:35:16 UTC
++++ swig/python/zorba_api.i
+@@ -93,7 +93,7 @@ public:
+ int getIndex( const char* uri, const char* localPart ) const
+ {
+ if (attr == NULL)
+- return NULL;
++ return 0;
+ else
+ return attr->getIndex(uri, localPart);
+ };
+@@ -101,7 +101,7 @@ public:
+ int getIndex(const char* qName ) const
+ {
+ if (attr == NULL)
+- return NULL;
++ return 0;
+ else
+ return attr->getIndex(qName);
+ };
diff --git a/textproc/zorba/pkg-plist b/textproc/zorba/pkg-plist
index 1091c81f84dc..e1d8291468f8 100644
--- a/textproc/zorba/pkg-plist
+++ b/textproc/zorba/pkg-plist
@@ -92,14 +92,14 @@ lib/zorba/core/%%FULLVERSION%%/com/zorba-xquery/www/modules/libhttp-client_2.0.s
lib/zorba/core/%%FULLVERSION%%/com/zorba-xquery/www/modules/libdatetime_2.0.so
lib/zorba/core/%%FULLVERSION%%/edu/princeton/wordnet/wordnet-en.zth
lib/zorba/core/%%FULLVERSION%%/org/expath/ns/libfile_2.0.so
-%%WITH_PHP%%%%PHP_EXTLIBDIR%%/XQueryProcessor.php
-%%WITH_PHP%%%%PHP_EXTLIBDIR%%/zorba_api_wrapper.php
-%%WITH_PHP%%%%PHP_EXTLIBDIR%%/zorba_api.so
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/zorba_api.py
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/_zorba_api.so
-%%WITH_JAVA%%%%JAVASHAREDIR%%/classes/libzorba_api.so
-%%WITH_JAVA%%%%JAVASHAREDIR%%/zorba_xqj.jar
-%%WITH_JAVA%%%%JAVASHAREDIR%%/xqjapi.jar
+%%PHP%%%%PHP_EXTLIBDIR%%/XQueryProcessor.php
+%%PHP%%%%PHP_EXTLIBDIR%%/zorba_api_wrapper.php
+%%PHP%%%%PHP_EXTLIBDIR%%/zorba_api.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/zorba_api.py
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/_zorba_api.so
+%%JAVA%%%%JAVASHAREDIR%%/classes/libzorba_api.so
+%%JAVA%%%%JAVASHAREDIR%%/zorba_xqj.jar
+%%JAVA%%%%JAVASHAREDIR%%/xqjapi.jar
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
%%PORTDOCS%%%%DOCSDIR%%/NOTICE.txt
@@ -189,9 +189,9 @@ lib/zorba/core/%%FULLVERSION%%/org/expath/ns/libfile_2.0.so
%%PORTDOCS%%%%DOCSDIR%%/xqdoc/requisites/templates/www.functx.com_index.html
%%PORTDOCS%%%%DOCSDIR%%/xqdoc/requisites/templates/www.w3.org_2005_xpath-functions.html
%%PORTDOCS%%%%DOCSDIR%%/xqdoc/requisites/templates/www.w3.org_2005_xpath-functions_math.html
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_b.gif
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_r.gif
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_l.gif
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_b.gif
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_r.gif
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/xqj/html/rtab_l.gif
%%PORTDOCS%%%%DOCSDIR%%/zorba/html/JSONforXQuery.html
%%PORTDOCS%%%%DOCSDIR%%/zorba/html/W3C-WD.css
%%PORTDOCS%%%%DOCSDIR%%/zorba/html/XQueryforJSON.html
@@ -205,18 +205,18 @@ lib/zorba/core/%%FULLVERSION%%/org/expath/ns/libfile_2.0.so
%%PORTDOCS%%%%DOCSDIR%%/zorba/html/scripting_spec.html
%%PORTDOCS%%%%DOCSDIR%%/zorba/html/terminal.png
%%PORTDOCS%%%%DOCSDIR%%/zorba/xqdoc/Makefile
-%%WITH_PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_b.gif
-%%WITH_PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_r.gif
-%%WITH_PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_l.gif
-%%WITH_PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/examples/python_test.py
-%%WITH_RUBY%%share/ruby/zorba_api.so
-%%WITH_RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_b.gif
-%%WITH_RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_l.gif
-%%WITH_RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_r.gif
-%%WITH_RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/examples/ruby_test.rb
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_b.gif
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_l.gif
-%%WITH_JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_r.gif
+%%PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_b.gif
+%%PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_r.gif
+%%PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/html/rtab_l.gif
+%%PYTHON%%%%PORTDOCS%%%%DOCSDIR%%/python/examples/python_test.py
+%%RUBY%%share/ruby/zorba_api.so
+%%RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_b.gif
+%%RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_l.gif
+%%RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/html/rtab_r.gif
+%%RUBY%%%%PORTDOCS%%%%DOCSDIR%%/ruby/examples/ruby_test.rb
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_b.gif
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_l.gif
+%%JAVA%%%%PORTDOCS%%%%DOCSDIR%%/java/html/rtab_r.gif
%%DATADIR%%/uris/core/%%FULLVERSION%%/com/functx/www/index.xq
%%DATADIR%%/uris/core/%%FULLVERSION%%/com/functx/www/index_0.0.xq
%%DATADIR%%/uris/core/%%FULLVERSION%%/com/functx/www/index_0.xq