summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2017-04-04 16:05:28 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-04-04 18:05:28 -0500
commit46f25a4e0a43ea1ea8e1aaddbcdf18f6f20badba (patch)
treeab5479d44fe275d55a6d0b3a0623d45c565ad36a /var
parent0038ea84a1c5e105cdc171b04c7369cdf9b5bd9f (diff)
downloadspack-46f25a4e0a43ea1ea8e1aaddbcdf18f6f20badba.tar.gz
spack-46f25a4e0a43ea1ea8e1aaddbcdf18f6f20badba.tar.bz2
spack-46f25a4e0a43ea1ea8e1aaddbcdf18f6f20badba.tar.xz
spack-46f25a4e0a43ea1ea8e1aaddbcdf18f6f20badba.zip
Add package for open source Shiny Server (#3688)
* The beginnings of a package for shiny-server Just stashing a WIP. This doesn't work. This goes for a while and/but blows up with some OpenSSL related issue. * Make it work! Yay! * shiny-server needs R with X support My environment gets this for "free" from my packages.yaml, but it should be explicity. * Address feedback - python version - gcc dependency - Flake8 comment rules * Richer caveats and warnings. * Convert to CMakePackage and fix python version typo * Fix typo: noqab -> noqa * Ensure proper build location, clean up comments
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/shiny-server/package.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/shiny-server/package.py b/var/spack/repos/builtin/packages/shiny-server/package.py
new file mode 100644
index 0000000000..941921c795
--- /dev/null
+++ b/var/spack/repos/builtin/packages/shiny-server/package.py
@@ -0,0 +1,77 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class ShinyServer(CMakePackage):
+ """Shiny server lets you put shiny web applications and interactive
+ documents online. Take your shiny apps and share them with your
+ organization or the world."""
+
+ #
+ # HEADS UP:
+ # 1. The shiny server installation step will download various node
+ # and npm bits from the net. They seem to have them well
+ # constrained ("npm shrinkwrap"?), but this package is not
+ # "air gappable".
+ # 2. Docs say that it requires 'gcc'. depends_on() won't do the
+ # right thing, it's Up To You.
+ #
+ homepage = "https://www.rstudio.com/products/shiny/shiny-server/"
+ url = "https://github.com/rstudio/shiny-server/archive/v1.5.3.838.tar.gz"
+
+ version('1.5.3.838', '96f20fdcdd94c9e9bb851baccb82b97f')
+
+ depends_on('python@:2.9.99') # docs say: "Really. 3.x will not work"
+ depends_on('cmake@2.8.10:')
+ depends_on('git')
+ depends_on('r+X')
+ depends_on('openssl')
+
+ def cmake_args(self):
+ spec = self.spec
+ options = []
+
+ options.extend([
+ "-DPYTHON=%s" % join_path(spec['python'].prefix.bin, 'python'),
+ ])
+
+ return options
+
+ # Recompile the npm modules included in the project
+ @run_after('build')
+ def build_node(self):
+ bash = which('bash')
+ mkdirp('build')
+ bash('-c', 'bin/npm --python="$PYTHON" install')
+ bash('-c', 'bin/node ./ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --python="$PYTHON" rebuild') # noqa: E501
+
+ def setup_environment(self, spack_env, run_env):
+ run_env.prepend_path('PATH',
+ join_path(self.prefix, 'shiny-server', 'bin'))
+ # shiny comes with its own pandoc; hook it up...
+ run_env.prepend_path('PATH',
+ join_path(self.prefix, 'shiny-server',
+ 'ext', 'pandoc', 'static'))