Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions build/pkgs/r/spkg-configure.m4

This file was deleted.

6 changes: 5 additions & 1 deletion build/pkgs/r_jupyter/dependencies
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
notebook r
notebook rpy2

----------
R is the real dependency. But SPKG r is a dummy package, and does not install R.
Since SPKG rpy2 checks for the system R, we put rpy2 as a dependency instead.
2 changes: 1 addition & 1 deletion build/pkgs/rpy2/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
r cffi tzlocal pytz jinja2 | $(PYTHON_TOOLCHAIN) pycparser $(PYTHON)
cffi tzlocal pytz jinja2 | $(PYTHON_TOOLCHAIN) pycparser $(PYTHON)

----------
All lines of this file are ignored except the first.
42 changes: 32 additions & 10 deletions build/pkgs/rpy2/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
SAGE_SPKG_CONFIGURE([rpy2], [
SAGE_PYTHON_PACKAGE_CHECK([rpy2])
SAGE_PYTHON_PACKAGE_CHECK([rpy2])
], [dnl REQUIRED-CHECK
AC_REQUIRE([SAGE_SPKG_CONFIGURE_R])
dnl rpy2 is only needed when there is a usable system R
AS_VAR_IF([sage_spkg_install_r], [yes], [dnl
AS_VAR_IF([sage_use_system_r], [installed], [dnl
dnl Legacy SPKG installation of r
AS_VAR_SET([SPKG_REQUIRE], [yes])
], [dnl No system package, no legacy SPKG installation
AS_VAR_SET([SPKG_REQUIRE], [no])
])
dnl rpy2 is only needed when there is a usable system R
dnl Check for the R installation and version
dnl https://rpy2.github.io/doc/v3.4.x/html/overview.html#requirements
m4_pushdef([SAGE_R_MINVER], ["3.5"])
PKG_CHECK_MODULES([R], [libR >= SAGE_R_MINVER], [dnl
AC_PATH_PROG([R_EXECUTABLE], [R])
AS_IF([test "x$R_EXECUTABLE" = x], [dnl
AC_MSG_NOTICE([R is not found])
dnl No R found, so do not require rpy2 package
AS_VAR_SET([SPKG_REQUIRE], [no])
], [dnl Extract R version
AC_MSG_CHECKING([for version of R executable])
R_VERSION=$($R_EXECUTABLE --version | sed -n 's/^R version \([[0-9.]]*\).*/\1/p')
AC_MSG_RESULT([$R_VERSION])
dnl Extract libR version
AC_MSG_CHECKING([for version of libR])
LIBR_VERSION=$(pkg-config --modversion libR)
AC_MSG_RESULT([$LIBR_VERSION])
dnl Compare R and libR versions
AS_IF([test "x$R_VERSION" = "x$LIBR_VERSION"], [dnl
AC_MSG_NOTICE([R and libR versions match ($R_VERSION)])
dnl Good system R is found, require rpy2 package
AS_VAR_SET([SPKG_REQUIRE], [yes])
], [dnl R and libR versions do not match
AC_MSG_NOTICE([R version ($R_VERSION) does not match libR version ($LIBR_VERSION)])
AS_VAR_SET([SPKG_REQUIRE], [no])
])
])
], [dnl libR not found or outdated
AS_VAR_SET([SPKG_REQUIRE], [no])
])
m4_popdef([SAGE_R_MINVER])
])
Loading