Skip to content

Commit 4b5f79b

Browse files
authored
Merge pull request #274 from r-devel/feature/install-httpgd-gdiff-workflow-v2
Add gdiff workflow support and install httpgd from GitHub with remotes
2 parents 8d17912 + 7f59ed4 commit 4b5f79b

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.Rprofile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
# .libPaths() already includes site library for default R version.
1010
.libPaths(c(.libPaths(), .Library.site))
1111

12+
# The remotes package is installed to install httpgd from GitHub
13+
# The gdiff package is installed to support visual difference testing
14+
15+
# Configure r-universe for binary package installations dynamically
16+
linux_binary_repo <- function(universe){
17+
runiverse <- sprintf('r-universe.dev/bin/linux/%s-%s/%s/',
18+
system2('lsb_release', '-sc', stdout = TRUE),
19+
R.version$arch,
20+
substr(getRversion(), 1, 3))
21+
sprintf('https://%s.%s', universe, runiverse)
22+
}
23+
24+
# Set repos for CRAN to use r-universe linux binaries
25+
options(repos = c(
26+
cran = linux_binary_repo("cran")
27+
))
28+
1229
# For PNG graphics uncomment following lines
1330
# options(vsc.use_httpgd = FALSE,
1431
# vsc.dev.args = list(width = 800, height = 600))

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \
88
software-properties-common \
99
subversion \
1010
libmagick++-dev \
11+
libpoppler-cpp-dev \
1112
&& add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" \
1213
&& wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \
1314
&& apt-get update \
@@ -22,9 +23,10 @@ RUN Rscript -e "runiverse <- sprintf('r-universe.dev/bin/linux/%s-%s/%s/', \
2223
R.version\$arch, \
2324
substr(getRversion(), 1, 3)); \
2425
print('Installing packages...'); \
25-
install.packages(c('languageserver', 'httpgd'), \
26-
repos = c(runiverse = paste0('https://cran.', runiverse), \
27-
nx10 = paste0('https://nx10.', runiverse))); \
26+
install.packages(c('languageserver', 'gdiff', 'remotes'), \
27+
repos = c(runiverse = paste0('https://cran.', runiverse))); \
28+
print('Installing httpgd from GitHub...'); \
29+
remotes::install_github('nx10/httpgd'); \
2830
print('Packages installed.')"
2931

3032
# Define env var used in GitHub Actions that build and deploy container

0 commit comments

Comments
 (0)