Skip to content

Add rtools and add registry for R #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions bucket/r-release.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,41 @@
"Copy-Item \"$dir\\bin\\R.exe\" \"$dir\\bin\\Rscript.exe\""
]
},
"post_install": [
"$version_cur = [Version]\"$version\"",
"$version_40 = [Version]\"4.0.0\"",
"$version_42 = [Version]\"4.2.0\"",
"if ($version_cur -lt $version_40) {",
" if ($architecture -eq '32bit') {",
" $pathenv = 'PATH=\"${RTOOLS35_HOME-C:/Rtools}/bin;${RTOOLS35_HOME-C:/Rtools}/mingw_32/bin;${PATH}\"'",
" } else {",
" $pathenv = 'PATH=\"${RTOOLS35_HOME-C:/Rtools}/bin;${RTOOLS35_HOME-C:/Rtools}/mingw_64/bin;${PATH}\"'",
" }",
" [IO.File]::WriteAllLines(\"$dir\\etc\\Renviron.site\", $pathenv)",
"}",
"if (($version_cur -lt $version_42) -and ($version_cur -ge $version_40)) {",
" $pathenv = 'PATH=\"${RTOOLS40_HOME-C:/rtools40}/usr/bin;${PATH}\"'",
" [IO.File]::WriteAllLines(\"$dir\\etc\\Renviron.site\", $pathenv)",
"}",
"$original_dir_path = \"$original_dir\".Replace('\\', '\\\\')",
"'install-context', 'uninstall-context' | ForEach-Object {",
" if (Test-Path \"$bucketsdir\\r-bucket\\config\\R\\$_.reg\") {",
" $content = Get-Content \"$bucketsdir\\r-bucket\\config\\R\\$_.reg\"",
" $content = $content.Replace('$roriginal_dir', $original_dir_path)",
" $content = $content.Replace('$rversion', $version)",
" if ($global) {",
" $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')",
" }",
" $content | Set-Content -Path \"$dir\\$_.reg\"",
" }",
"}",
"reg import \"$dir\\install-context.reg\""
],
"uninstaller": {
"script": [
"reg import \"$dir\\uninstall-context.reg\""
]
},
"notes": [
"For source packages installation, you will need to install Rtools if not already present, and add to PATH in your .Renviron: https://cran.r-project.org/bin/windows/Rtools",
"",
Expand Down
60 changes: 60 additions & 0 deletions bucket/rtools40.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"version": "2022-02-06",
"description": "Tools for building packages for R under Microsoft Windows, or for building R itself.",
"homepage": "https://cloud.r-project.org/bin/windows/Rtools",
"license": "BSD-3-Clause",
"notes": "For R 3.3.x to 3.6.x, please use 'versions/rtools35'.",
"architecture": {
"64bit": {
"url": "https://github.com/r-windows/rtools-installer/releases/download/2022-02-06/rtools40-x86_64.exe",
"hash": "6f6b363ee7c7e58aaa51e58f37f910226e60f0dfd47417106250b5ce4d1c2727"
}
},
"innosetup": true,
"installer": {
"script": [
"function CreateFolder([String] $FolderName) {",
" if (-not (Test-Path $dir\\$FolderName)) {",
" Write-Host \"Creating Folder $FolderName\"",
" New-Item $dir\\$FolderName -ItemType Directory",
" }",
"}",
"CreateFolder 'tmp'",
"CreateFolder 'dev'"
]
},
"env_set": {
"RTOOLS40_HOME": "$dir"
},
"shortcuts": [
[
"msys2.exe",
"Rtools40/Rtools40 Bash"
],
[
"mingw64.exe",
"Rtools40/Rtools40 MinGW 64-bit"
],
[
"ucrt64.exe",
"Rtools40/Rtools40 UCRT 64-bit"
]
],
"persist": [
"mingw32.ini",
"mingw64.ini",
"ucrt64.ini",
"msys2.ini"
],
"checkver": {
"github": "https://github.com/r-windows/rtools-installer",
"regex": "\\/releases\\/tag\\/(?:v|V)?([\\d-]+)"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/r-windows/rtools-installer/releases/download/$version/rtools40-x86_64.exe"
}
}
}
}
66 changes: 66 additions & 0 deletions bucket/rtools42.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"version": "5355-5357",
"description": "Tools for building packages for R under Microsoft Windows, or for building R itself.",
"homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html",
"license": "BSD-3-Clause",
"notes": [
"For R 3.3.x to 3.6.x, please use 'versions/rtools35'.",
"for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40'."
],
"architecture": {
"64bit": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5355-5357.exe",
"hash": "98205dd8bd703a7c867d182a83e361c76014520dca7393142d8e7a0c4ef03097"
}
},
"innosetup": true,
"installer": {
"script": [
"function CreateFolder([String] $FolderName) {",
" if (-not (Test-Path $dir\\$FolderName)) {",
" Write-Host \"Creating Folder $FolderName\"",
" New-Item $dir\\$FolderName -ItemType Directory",
" }",
"}",
"CreateFolder 'tmp'",
"CreateFolder 'dev'"
]
},
"env_set": {
"RTOOLS42_HOME": "$dir"
},
"shortcuts": [
[
"msys2.exe",
"Rtools42/Rtools42 Bash"
],
[
"mingw64.exe",
"Rtools42/Rtools42 MinGW 64-bit"
],
[
"ucrt64.exe",
"Rtools42/Rtools42 UCRT 64-bit"
]
],
"persist": [
"mingw32.ini",
"mingw64.ini",
"ucrt64.ini",
"msys2.ini"
],
"checkver": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/",
"regex": "rtools42-([\\d-]+)\\.exe"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-$version.exe",
"hash": {
"mode": "download"
}
}
}
}
}
67 changes: 67 additions & 0 deletions bucket/rtools43.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"version": "5976-5975",
"description": "Tools for building packages for R under Microsoft Windows, or for building R itself.",
"homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html",
"license": "BSD-3-Clause",
"notes": [
"For R 3.3.x to 3.6.x, please use 'versions/rtools35'.",
"for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40'.",
"for R 4.2.*, please use 'r-bucket/rtools42'."
],
"architecture": {
"64bit": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5976-5975.exe",
"hash": "2a7c87c224f16ef173f0f6c2ba83a95f8d1ce3c854ab47cf53e21412bd173906"
}
},
"innosetup": true,
"installer": {
"script": [
"function CreateFolder([String] $FolderName) {",
" if (-not (Test-Path $dir\\$FolderName)) {",
" Write-Host \"Creating Folder $FolderName\"",
" New-Item $dir\\$FolderName -ItemType Directory",
" }",
"}",
"CreateFolder 'tmp'",
"CreateFolder 'dev'"
]
},
"env_set": {
"RTOOLS43_HOME": "$dir"
},
"shortcuts": [
[
"msys2.exe",
"Rtools43/Rtools43 Bash"
],
[
"mingw64.exe",
"Rtools43/Rtools43 MinGW 64-bit"
],
[
"ucrt64.exe",
"Rtools43/Rtools43 UCRT 64-bit"
]
],
"persist": [
"mingw32.ini",
"mingw64.ini",
"ucrt64.ini",
"msys2.ini"
],
"checkver": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/",
"regex": "rtools43-([\\d-]+)\\.exe"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-$version.exe",
"hash": {
"mode": "download"
}
}
}
}
}
72 changes: 72 additions & 0 deletions bucket/rtools44.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"version": "6459-6401",
"description": "Tools for building packages for R under Microsoft Windows, or for building R itself.",
"homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html",
"license": "BSD-3-Clause",
"notes": [
"For R 3.3.x to 3.6.x, please use 'versions/rtools35';",
"for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40';",
"for R 4.2.*, please use 'r-bucket/rtools42';",
"for R 4.3.*, please use 'r-bucket/rtools43'."
],
"architecture": {
"64bit": {
"url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-6459-6401.exe",
"hash": "de9602992848faaeddca41f118dd6dc3de9bbfb00b8d87ebe5522af1dad1904b"
},
"arm64": {
"url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-aarch64-6459-6401.exe",
"hash": "8d7104523f11a4e1a8c3ff4b78ace665cbcc54ed032a6c679574f55cd128f13f"
}
},
"innosetup": true,
"installer": {
"script": [
"function CreateFolder([String] $FolderName) {",
" if (-not (Test-Path $dir\\$FolderName)) {",
" Write-Host \"Creating Folder $FolderName\"",
" New-Item $dir\\$FolderName -ItemType Directory",
" }",
"}",
"CreateFolder 'tmp'",
"CreateFolder 'dev'"
]
},
"env_set": {
"RTOOLS44_HOME": "$dir"
},
"shortcuts": [
[
"msys2.exe",
"Rtools44/Rtools44 Bash"
],
[
"mingw64.exe",
"Rtools44/Rtools44 MinGW 64-bit"
],
[
"ucrt64.exe",
"Rtools44/Rtools44 UCRT 64-bit"
]
],
"persist": [
"mingw32.ini",
"mingw64.ini",
"ucrt64.ini",
"msys2.ini"
],
"checkver": {
"url": "https://cran.r-project.org/bin/windows/Rtools/rtools44/files/",
"regex": "rtools44-([\\d-]+)\\.exe"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-$version.exe"
},
"arm64": {
"url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-aarch64-$version.exe"
}
}
}
}
4 changes: 4 additions & 0 deletions config/R/install-context.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\R-core\R\$rversion]
"InstallPath"="$roriginal_dir"
3 changes: 3 additions & 0 deletions config/R/uninstall-context.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\SOFTWARE\R-core\R\$rversion]