summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-02-20 11:11:03 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-02-20 11:11:03 +0100
commit26fba1a759f67f2c6c22049994db328550d45e30 (patch)
treee5b6a1c7c09467e7afa16d3cd7f09bdf603850df
parent761aaefd4a3424e312439dbffa17a3c8955966ce (diff)
rstudio: rstudio-server: Use G-expressions.
* guix-science/packages/rstudio.scm (rstudio-server)[arguments]: Use G-expression. (rstudio)[arguments]: Adjust to modify inherited G-expression arguments.
-rw-r--r--guix-science/packages/rstudio.scm197
1 files changed, 98 insertions, 99 deletions
diff --git a/guix-science/packages/rstudio.scm b/guix-science/packages/rstudio.scm
index a9b5a4a..cbdd6e6 100644
--- a/guix-science/packages/rstudio.scm
+++ b/guix-science/packages/rstudio.scm
@@ -270,9 +270,10 @@ web browser.")
270 "src/cpp/server/include/server/ServerOptions.gen.hpp"))))) 270 "src/cpp/server/include/server/ServerOptions.gen.hpp")))))
271 (build-system cmake-build-system) 271 (build-system cmake-build-system)
272 (arguments 272 (arguments
273 `(#:out-of-source? #f ; required by 'make-writable 273 (list
274 #:configure-flags 274 #:out-of-source? #f ; required by 'make-writable
275 (list 275 #:configure-flags
276 '(list
276 "-DRSTUDIO_TARGET=Server" 277 "-DRSTUDIO_TARGET=Server"
277 "-DCMAKE_BUILD_TYPE=Release" 278 "-DCMAKE_BUILD_TYPE=Release"
278 "-DRSTUDIO_USE_SYSTEM_YAML_CPP=1" 279 "-DRSTUDIO_USE_SYSTEM_YAML_CPP=1"
@@ -281,84 +282,84 @@ web browser.")
281 "-DQUARTO_ENABLED=0" 282 "-DQUARTO_ENABLED=0"
282 ;; auto-detection seems to be broken with boost 1.72 283 ;; auto-detection seems to be broken with boost 1.72
283 "-DRSTUDIO_BOOST_SIGNALS_VERSION=2") 284 "-DRSTUDIO_BOOST_SIGNALS_VERSION=2")
284 #:tests? #f ; no tests exist 285 #:tests? #f ; no tests exist
285 #:modules ((guix build cmake-build-system) 286 #:modules '((guix build cmake-build-system)
286 (guix build utils) 287 (guix build utils)
287 (ice-9 match)) 288 (ice-9 match))
288 #:phases 289 #:phases
289 (modify-phases %standard-phases 290 #~(modify-phases %standard-phases
290 (add-after 'unpack 'unpack-dictionary 291 (add-after 'unpack 'unpack-dictionary
291 (lambda* (#:key inputs native-inputs #:allow-other-keys) 292 (lambda* (#:key inputs native-inputs #:allow-other-keys)
292 (let ((dict-dir "dependencies/dictionaries")) 293 (let ((dict-dir "dependencies/dictionaries"))
293 (mkdir dict-dir) 294 (mkdir dict-dir)
294 (invoke "unzip" "-qd" dict-dir (assoc-ref inputs "dict-source-tarball"))))) 295 (invoke "unzip" "-qd" dict-dir (assoc-ref inputs "dict-source-tarball")))))
295 ;; change the default paths for mathjax and pandoc and a hardcoded call to `which` 296 ;; change the default paths for mathjax and pandoc and a hardcoded call to `which`
296 (add-after 'unpack 'patch-paths 297 (add-after 'unpack 'patch-paths
297 (lambda* (#:key inputs outputs #:allow-other-keys) 298 (lambda* (#:key inputs outputs #:allow-other-keys)
298 ;; Don't build panmirror. We already got it. 299 ;; Don't build panmirror. We already got it.
299 (substitute* "src/gwt/build.xml" 300 (substitute* "src/gwt/build.xml"
300 (("target name=\"panmirror\"" m) 301 (("target name=\"panmirror\"" m)
301 (string-append m " if=\"false\""))) 302 (string-append m " if=\"false\"")))
302 (substitute* "src/cpp/session/CMakeLists.txt" 303 (substitute* "src/cpp/session/CMakeLists.txt"
303 (("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/mathjax-27") 304 (("\\$\\{RSTUDIO_DEPENDENCIES_DIR\\}/mathjax-27")
304 (assoc-ref inputs "mathjax")) 305 (assoc-ref inputs "mathjax"))
305 (("set\\(RSTUDIO_DEPENDENCIES_PANDOC_DIR.*") 306 (("set\\(RSTUDIO_DEPENDENCIES_PANDOC_DIR.*")
306 (string-append "set(RSTUDIO_DEPENDENCIES_PANDOC_DIR " 307 (string-append "set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "
307 (assoc-ref inputs "pandoc") ")\n")) 308 (assoc-ref inputs "pandoc") ")\n"))
308 (("DESTINATION \"\\$\\{RSTUDIO_INSTALL_BIN\\}/pandoc\"") 309 (("DESTINATION \"\\$\\{RSTUDIO_INSTALL_BIN\\}/pandoc\"")
309 (string-append "DESTINATION \""(assoc-ref outputs "out") "/share/pandoc\""))) 310 (string-append "DESTINATION \"" #$output "/share/pandoc\"")))
310 (install-file (search-input-file inputs "/include/catch2/catch.hpp") 311 (install-file (search-input-file inputs "/include/catch2/catch.hpp")
311 "src/cpp/tests/cpp/tests/vendor/") 312 "src/cpp/tests/cpp/tests/vendor/")
312 (substitute* "src/cpp/session/session-options.json" 313 (substitute* "src/cpp/session/session-options.json"
313 (("resources/mathjax-27") (assoc-ref inputs "mathjax"))) 314 (("resources/mathjax-27") (assoc-ref inputs "mathjax")))
314 (substitute* "src/cpp/session/include/session/SessionConstants.hpp" 315 (substitute* "src/cpp/session/include/session/SessionConstants.hpp"
315 ;; XXX: It looks like there’s a bug in RStudio right now, which 316 ;; XXX: It looks like there’s a bug in RStudio right now, which
316 ;; appends the binary name “pandoc” to this path, if it is an 317 ;; appends the binary name “pandoc” to this path, if it is an
317 ;; absolute path. 318 ;; absolute path.
318 (("bin/pandoc") (string-append (assoc-ref inputs "pandoc") "/bin"))) 319 (("bin/pandoc") (string-append (assoc-ref inputs "pandoc") "/bin")))
319 (substitute* "src/cpp/core/r_util/REnvironmentPosix.cpp" 320 (substitute* "src/cpp/core/r_util/REnvironmentPosix.cpp"
320 (("runCommand\\(\"which") (string-append "runCommand(\"" (assoc-ref inputs "which") "/bin/which"))) 321 (("runCommand\\(\"which") (string-append "runCommand(\"" (assoc-ref inputs "which") "/bin/which")))
321 (substitute* "src/cpp/session/modules/clang/CodeCompletion.cpp" 322 (substitute* "src/cpp/session/modules/clang/CodeCompletion.cpp"
322 (("/usr/bin/which") (string-append (assoc-ref inputs "which") "/bin/which"))) 323 (("/usr/bin/which") (string-append (assoc-ref inputs "which") "/bin/which")))
323 (substitute* '("src/cpp/session/SessionConsoleProcess.cpp" "src/cpp/session/modules/SessionTerminalShell.cpp") 324 (substitute* '("src/cpp/session/SessionConsoleProcess.cpp" "src/cpp/session/modules/SessionTerminalShell.cpp")
324 (("/usr/bin/env") (string-append (assoc-ref inputs "coreutils") "/bin/env"))) 325 (("/usr/bin/env") (string-append (assoc-ref inputs "coreutils") "/bin/env")))
325 (substitute* '("src/cpp/session/modules/SessionFiles.R") 326 (substitute* '("src/cpp/session/modules/SessionFiles.R")
326 (("\"zip\"") (string-append "\"" (assoc-ref inputs "zip") "/bin/zip\""))) 327 (("\"zip\"") (string-append "\"" (assoc-ref inputs "zip") "/bin/zip\"")))
327 (substitute* '("src/cpp/session/modules/SessionFiles.cpp") 328 (substitute* '("src/cpp/session/modules/SessionFiles.cpp")
328 (("/usr/bin/unzip") (string-append (assoc-ref inputs "unzip") "/bin/unzip"))) 329 (("/usr/bin/unzip") (string-append (assoc-ref inputs "unzip") "/bin/unzip")))
329 (substitute* "src/cpp/core/system/Architecture.cpp" 330 (substitute* "src/cpp/core/system/Architecture.cpp"
330 (("/usr/bin/uname") (string-append (assoc-ref inputs "coreutils") "/bin/uname"))) 331 (("/usr/bin/uname") (string-append (assoc-ref inputs "coreutils") "/bin/uname")))
331 (substitute* "src/cpp/session/SessionModuleContext.cpp" 332 (substitute* "src/cpp/session/SessionModuleContext.cpp"
332 (("cmd\\(\"file\"\\)") (string-append "cmd(\"" (assoc-ref inputs "file") "/bin/file\")"))) 333 (("cmd\\(\"file\"\\)") (string-append "cmd(\"" (assoc-ref inputs "file") "/bin/file\")")))
333 (substitute* "src/cpp/session/modules/SessionGit.cpp" 334 (substitute* "src/cpp/session/modules/SessionGit.cpp"
334 (("\"ssh-add") (string-append "\"" (assoc-ref inputs "openssh") "/bin/ssh-add")) 335 (("\"ssh-add") (string-append "\"" (assoc-ref inputs "openssh") "/bin/ssh-add"))
335 (("\"ssh-agent") (string-append "\"" (assoc-ref inputs "openssh") "/bin/ssh-agent"))) 336 (("\"ssh-agent") (string-append "\"" (assoc-ref inputs "openssh") "/bin/ssh-agent")))
336 (substitute* "src/cpp/session/modules/SessionSVN.cpp" 337 (substitute* "src/cpp/session/modules/SessionSVN.cpp"
337 (("\"patch\"") (string-append "\"" (assoc-ref inputs "patch") "/bin/patch\""))))) 338 (("\"patch\"") (string-append "\"" (assoc-ref inputs "patch") "/bin/patch\"")))))
338 (add-after 'unpack 'set-environment-variables 339 (add-after 'unpack 'set-environment-variables
339 (lambda* (#:key inputs #:allow-other-keys) 340 (lambda* (#:key inputs #:allow-other-keys)
340 (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) 341 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
341 ;; set proper version information 342 ;; set proper version information
342 (match (string-split ,version (char-set #\. #\+)) 343 (match (string-split #$version (char-set #\. #\+))
343 ((major minor patch suffix) 344 ((major minor patch suffix)
344 (setenv "RSTUDIO_VERSION_MAJOR" major) 345 (setenv "RSTUDIO_VERSION_MAJOR" major)
345 (setenv "RSTUDIO_VERSION_MINOR" minor) 346 (setenv "RSTUDIO_VERSION_MINOR" minor)
346 (setenv "RSTUDIO_VERSION_PATCH" patch) 347 (setenv "RSTUDIO_VERSION_PATCH" patch)
347 (setenv "RSTUDIO_VERSION_SUFFIX" (string-append "+" suffix)))) 348 (setenv "RSTUDIO_VERSION_SUFFIX" (string-append "+" suffix))))
348 (setenv "PACKAGE_OS" "GNU Guix"))) 349 (setenv "PACKAGE_OS" "GNU Guix")))
349 ;; Must be run after patch-source-shebangs, which changes 350 ;; Must be run after patch-source-shebangs, which changes
350 ;; report-option.sh’s interpreter line. 351 ;; report-option.sh’s interpreter line.
351 (add-before 'configure 'generate-server-options 352 (add-before 'configure 'generate-server-options
352 (lambda _ 353 (lambda _
353 ;; Generate *.gen.hpp files deleted by source snippet. 354 ;; Generate *.gen.hpp files deleted by source snippet.
354 (with-directory-excursion "src/cpp" 355 (with-directory-excursion "src/cpp"
355 (invoke "./generate-options.R")))) 356 (invoke "./generate-options.R"))))
356 (add-after 'install 'install-panmirror 357 (add-after 'install 'install-panmirror
357 (lambda* (#:key inputs outputs #:allow-other-keys) 358 (lambda* (#:key inputs #:allow-other-keys)
358 (let ((panmirror (string-append (assoc-ref inputs "js-panmirror") 359 (let ((panmirror (string-append (assoc-ref inputs "js-panmirror")
359 "/share/javascript/panmirror")) 360 "/share/javascript/panmirror")))
360 (out (assoc-ref outputs "out"))) 361 (copy-recursively panmirror
361 (copy-recursively panmirror (string-append out "/www/js/panmirror")))))))) 362 (string-append #$output "/www/js/panmirror"))))))))
362 (native-inputs 363 (native-inputs
363 `(("unzip" ,unzip) 364 `(("unzip" ,unzip)
364 ("catch2" ,catch2) 365 ("catch2" ,catch2)
@@ -451,29 +452,27 @@ user's @file{~/.local/share/rstudio/r-versions}.")))
451 (arguments 452 (arguments
452 (substitute-keyword-arguments (package-arguments rstudio-server) 453 (substitute-keyword-arguments (package-arguments rstudio-server)
453 ((#:configure-flags flags) 454 ((#:configure-flags flags)
454 '(list "-DRSTUDIO_TARGET=Desktop" 455 #~(list "-DRSTUDIO_TARGET=Desktop"
455 "-DCMAKE_BUILD_TYPE=Release" 456 "-DCMAKE_BUILD_TYPE=Release"
456 "-DRSTUDIO_USE_SYSTEM_YAML_CPP=1" 457 "-DRSTUDIO_USE_SYSTEM_YAML_CPP=1"
457 "-DRSTUDIO_USE_SYSTEM_BOOST=1" 458 "-DRSTUDIO_USE_SYSTEM_BOOST=1"
458 "-DRSTUDIO_USE_SYSTEM_SOCI=1" 459 "-DRSTUDIO_USE_SYSTEM_SOCI=1"
459 "-DQUARTO_ENABLED=0" 460 "-DQUARTO_ENABLED=0"
460 ;; auto-detection seems to be broken with boost 1.72 461 ;; auto-detection seems to be broken with boost 1.72
461 "-DRSTUDIO_BOOST_SIGNALS_VERSION=2" 462 "-DRSTUDIO_BOOST_SIGNALS_VERSION=2"
462 (string-append "-DQT_QMAKE_EXECUTABLE=" 463 (string-append "-DQT_QMAKE_EXECUTABLE="
463 (assoc-ref %build-inputs "qtbase") 464 #$(this-package-input "qtbase")
464 "/bin/qmake"))) 465 "/bin/qmake")))
465 ((#:phases phases) 466 ((#:phases phases)
466 `(modify-phases ,phases 467 #~(modify-phases #$phases
467 (add-after 'install 'wrap-program 468 (add-after 'install 'wrap-program
468 (lambda* (#:key inputs outputs #:allow-other-keys) 469 (lambda* (#:key inputs #:allow-other-keys)
469 (let* ((out (assoc-ref outputs "out")) 470 (let ((bin (string-append #$output "/bin"))
470 (bin (string-append out "/bin"))
471 (qtwebengine-path (string-append 471 (qtwebengine-path (string-append
472 (assoc-ref inputs "qtwebengine") 472 #$(this-package-input "qtwebengine")
473 "/lib/qt5/libexec/QtWebEngineProcess"))) 473 "/lib/qt5/libexec/QtWebEngineProcess")))
474 (wrap-program (string-append bin "/rstudio") 474 (wrap-program (string-append bin "/rstudio")
475 `("QTWEBENGINEPROCESS_PATH" ":" = (,qtwebengine-path)))) 475 `("QTWEBENGINEPROCESS_PATH" ":" = (,qtwebengine-path))))))))))
476 #t))))))
477 (inputs 476 (inputs
478 (modify-inputs (package-inputs rstudio-server) 477 (modify-inputs (package-inputs rstudio-server)
479 (prepend qtbase-5 478 (prepend qtbase-5