Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit 27308c5

Browse files
authored
Update build for R 4.0.0 (#38)
* Re-tool README * Re-write welcome splash * Bump copyright and versioning * Remove outdated configuration manipulations * Switch to removing existing Makevars * Switch to removing existing R_ENVIRON * Switch to a different way of detecting macOS minor version (10.x) * Pin to Mojave the rest. * Bring out the label step a bit. * Add a download function for the gfortran dmg * Update the install gfortran component * Add a backup and remove file function. Remove download gfortran * Port over the configuration checks to use the backup and remove function * Implement a new gfortran download and installation technique * Upgrade installer accepted macos versions * Add changelog details * Remove dangling installer * Update splash screen of installer for readme
1 parent 3041ac8 commit 27308c5

File tree

8 files changed

+115
-228
lines changed

8 files changed

+115
-228
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## ChangeLog
22

3+
### __v4.0.0__ - 2020-05-27
4+
5+
- Re-wrote the installer package to focus on R 4.0.0 requirements.
6+
- Downloads and installs Xcode CLI
7+
- Downloads and installs appropriate gfortran binary
8+
- Backup and remove existing ~/.R/Makevars and ~/.Renviron configuration files.
9+
310
### __v3.2.2__ - 2019-12-30
411

512
- Xcode CLI headless installation for macOS Catalina was made more robust ([#33](https://github.com/rmacoslib/r-macos-rtools/issues/33)).

README.md

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11

22
# Installer Package for macOS _R_ toolchain [![License](https://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
33

4-
The repository contains the scripts used to create an installer package (.pkg)
4+
The repository contains the scripts used to create an installer package (`.pkg`)
55
that contains binaries used to create the CRAN official macOS _R_ binary.
6+
67
Specifically, the installer will try to download and install:
78

89
- Xcode command line tools (XCode CLI) from Apple
9-
- `clang7` from <https://cran.r-project.org/bin/macosx/tools/>
10-
- `gfortran6.1` from <https://cran.r-project.org/bin/macosx/tools/>
10+
- `gfortran6.3` or `gfortran8.2` from <https://github.com/fxcoudert/gfortran-for-macOS/releases>
1111

12-
Aftwards, it will attempt to configure the necessary `~/.R/Makevars` and `~/.Renviron` files.
13-
If either file is pre-existing, then a backup will be made prior to setting up the new versions.
12+
Moreover, the installer will attempt to clean up previous installations by
13+
removing configuration files `~/.R/Makevars` and `~/.Renviron` that are no longer used.
14+
Backups for each file will be presented with `.bck` appended to the end.
1415

1516
For those interested, the installer can be obtained
1617
on either the project's [**release page**](https://github.com/rmacoslib/r-macos-rtools/releases/latest)
1718
or through <http://go.illinois.edu/r-macos-rtools-pkg>. The pre-built binaries this
18-
installer encloses can be found at <https://developer.apple.com/download/more/>,
19-
<https://cran.r-project.org/bin/macosx/tools/>, and <https://gcc.gnu.org/wiki/GFortranBinaries#MacOS-1>.
19+
installer encloses can be found at <https://developer.apple.com/download/more/> and
20+
<https://github.com/fxcoudert/gfortran-for-macOS/releases>.
2021

2122
**Note** The installer package was developed by [James Joseph Balamuta](https://thecoatlessprofessor.com)
2223
and has no connection with the R project’s macOS CRAN maintainers.
@@ -33,8 +34,7 @@ of the [University of Edinburgh](http://www.ed.ac.uk/).
3334

3435
**That's it.**
3536

36-
Once installed, you can start using compiled code
37-
in _R_ like normal with the added benefit of `OpenMP`.
37+
Once installed, you can start using compiled code in _R_ like normal.
3838

3939
If you want to see behind the curtain, continue reading...
4040

@@ -44,15 +44,12 @@ The macOS _R_ toolchain installer performs four actions that require
4444
the user's password to accomplish. These actions are:
4545

4646
1. download and install XCode CLI via secure Apple product update
47-
1. download, verify, and install the `clang7` pre-made binary
48-
files into the `/usr/local/clang7` directory
49-
1. download, verify, and install `gfortran6.1`
50-
1. establish the proper header files in `CFLAGS`, `CPPFLAGS`, and `CXXFLAGS` in the `~/.R/Makevars` file
51-
1. add to the `PATH` variable where the `clang7` binary is by using `~/.Renviron`
47+
1. remove any existing `~/.R/Makevars` or `~/.Renviron` (backups available with `.bck`)s
48+
1. determine which `gfortran` version to use
49+
1. download, verify, and install the appropriate `gfortran` version
5250

53-
**Note:** The installer will replace existing `~/.R/Makevars` and `~/.Renviron` files.
51+
**Note:** The installer will remove any existing `~/.R/Makevars` and `~/.Renviron` files.
5452
The existing files will be copied to a backup file, e.g. `~/.R/Makevars.bck` and `~/.Renvion.bck`.
55-
Re-running the installer _will_ result in the old backup files being wiped.
5653

5754
Verify steps are conducted using embedded md5 hashes of the files.
5855
If the hash is not identical to what was embedded, the installer will
@@ -83,22 +80,16 @@ With this being said, the code used to generate the installer has been made publ
8380
Below is an abridged version of the actions of each file provided.
8481

8582
- `scripts/postinstall`
86-
- Downloads and Installs Xcode CLI, `clang7`, and `gfortran6.1`
83+
- Downloads and Installs Xcode CLI and the appropriate `gfortran` version
8784
- Detects the appropriate `Command Line Tools` dmg installer
8885
by using a [headless cli check](https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh#L8-L14),
8986
downloads the installer from <https://developer.apple.com/download/more/>,
9087
and installs it using `softwareupdate`.
91-
- Downloads the `clang-7.0.0.pkg` from
92-
<https://cran.r-project.org/bin/macosx/tools/> and installs it into `/` directory
93-
so that it is installed on `/usr/local/clang7`
94-
- Downloads the gfortran binary 6.1 from
95-
<https://cran.r-project.org/bin/macosx/tools/gfortran-6.1.pkg>, and
88+
- Downloads the gfortran binary from
89+
<https://github.com/fxcoudert/gfortran-for-macOS/releases>, and
9690
and installs it into `/usr/local/gfortran`.
97-
- Create the `~/.R/Makevars` file with the necessary implicit variables
98-
to compile using the new header location.
99-
- `CFLAGS`, `CPPFLAGS`, `CXXFLAGS` for `clang7`
100-
- Make the `~/.Renviron` file with a modified `PATH` variable to the location of `clang7`.
101-
- **Note:** Pre-existing `~/.R/Makevars` and `~/.Renviron` files will be backed up prior to being overridden.
91+
- Removes the `~/.R/Makevars` and `~/.Renviron` files
92+
- **Note:** Pre-existing `~/.R/Makevars` and `~/.Renviron` files will be backed up prior to being removed.
10293
- `make_installer.sh`
10394
- Create the installer package R binary installer `.pkg`
10495
- Builds the package from the extracted tar using `pkgbuild`

build_files/WELCOME_DISPLAY.rtf

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2511
1+
{\rtf1\ansi\ansicpg1252\cocoartf2512
22
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fmodern\fcharset0 Courier;\f1\fmodern\fcharset0 Courier-Bold;}
33
{\colortbl;\red255\green255\blue255;}
44
{\*\expandedcolortbl;;}
@@ -11,18 +11,16 @@
1111
\f0\fs24 \cf0 \expnd0\expndtw0\kerning0
1212
Welcome to the
1313
\f1\b macOS R toolchain
14-
\f0\b0 package. For this installer to work, please ensure a stable connection to the internet is available to download ~.6 GB of files. The installer will try to:\
14+
\f0\b0 package. For this installer to work, please ensure a stable connection to the internet is available to download ~.5 GB of files. The installer will try to:\
1515
\
1616
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl280\partightenfactor0
1717
\ls1\ilvl0\cf0 \kerning1\expnd0\expndtw0 {\listtext 1. }Install the {\field{\*\fldinst{HYPERLINK "https://developer.apple.com/library/content/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-WHAT_IS_THE_COMMAND_LINE_TOOLS_PACKAGE_"}}{\fldrslt Xcode Command Line Tools}} provided by {\field{\*\fldinst{HYPERLINK "https://developer.apple.com/download/more/"}}{\fldrslt Apple}}.\
18-
{\listtext 2. }\expnd0\expndtw0\kerning0
19-
Install the {\field{\*\fldinst{HYPERLINK "https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#macOS"}}{\fldrslt clang7 binaries}} provided by {\field{\*\fldinst{HYPERLINK "https://r.research.att.com/libs"}}{\fldrslt CRAN}}.\
20-
\ls1\ilvl0\kerning1\expnd0\expndtw0 {\listtext 3. }Install {\field{\*\fldinst{HYPERLINK "https://gcc.gnu.org/wiki/GFortranBinaries#MacOS-1"}}{\fldrslt gfortran6.1 binaries}} provided by {\field{\*\fldinst{HYPERLINK "https://gcc.gnu.org/wiki/HomePage"}}{\fldrslt GNU\'92s GCC Project}}.\expnd0\expndtw0\kerning0
18+
{\listtext 3. }Install OS-specific {\field{\*\fldinst{HYPERLINK "https://github.com/fxcoudert/gfortran-for-macOS/releases"}}{\fldrslt gfortran binaries}} provided by {\field{\*\fldinst{HYPERLINK "https://gcc.gnu.org/wiki/HomePage"}}{\fldrslt GNU\'92s GCC Project}}.\expnd0\expndtw0\kerning0
2119
\
2220
\ls1\ilvl0\kerning1\expnd0\expndtw0 {\listtext 4. }\expnd0\expndtw0\kerning0
23-
Create and populate {\field{\*\fldinst{HYPERLINK "https://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars"}}{\fldrslt ~/.R/Makevars}} and ~/.Renviron with the appropriate paths.\
21+
Remove any existing {\field{\*\fldinst{HYPERLINK "https://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars"}}{\fldrslt ~/.R/Makevars}} and ~/.Renviron files.\
2422
\pard\tx940\tx1440\pardeftab720\li1440\fi-1440\sl280\partightenfactor0
25-
\ls1\ilvl1\cf0 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8259 }If any file is pre-existing, they will be copied with `.bck` extension. \expnd0\expndtw0\kerning0
23+
\ls1\ilvl1\cf0 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8259 }Backups of each file will be made available with `.bck` extension. \expnd0\expndtw0\kerning0
2624
\
2725
\pard\tx720\pardeftab720\sl280\partightenfactor0
2826
\cf0 \

distribution.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<choice id="com.rbinaries.rtools" visible="false">
1212
<pkg-ref id="com.rbinaries.rtools"/>
1313
</choice>
14-
<pkg-ref id="com.rbinaries.rtools" version="3.2.2" onConclusion="none">macos-rtools-temp.pkg</pkg-ref>
14+
<pkg-ref id="com.rbinaries.rtools" version="4.0.0" onConclusion="none">macos-rtools-temp.pkg</pkg-ref>
1515
<title>macOS R toolchain</title>
1616
<background file="Rlogo.png" mime-type="image/png" />
1717
<welcome file="WELCOME_DISPLAY.rtf"/>
1818
<license file="LICENSE.rtf"/>
1919
<allowed-os-versions>
20-
<os-version min="10.11.0" />
20+
<os-version min="10.13.0" />
2121
</allowed-os-versions>
2222
</installer-gui-script>

make_installer.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#
44
# make_installer.sh
55
#
6-
# Copyright (C) 2018 - 2019 James Joseph Balamuta <balamut2@illinois.edu>
6+
# Copyright (C) 2018 - 2020 James Joseph Balamuta <balamut2@illinois.edu>
77
#
8-
# Version 3.2.2 -- 2019-12-30
8+
# Version 4.0.0 -- 2020-05-27
99
#
1010
# This program is free software; you can redistribute it and/or modify
1111
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ echo "[setup] Creating an environment for the installer..."
3030
chmod a+x scripts/*
3131

3232
# Version of installer
33-
INSTALLER_VERSION=3.2.2
33+
INSTALLER_VERSION=4.0.0
3434

3535
# Previously, we created a payload-free package due to downloading
3636
# components as needed. We used a read receipt trick of including an empty
@@ -82,11 +82,11 @@ add_line_1before_last '<welcome file="WELCOME_DISPLAY.rtf"/>' distribution.xml
8282
add_line_1before_last '<license file="LICENSE.rtf"/>' distribution.xml
8383

8484
# Enforce a minimum standard for the installer.
85-
# R CRAN Binaries use OS X Mavericks 10.11
85+
# R CRAN Binaries use macOS High Sierra 10.13
8686
# Docs: https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW33
8787
MINVERSION=$(cat <<-END
8888
<allowed-os-versions>
89-
<os-version min="10.11.0" />
89+
<os-version min="10.13.0" />
9090
</allowed-os-versions>
9191
END
9292
)

readme_img/lock_icon.png

4.85 KB
Loading

readme_img/signed_certificate.png

1.11 KB
Loading

0 commit comments

Comments
 (0)