# SPDX-License-Identifier: CC0-1.0 # プログラミング言語の名前 language = 'R' # この言語として表示される文字列 display = 'R (GNU R 4.5.0)' # コンパイラ/インタプリタのライセンス # https://www.r-project.org/Licenses/ license = [ { name = 'AGPL-3.0-only', url = 'https://www.r-project.org/Licenses/AGPL-3' }, { name = 'Artistic-2.0', url = 'https://www.r-project.org/Licenses/Artistic-2.0' }, { name = 'BSD-2-Clause', url = 'https://www.r-project.org/Licenses/BSD_2_clause' }, { name = 'BSD-3-Clause', url = 'https://www.r-project.org/Licenses/BSD_3_clause' }, { name = 'GPL-2.0-only', url = 'https://www.r-project.org/Licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://www.r-project.org/Licenses/GPL-3' }, { name = 'LGPL-2.0-only', url = 'https://www.r-project.org/Licenses/LGPL-2' }, { name = 'LGPL-2.1-only', url = 'https://www.r-project.org/Licenses/LGPL-2.1' }, { name = 'LGPL-3.0-only', url = 'https://www.r-project.org/Licenses/LGPL-3' }, { name = 'MIT', url = 'https://www.r-project.org/Licenses/MIT' }, { name = 'CC-BY-SA-4.0', url = 'https://www.r-project.org/Licenses/CC-BY-SA-4.0' }, ] # 追加でインストールされるライブラリ一覧 library.cli = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '3.6.4' } library.generics = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '0.1.3' } library.glue = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.8.0' } library.magrittr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '2.0.3' } library.fansi = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = true, version = '1.0.6' } library.utf8 = { license = [ { name = 'Apache-2.0', url = 'https://cran.r-project.org/web/packages/utf8/LICENSE' }, ], indirect = true, version = '1.2.4' } library.R6 = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '2.6.1' } library.rlang = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.1.6' } library.pkgconfig = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '2.0.3' } library.withr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '3.0.2' } library.lifecycle = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.0.4' } library.vctrs = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '0.6.5' } library.pillar = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.10.2' } library.tibble = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '3.2.1' } library.tidyselect = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.2.1' } library.dplyr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '1.1.4' } library.proxy = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, ], indirect = true, version = '0.4-27' } library.e1071 = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = false, version = '1.7-16' } library.gtools = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, ], indirect = false, version = '3.9.5' } library.cpp11 = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '0.5.2' } library.timechange = { license = [ { name = 'GPL-3.0-or-later', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = true, version = '0.3.0' } library.lubridate = { license = [ { name = 'GPL-2.0-or-later', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = false, version = '1.9.4' } library.purrr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '1.0.4' } library.Rcpp = { license = [ { name = 'GPL-2.0-or-later', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = false, version = '1.0.14' } library.clipr = { license = [ { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = true, version = '0.8.0' } library.crayon = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.5.3' } library.hms = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.1.3' } library.bit = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = true, version = '4.6.0' } library.bit64 = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, { name = 'GPL-3.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-3' }, ], indirect = false, version = '4.6.0-1' } library.prettyunits = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.2.0' } library.progress = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.2.3' } library.tzdb = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '0.5.0' } library.vroom = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = true, version = '1.6.5' } library.readr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '2.1.5' } library.sets = { license = [ { name = 'GPL-2.0-only', url = 'https://cran.r-project.org/web/licenses/GPL-2' }, ], indirect = false, version = '1.0-25' } library.stringi = { license = [ { name = 'BSD-2-Clause', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, { name = 'BSD-3-Clause', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, { name = 'GPL-2.0-or-later', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, { name = 'ICU', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, { name = 'NAIST-2003', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, { name = 'Unicode-3.0', url = 'https://cran.r-project.org/web/packages/stringi/LICENSE' }, ], indirect = true, version = '1.8.7' } library.stringr = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '1.5.1' } library.zeallot = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '0.1.0' } library.collections = { license = [ { name = 'MIT', url = 'https://cran.r-project.org/web/licenses/MIT' }, ], indirect = false, version = '0.3.7' } # 配置するファイル名 filename = 'Main.R' # インストールスクリプト install = ''' # ***** R 4.5.0をバージョン指定してインストール ***** # 作業フォルダ作成 mkdir /tmp/r-install cd /tmp/r-install # wgetインストール sudo apt install -y wget # ソフトウェアファイルをダウンロード wget https://cloud.r-project.org/bin/linux/ubuntu/noble-cran40/r-base-core_4.5.0-3.2404.0_amd64.deb wget https://cloud.r-project.org/bin/linux/ubuntu/noble-cran40/r-recommended_4.5.0-3.2404.0_all.deb wget https://cloud.r-project.org/bin/linux/ubuntu/noble-cran40/r-base_4.5.0-3.2404.0_all.deb wget https://cloud.r-project.org/bin/linux/ubuntu/noble-cran40/r-base-dev_4.5.0-3.2404.0_all.deb # ソフトウェアをインストール sudo apt install -y ./r-base-core_4.5.0-3.2404.0_amd64.deb sudo apt install -y ./r-recommended_4.5.0-3.2404.0_all.deb sudo apt install -y ./r-base_4.5.0-3.2404.0_all.deb sudo apt install -y ./r-base-dev_4.5.0-3.2404.0_all.deb # 作業フォルダ削除 cd ../ rm -r r-install # ***** パッケージをバージョン指定してインストール ***** # パッケージ: bit64, collections, dplyr, e1071, gtools, lubridate, magrittr, purrr, Rcpp, readr, sets, stringr, zeallot # バージョン指定するためソースファイルからインストールをするので、依存パッケージも手動でインストール必要 # バージョンは 2025年 4月 19日時点の最新 # --- # パッケージを配列で定義(依存関係上、この順番でインストールする) packages=("cli" "generics" "glue" "magrittr" "fansi" "utf8" "R6" "rlang" "pkgconfig" "withr" "lifecycle" "vctrs" "pillar" "tibble" "tidyselect" "dplyr" "proxy" "e1071" "gtools" "cpp11" "timechange" "lubridate" "purrr" "Rcpp" "clipr" "crayon" "hms" "bit" "bit64" "prettyunits" "progress" "tzdb" "vroom" "readr" "sets" "stringi" "stringr" "zeallot" "collections") # パッケージとバージョンの組を連想配列で定義 declare -A versions=( ["cli"]="3.6.4" ["generics"]="0.1.3" ["glue"]="1.8.0" ["magrittr"]="2.0.3" ["fansi"]="1.0.6" ["utf8"]="1.2.4" ["R6"]="2.6.1" ["rlang"]="1.1.6" ["pkgconfig"]="2.0.3" ["withr"]="3.0.2" ["lifecycle"]="1.0.4" ["vctrs"]="0.6.5" ["pillar"]="1.10.2" ["tibble"]="3.2.1" ["tidyselect"]="1.2.1" ["dplyr"]="1.1.4" ["proxy"]="0.4-27" ["e1071"]="1.7-16" ["gtools"]="3.9.5" ["cpp11"]="0.5.2" ["timechange"]="0.3.0" ["lubridate"]="1.9.4" ["purrr"]="1.0.4" ["Rcpp"]="1.0.14" ["clipr"]="0.8.0" ["crayon"]="1.5.3" ["hms"]="1.1.3" ["bit"]="4.6.0" ["bit64"]="4.6.0-1" ["prettyunits"]="1.2.0" ["progress"]="1.2.3" ["tzdb"]="0.5.0" ["vroom"]="1.6.5" ["readr"]="2.1.5" ["sets"]="1.0-25" ["stringi"]="1.8.7" ["stringr"]="1.5.1" ["zeallot"]="0.1.0" ["collections"]="0.3.7" ) # 各パッケージを処理 for PACKAGE in "${packages[@]}"; do VERSION=${versions[$PACKAGE]} # Rを使ってURLを判定 URL=$(Rscript -e " latest_info <- available.packages(); if ('$PACKAGE' %in% rownames(latest_info)) { latest_version <- latest_info['$PACKAGE', 'Version'] if ('$VERSION' == latest_version) { cat('https://cran.r-project.org/src/contrib/', '$PACKAGE', '_', '$VERSION', '.tar.gz', sep='') } else { cat('https://cran.r-project.org/src/contrib/Archive/', '$PACKAGE', '/', '$PACKAGE', '_', '$VERSION', '.tar.gz', sep='') } } else { stop('Package not found in available CRAN packages.') } " 2>/dev/null) # エラー処理 if [ $? -ne 0 ]; then echo "Error: Could not determine the URL for the package ${PACKAGE} version ${VERSION}." continue fi # パッケージをインストール echo "Installing ${PACKAGE} version ${VERSION} from ${URL}" sudo Rscript -e "install.packages('${URL}', repos=NULL, type='source', ask=FALSE)" done ''' # コンパイルスクリプト compile = ''' Rscript Main.R < /dev/null &> /dev/null Rscript -e "parse('Main.R')" && touch a.out ''' # コンパイル成否を判断するためのファイルパス object = 'a.out' # 実行コマンド execution = [ 'Rscript', 'Main.R', ]