Skip to content

Commit

Permalink
Trac #19427: Jupyter R kernel
Browse files Browse the repository at this point in the history
This introduces a new "script" type of packages that only run a script.
This is supposed to be an alternative for optional/experimental packages
so we can use third-party package managers to install things.

In this case, the R package manager, though it would presumably be
useful for !TexLive (instead of `src/ext/texlive/texlive-install`) and
npm. But thats for future tickets...

URL: http://trac.sagemath.org/19427
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): Emmanuel Charpentier
  • Loading branch information
Release Manager authored and vbraun committed Dec 21, 2015
2 parents c12ef20 + 7316730 commit a4ec8cc
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=e1b097aeaf27c3f3db96fe9a24b4c0758e56411f
md5=008611745a98250faf73e58756131d80
cksum=3092505842
sha1=639d59d1e903d4a2319af6eaf11df50afbffb46b
md5=3af36844808f8179b9d4ce784a7f4ead
cksum=3461797330
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
131
132
11 changes: 11 additions & 0 deletions build/pkgs/r_jupyter/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

echo "Installing the Jupyter Kernel for the R-Project"

R --vanilla <<EOF
chooseCRANmirror(ind=1)
install.packages(c('rzmq','repr','IRkernel','IRdisplay'),
repos = c('http://irkernel.github.io/', getOption('repos')))
IRkernel::installspec()
EOF

1 change: 1 addition & 0 deletions build/pkgs/r_jupyter/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
script
19 changes: 18 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,9 @@ filtered_packages_list() {
[ "$PKG_TYPE" != "standard" ] && \
[ "$PKG_TYPE" != "optional" ] && \
[ "$PKG_TYPE" != "experimental" ] && \
[ "$PKG_TYPE" != "script" ] && \
[ "$PKG_TYPE" != "pip" ]; then
echo >&2 "The content of \"$PKG_TYPE_FILE\" must be 'base', 'standard', 'optional', 'experimental' or 'pip'"
echo >&2 "The content of \"$PKG_TYPE_FILE\" must be 'base', 'standard', 'optional', 'experimental', 'script', or 'pip'"
return 1
fi
Expand Down Expand Up @@ -852,6 +853,8 @@ filtered_packages_list all | while read PKG_NAME PKG_VERSION PKG_VAR; do
DEPS=" $(head -n 1 $DEP_FILE)"
elif [ "$TYPE" = optional ]; then
DEPS=' | $(STANDARD_PACKAGES)' # default for optional packages
elif [ "$TYPE" = script ]; then
DEPS=' | $(STANDARD_PACKAGES)' # default for script-only packages
elif [ "$TYPE" = pip ]; then
DEPS=' | $(INST)/$(PIP)'
else
Expand All @@ -868,6 +871,20 @@ filtered_packages_list all | while read PKG_NAME PKG_VERSION PKG_VAR; do
echo >&7 "$PKG_NAME-clean:"
echo >&7 " -sage --pip uninstall -y $PKG_NAME"
echo >&7
elif [ "$TYPE" = script ]; then
# Just run the spkg-install script
echo >&7 "$PKG_NAME:$DEPS"
echo >&7 " cd '$SAGE_ROOT' && \\"
echo >&7 " source '$SAGE_ROOT/src/bin/sage-env' && \\"
echo >&7 " sage-logger '$SAGE_ROOT/build/pkgs/$PKG_NAME/spkg-install' \$(SAGE_LOGS)/$PKG_NAME.log"
echo >&7
# Just run the spkg-uninstall script if it exists
echo >&7 "$PKG_NAME-clean:"
echo >&7 " -cd '$SAGE_ROOT' && \\"
echo >&7 " source '$SAGE_ROOT/src/bin/sage-env' && \\"
echo >&7 " '$SAGE_ROOT/build/pkgs/$PKG_NAME/spkg-uninstall'"
echo >&7
else
# Normal Sage packages
echo >&7 "\$(INST)/$PKG_VERSION:$DEPS"
Expand Down

0 comments on commit a4ec8cc

Please sign in to comment.