~ruther/guix-local

6c02d882d2b486a3f8534e576da7ff05d5c2fecd — Ricardo Wurmus 4 months ago fe07e80
gnu: r-bslib: Ensure that copied files are writable.

* gnu/packages/cran.scm (r-bslib)[arguments]: Add phase 'fix-file-permissions.

Change-Id: Idccb1ef5a271f04f50e60b4a639c87bf2ac87b4e
1 files changed, 13 insertions(+), 0 deletions(-)

M gnu/packages/cran.scm
M gnu/packages/cran.scm => gnu/packages/cran.scm +13 -0
@@ 12922,6 12922,19 @@ Markdown documents.  More generally, icons can be inserted in any
                           (guix build minify-build-system))
      #:phases
      #~(modify-phases (@ (guix build r-build-system) %standard-phases)
          ;; When using themes, bslib copies theme dependencies, such as
          ;; bootstrap.bundle.min.js or selectize.min.js, into a temporary
          ;; directory.  Since these files are copied from the read-only
          ;; store, they end up with read-only permissions.  As a result,
          ;; bslib cannot overwrite these files as needed, because it has no
          ;; permission to write to the files.
          (add-after 'unpack 'fix-file-permissions
            (lambda _
              (substitute* "R/bs-dependencies.R"
                (("overwrite = TRUE")
                 (string-append "overwrite = TRUE, copy.mode = FALSE"))
                (("file.copy\\(precompiled_css, out_file\\)")
                 "file.copy(precompiled_css, out_file, copy.mode = FALSE)"))))
          (add-after 'unpack 'process-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/"