summaryrefslogtreecommitdiff
path: root/academic/rpy2/rpy2.SlackBuild
diff options
context:
space:
mode:
authorRob van Nues <sborg63@disroot.org>2020-04-24 08:04:37 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-04-24 08:04:52 +0700
commit1cae1105203f37cf75d8e23bc0e3f47e1e565376 (patch)
tree56f9c4a53d53c2ee8872c3f82f45688684a07e5b /academic/rpy2/rpy2.SlackBuild
parentf30839492c4cb2e51295963e1733761483843084 (diff)
downloadslackbuilds-1cae1105203f37cf75d8e23bc0e3f47e1e565376.tar.gz
academic/rpy2: Updated for version 3.3.1.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'academic/rpy2/rpy2.SlackBuild')
-rw-r--r--academic/rpy2/rpy2.SlackBuild25
1 files changed, 22 insertions, 3 deletions
diff --git a/academic/rpy2/rpy2.SlackBuild b/academic/rpy2/rpy2.SlackBuild
index 605121ff72..d3ee5a2f4e 100644
--- a/academic/rpy2/rpy2.SlackBuild
+++ b/academic/rpy2/rpy2.SlackBuild
@@ -22,7 +22,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=rpy2
-VERSION=${VERSION:-3.2.7}
+VERSION=${VERSION:-3.3.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -58,7 +58,7 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-v$VERSION
+rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
@@ -68,9 +68,28 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+## make sure there is R
+if ! [ -x "$(command -v R)" ]; then
+ echo 'Error: R is not installed.' >&2
+ exit 1
+fi
+
## make sure that R has been compiled with
## --enable-R-shlib
## --enable-BLAS-shlib
+RHOMLIB=$(R RHOME)/lib
+echo "R libs are in $RHOMLIB"
+
+if ! [ "$(readelf -h $RHOMLIB/libR*.so | grep DYN)" ]; then
+ echo "Error: R is not compiled with shared libraries." >&2
+ exit 1
+fi
+
+## this removes an error message from setup.py
+## https://github.com/rpy2/rpy2/issues/675
+export LD_LIBRARY_PATH="${RHOMLIB}:${LD_LIBRARY_PATH}"
+echo "LD_LIBRARY_PATH set to ${LD_LIBRARY_PATH}"
+
python3 setup.py build install --root=$PKG
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -78,7 +97,7 @@ cp -a AUTHORS gpl-2.0.txt NEWS README* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
## to facilitate dynamic linking with R,
-## libR.so and libRblas.so need to be found
+## libR.so and libRblas.so still need to be found
## https://github.com/rpy2/rpy2/issues/675
mkdir -p $PKG/etc/ld.so.conf.d/
cat $CWD/Rlibs.conf > $PKG/etc/ld.so.conf.d/Rlibs.conf