Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
^\.Rprofile$
^\.github$
^\.github/.*
^\.cursor$
^\.cursor/.*
^\.codegraph$
^\.codegraph/.*
^.*\.Rcheck$
Expand Down
4 changes: 4 additions & 0 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "aFIPC",
"install": "bash .cursor/install.sh"
}
41 changes: 41 additions & 0 deletions .cursor/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Cloud Agent install step for the aFIPC R package.
#
# The R toolchain and CRAN dependencies (mirt, testthat, rcmdcheck, roxygen2)
# are normally already present in the prebuilt environment base image/snapshot.
# The guarded block below only runs on a bare image so this script stays
# idempotent and self-contained. R itself is pulled from the CRAN "release"
# channel (matching the r.yml CI), and CRAN packages come from r2u as prebuilt
# Ubuntu binaries so mirt does not have to be compiled from source.
set -euo pipefail

if ! command -v R >/dev/null 2>&1; then
Comment thread
seonghobae marked this conversation as resolved.
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends wget ca-certificates gnupg dirmngr

# CRAN apt repo: release R for Ubuntu noble.
wget -q -O- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc \
| sudo tee /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc >/dev/null
echo "deb [arch=amd64] https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/" \
| sudo tee /etc/apt/sources.list.d/cran_r.list
Comment thread
seonghobae marked this conversation as resolved.

# r2u: prebuilt binary CRAN packages for Ubuntu noble.
wget -q -O- https://eddelbuettel.github.io/r2u/assets/dirk_eddelbuettel_key.asc \
| sudo tee /etc/apt/trusted.gpg.d/cranapt_key.asc >/dev/null
echo "deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu noble main" \
| sudo tee /etc/apt/sources.list.d/cranapt.list
Comment thread
seonghobae marked this conversation as resolved.
printf 'Package: *\nPin: release o=CRAN-Apt Project\nPin: release l=CRAN-Apt Packages\nPin-Priority: 700\n' \
| sudo tee /etc/apt/preferences.d/99cranapt >/dev/null

sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
r-base-core r-cran-mirt r-cran-testthat r-cran-roxygen2 r-cran-rcmdcheck pandoc
Comment thread
seonghobae marked this conversation as resolved.
fi

# Install the checked-out aFIPC source into the R user library so that
# library(aFIPC) and the test suite run against the current tree.
USERLIB=$(R_PROFILE_USER=/dev/null Rscript -e 'cat(Sys.getenv("R_LIBS_USER"))')
mkdir -p "$USERLIB"
R_PROFILE_USER=/dev/null R CMD INSTALL --no-multiarch --no-staged-install -l "$USERLIB" .
Comment thread
seonghobae marked this conversation as resolved.
Comment thread
seonghobae marked this conversation as resolved.

echo "aFIPC install complete: R=$(R --version | head -1)"
Loading