diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2010-02-02 16:04:22 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2010-02-02 16:04:22 +0000 |
commit | dcdae14bd1d427de98816292af120148c05846e4 (patch) | |
tree | 065f225a8543a5fd032e87a7ae2ffdc7b49f3839 /math/R | |
parent | - Fix build when doxygen is installed. (diff) |
- Make math/libRmath to a slave port of math/R
- Add an option to build libR into a static, rather than a shared library (requested by a few users)
PR: 143076
Submitted by: Pedro F. Giffuni <giffunip@tutopia.com>
"b. f." <bf1783@googlemail.com> (maintainer)
Approved by: maintainer
Notes
Notes:
svn path=/head/; revision=249097
Diffstat (limited to 'math/R')
-rw-r--r-- | math/R/Makefile | 54 | ||||
-rw-r--r-- | math/R/files/patch-src__nmath__standalone__test.c | 11 | ||||
-rw-r--r-- | math/R/pkg-plist | 7 |
3 files changed, 64 insertions, 8 deletions
diff --git a/math/R/Makefile b/math/R/Makefile index 75a98a2ebc78..5f5ff8c069fe 100644 --- a/math/R/Makefile +++ b/math/R/Makefile @@ -6,8 +6,13 @@ # $FreeBSD$ # +.if defined(LIBRMATH_SLAVEPORT) +PORTNAME= libRmath +.else PORTNAME= R +.endif PORTVERSION= 2.10.1 +PORTREVISION= 2 CATEGORIES= math lang MASTER_SITES= http://cran.r-project.org/src/base/R-2/ \ ftp://cran.r-project.org/pub/R/src/base/R-2/ \ @@ -27,10 +32,16 @@ MASTER_SITES= http://cran.r-project.org/src/base/R-2/ \ http://probability.ca/cran/src/base/R-2/ \ http://www.ibiblio.org/pub/languages/R/CRAN/src/base/R-2/ \ http://www.bioconductor.org/CRAN/src/base/R-2/ +DISTNAME= R-${PORTVERSION} MAINTAINER= bf1783@gmail.com +.if defined(LIBRMATH_SLAVEPORT) +COMMENT= The standalone math library from R +.else COMMENT= A language for statistical computing and graphics +.endif +.if !defined(LIBRMATH_SLAVEPORT) OPTIONS= ATLAS "Use ATLAS instead of BLAS/LAPACK" off \ GHOSTSCRIPT "Enable the [dev2]bitmap() graphics devices" on \ ICU "Improve collation in multibyte locales with ICU" on \ @@ -39,6 +50,7 @@ OPTIONS= ATLAS "Use ATLAS instead of BLAS/LAPACK" off \ NLS "Build with NLS support" on \ PCRE_PORT "Use PCRE port instead of bundled source" on \ PNG "Enable the png() graphics device" on \ + STATIC_LIBR "Build a static, rather than a shared, libR" off \ TCLTK "Use Tcl/Tk (for the tcltk package)" on \ THREADS "Build a multithreaded R" on \ X11 "Enable the X11() graphics device" on \ @@ -47,22 +59,29 @@ OPTIONS= ATLAS "Use ATLAS instead of BLAS/LAPACK" off \ PDF_MANUALS "Install PDF manuals (requires TeX)" off MAN1= R.1 Rscript.1 - +.endif # !LIBRMATH_SLAVEPORT USE_LDCONFIG= yes USE_FORTRAN= yes - +MAKE_JOBS_UNSAFE= yes +GNU_CONFIGURE= yes +.if defined(LIBRMATH_SLAVEPORT) +BUILD_WRKSRC= ${WRKSRC}/src/nmath/standalone +CONFIGURE_ARGS+=--with-readline=no --with-x=no --disable-nls --with-tcltk=no --with-cairo=no \ + --with-libpng=no --with-jpeglib=no --with-iconv=no --with-ICU=no --without-libintl-prefix +USE_PERL5_BUILD= yes +.else # LIBRMATH_SLAVEPORT INSTALL_TARGET= install install-libR ALL_TARGET= all -GNU_CONFIGURE= yes USE_ICONV= yes USE_PERL5= yes CONFIGURE_ENV= INSTALL_DATA="${INSTALL} ${COPY} ${_SHROWNGRP} -m 644" \ FCFLAGS="${FFLAGS}" TAR="${TAR}" -CONFIGURE_ARGS= --enable-R-shlib --with-system-bzlib --with-system-zlib \ - rdocdir=${DOCSDIR} +CONFIGURE_ARGS= --with-system-bzlib --with-system-zlib rdocdir=${DOCSDIR} +.endif # LIBRMATH_SLAVEPORT .include <bsd.port.pre.mk> +.if !defined(LIBRMATH_SLAVEPORT) .if defined(WITH_ATLAS) LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas CONFIGURE_ARGS+=--with-blas="-lf77blas -latlas" @@ -120,6 +139,14 @@ LIB_DEPENDS+= png.5:${PORTSDIR}/graphics/png CONFIGURE_ARGS+=--with-libpng .endif +.if defined(WITH_STATIC_LIBR) +CONFIGURE_ARGS+=--enable-R-static-lib +PLIST_SUB+= STATIC_LIBR="" SHARED_LIBR="@comment " +.else +CONFIGURE_ARGS+=--enable-R-shlib +PLIST_SUB+= STATIC_LIBR="@comment " SHARED_LIBR="" +.endif + .if defined(WITHOUT_TCLTK) CONFIGURE_ARGS+=--without-tcltk PLIST_SUB+= TCLTK="@comment " @@ -170,6 +197,7 @@ INSTALL_TARGET+= install-pdf .else PLIST_SUB+= PDF_MANUAL="@comment " .endif +.endif # !LIBRMATH_SLAVEPORT post-patch: @${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|g' \ @@ -183,6 +211,7 @@ post-patch: ${WRKSRC}/config.site \ ${WRKSRC}/src/extra/tzone/tzfile.h \ ${WRKSRC}/src/scripts/javareconf +.if !defined(LIBRMATH_SLAVEPORT) .if defined(WITHOUT_NLS) @(cd ${WRKSRC}/src/library/Recommended; \ for tarfile in *.tgz *.tar.gz ; do \ @@ -198,8 +227,10 @@ check-all: build @(cd ${WRKSRC}; ${MAKE} check-all) post-install: +.if !defined(WITH_STATIC_LIBR) ${MV} ${PREFIX}/lib/libR.so ${PREFIX}/lib/libR.so.0 ${LN} -sf ${PREFIX}/lib/libR.so.0 ${PREFIX}/lib/libR.so +.endif .if defined(WITH_INFO_MANUALS) && !defined(NOPORTDOCS) @(cd ${WRKSRC}/doc/manual; \ for infofile in ${INFO}; do \ @@ -207,4 +238,17 @@ post-install: done) .endif +.else # !LIBRMATH_SLAVEPORT +do-install: + ${INSTALL_DATA} ${WRKSRC}/src/include/Rmath.h ${PREFIX}/include + ${INSTALL_DATA} ${BUILD_WRKSRC}/libRmath.a ${PREFIX}/lib + ${INSTALL_DATA} ${BUILD_WRKSRC}/libRmath.so ${PREFIX}/lib/libRmath.so.0 + (cd ${PREFIX}/lib; ${LN} -sf libRmath.so.0 libRmath.so) + +test: install + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} \ + ${MAKE_ARGS} test && ${BUILD_WRKSRC}/test) + +.endif # !LIBRMATH_SLAVEPORT + .include <bsd.port.post.mk> diff --git a/math/R/files/patch-src__nmath__standalone__test.c b/math/R/files/patch-src__nmath__standalone__test.c new file mode 100644 index 000000000000..c79bceebed0a --- /dev/null +++ b/math/R/files/patch-src__nmath__standalone__test.c @@ -0,0 +1,11 @@ +--- src/nmath/standalone/test.c.orig 2009-06-22 18:12:00.000000000 -0400 ++++ src/nmath/standalone/test.c 2009-06-22 18:12:34.000000000 -0400 +@@ -38,7 +38,7 @@ + qnorm(0.7, 0.0, 1.0, 0, 0); + printf("*** loaded '%s'\n", argv[0]); + set_seed(123, 456); +- N01_kind = AHRENS_DIETER; ++ N01type N01_kind = AHRENS_DIETER; + printf("one normal %f\n", norm_rand()); + set_seed(123, 456); + N01_kind = BOX_MULLER; diff --git a/math/R/pkg-plist b/math/R/pkg-plist index 3cfc9320042b..e7a9cdbfc905 100644 --- a/math/R/pkg-plist +++ b/math/R/pkg-plist @@ -99,7 +99,8 @@ lib/R/include/Rinternals.h lib/R/include/Rmath.h lib/R/include/Rversion.h lib/R/include/S.h -lib/R/lib/libR.so +%%STATIC_LIBR%%lib/R/lib/libR.a +%%SHARED_LIBR%%lib/R/lib/libR.so lib/R/library/KernSmooth/DESCRIPTION lib/R/library/KernSmooth/INDEX lib/R/library/KernSmooth/LICENCE @@ -1201,8 +1202,8 @@ lib/R/share/texmf/ts1aer.fd lib/R/share/texmf/ts1aett.fd lib/R/share/texmf/upquote.sty libdata/pkgconfig/libR.pc -lib/libR.so -lib/libR.so.0 +%%SHARED_LIBR%%lib/libR.so +%%SHARED_LIBR%%lib/libR.so.0 %%PORTDOCS%%%%DVI_MANUAL%%%%DOCSDIR%%/manual/R-FAQ.dvi %%DOCSDIR%%/manual/R-FAQ.html %%PORTDOCS%%%%PDF_MANUAL%%%%DOCSDIR%%/manual/R-FAQ.pdf |