Skip to content

Instantly share code, notes, and snippets.

@rjpbonnal
Created October 17, 2016 08:25
Show Gist options
  • Save rjpbonnal/cc4a7a47d6a81b488e87aa176e8ed146 to your computer and use it in GitHub Desktop.
Save rjpbonnal/cc4a7a47d6a81b488e87aa176e8ed146 to your computer and use it in GitHub Desktop.
guix and rstudio
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Vicente Vera Parra <vicentemvp@gmail.com>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix 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
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages statistics)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system r)
#:use-module (guix build-system python)
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gtk)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
; #:use-module (gnu packages haskell)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
; #:use-module (gnu packages java)
; #:use-module (gnu packages machine-learning)
#:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages pcre)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages ssh)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages tls)
#:use-module (gnu packages base)
#:use-module (gnu packages web)
; #:use-module (gnu packages xml)
; #:use-module (gnu packages xorg)
#:use-module (gnu packages zip)
#:use-module (srfi srfi-1)
#:use-module (gnu packages boost)
#:use-module (gnu packages linux)
#:use-module (gnu packages wget)
#:use-module (guix build-system trivial)
#:use-module (gnu packages bootstrap)
)
(define-public rstudio-core-dictionaries
(package
(name "rstudio-core-dictionaries")
(version "0.1")
(source
(origin
(method url-fetch)
(uri "https://s3.amazonaws.com/rstudio-dictionaries/core-dictionaries.zip")
(sha256
(base32
"153lg3ai97qzbqp6zjg10dh3sfvz80v42cjw45zwz7gv1risjha3"))))
(build-system trivial-build-system)
(arguments
`(
#:modules ((guix build utils))
#:builder
(let* (
(source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(name "core-dictionaries")
(zipname (string-append name ".zip"))
(unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))
)
(begin
(use-modules (guix build utils))
(mkdir out)
(system* unzip source "-d" out)
)
)
)
)
(inputs
`(("wget" ,wget)
("unzip", unzip)))
(home-page "https://s3.amazonaws.com/rstudio-dictionaries/")
(synopsis "Non-interactive command-line utility for downloading files")
(description
"RStudio dictionaries.")
(license license:agpl3)))
(define-public rstudio-mathjax
(package
(name "rstudio-mathjax")
(version "0.23")
(source
(origin
(method url-fetch)
(uri "https://s3.amazonaws.com/rstudio-buildtools/mathjax-23.zip")
(sha256
(base32
"16fnq4jsifbldjcvrri3g6d7zhbh22k3jas2jpigmmphnmgd6hjj"))))
(build-system trivial-build-system)
(arguments
`(
#:modules ((guix build utils))
#:builder
(let* (
(source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(name "mathjax-23")
(zipname (string-append name ".zip"))
(unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))
)
(begin
(use-modules (guix build utils))
(mkdir out)
(system* unzip source "-d" out)
)
)
)
)
(inputs
`(("wget" ,wget)
("unzip", unzip)))
(home-page "https://s3.amazonaws.com/rstudio-buildtools/")
(synopsis "Non-interactive command-line utility for downloading files")
(description
"RStudio Math Jax")
(license license:agpl3)))
(define-public rstudio-pandoc
(package
(name "rstudio-pandoc")
(version "1.15.2")
(source
(origin
(method url-fetch)
(uri "https://s3.amazonaws.com/rstudio-buildtools/pandoc-1.15.2.zip")
(sha256
(base32
"00cj76900xa12mdkc0qb1mfvmfwyx0gfadzss10y3fazm584vngb"))))
(build-system trivial-build-system)
(arguments
`(
#:modules ((guix build utils))
#:builder
(let* (
(source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(name "pandoc-1.15.2")
(zipname (string-append name ".zip"))
(unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))
)
(begin
(use-modules (guix build utils))
(mkdir out)
(system* unzip source "-d" out)
)
)
)
)
(inputs
`(("wget" ,wget)
("unzip", unzip)))
(home-page "https://s3.amazonaws.com/rstudio-buildtools/")
(synopsis "Non-interactive command-line utility for downloading files")
(description
"RStudio pandoc")
(license license:agpl3)))
(define-public rstudio
(package
(name "rstudio")
(version "0.99.903")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/rstudio/rstudio/archive/v" version ".tar.gz"))
(sha256
(base32
"0g1sk4qks28sy3jlf1rfpffbx75vg7j7495fixp0svkzdxxgw0l9"))))
(build-system cmake-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'configure 'set-common-dictionaries
(lambda* (#:key inputs #:allow-other-keys)
(let* (
(rstudio-core-dictionaries (assoc-ref inputs "rstudio-core-dictionaries"))
(rstudio-mathjax (assoc-ref inputs "rstudio-mathjax"))
(rstudio-arch (string-replace (system) "-.*" ""))
)
(substitute* '("src/cpp/session/CMakeLists.txt")
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/dictionaries") rstudio-core-dictionaries)
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/mathjax-23") rstudio-mathjax)
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/pandoc") (string-append rstudio-pandoc "/linux/debian/" rstudio-arch))
) ;substitute
(substitute* '("src/cpp/conf/rsession-dev.conf")
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/dictionaries") rstudio-core-dictionaries)
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/mathjax-23") rstudio-mathjax)
) ;substitute
(substitute* '("src/cpp/conf/rdesktop-dev.conf")
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/dictionaries") rstudio-core-dictionaries)
(("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/common/mathjax-23") rstudio-mathjax)
) ;substitute
) ;let
) ;lambda
) ;add-before
) ;modify-phases
#:configure-flags
'(
"-DRSTUDIO_TARGET=Server"
"-DCMAKE_BUILD_TYPE=Release"
)
))
(inputs
`(
("r" ,r)
("zlib",zlib)
("openssl",openssl)
("boost",boost)
("linux-pam",linux-pam)
("wget",wget)
("rstudio-core-dictionaries",rstudio-core-dictionaries)
("rstudio-mathjax",rstudio-mathjax)
;("rstudio-pandoc",rstudio-pandoc)
)
)
;(native-search-paths
;(list (search-path-specification
; (variable "R_LIBS_SITE")
; (files (list "site-library/")))))
(home-page "https://www.rstudio.com")
(synopsis "Open source and enterprise-ready professional software for R")
(description "RStudio is an integrated development environment (IDE) for R. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, debugging and workspace management.
RStudio is available in open source and commercial editions and runs on the desktop (Windows, Mac, and Linux) or in a browser connected to RStudio Server or RStudio Server Pro (Debian/Ubuntu, RedHat/CentOS, and SUSE Linux).
")
(license license:agpl3)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment