Difference between revisions of "Documentation/Labs/HomebrewCask"

From Slicer Wiki
Jump to: navigation, search
(Replace "nightly" with "preview")
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page was created based on the discussion [https://discourse.slicer.org/t/add-slicer-nightly-to-homebrew-macos/811 Add Slicer Nightly to Homebrew (macOS)]
+
This page was created based on the discussions [https://discourse.slicer.org/t/add-slicer-nightly-to-homebrew-macos/811 Add Slicer Nightly to Homebrew (macOS)] and [https://discourse.slicer.org/t/slicer-installation-on-mac-using-homebrew/ Slicer installation on Mac using homebrew]
  
== Definitions ==
+
==Introduction==
  
=== Homebrew ===
+
The purpose of this Lab is to offer an alternative way to install / update Slicer for macOS users using the command line. The process is much more convenient than the traditional way, but it requires minimal computer skills that not all users might have. Therefore this alternative way is specially intended to be used by developers or engineers instead of medical staff and casual users.
  
 +
==Definitions==
 +
 +
===Homebrew===
 
[https://brew.sh/ Homebrew] is "the missing package manager for macOS". It is designed for installing UNIX tools and other open-source applications. It will quickly download and install them, compiling them from source. Homebrew can install stuff like:
 
[https://brew.sh/ Homebrew] is "the missing package manager for macOS". It is designed for installing UNIX tools and other open-source applications. It will quickly download and install them, compiling them from source. Homebrew can install stuff like:
* <code>vim</code>
 
* <code>ffmpeg</code>
 
* <code>python</code>
 
  
=== Homebrew Cask ===
+
*<code>vim</code>
 +
*<code>ffmpeg</code>
 +
*<code>python</code>
 +
 
 +
===Homebrew Cask===
 
[https://caskroom.github.io/ Homebrew Cask] extends Homebrew with support for installing binary apps — the kind you normally drag to your Applications folder from DMG files. For example:
 
[https://caskroom.github.io/ Homebrew Cask] extends Homebrew with support for installing binary apps — the kind you normally drag to your Applications folder from DMG files. For example:
* 3D Slicer
 
* Google Chrome
 
  
=== Homebrew Versions ===
+
*3D Slicer
 +
*Google Chrome
  
 +
===Homebrew Versions===
 
[https://github.com/caskroom/homebrew-versions Homebrew Versions] lets you install alternate versions of the apps from Homebrew Cask. For example:
 
[https://github.com/caskroom/homebrew-versions Homebrew Versions] lets you install alternate versions of the apps from Homebrew Cask. For example:
* 3D Slicer ''Nightly''
 
* Google Chrome ''Canary''
 
  
 +
*3D Slicer ''Preview''
 +
*Google Chrome ''Canary''
  
== Steps to update Slicer cask (for maintainers) ==
 
  
Configure <code>git</code> and GitHub [https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ SSH keys].
+
==Steps to update Slicer cask (for maintainers)==
  
=== Setup ===
+
Adding an [https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ SSH key] to GitHub and the KeyChain might be needed.
 +
 
 +
===Setup===
 
<pre>
 
<pre>
 
# Install homebrew
 
# Install homebrew
Line 35: Line 40:
 
</pre>
 
</pre>
  
=== Update ===
+
===Update===
This automatically creates a pull request in [https://github.com/caskroom/homebrew-versions/ homebrew-versions] to update the [https://github.com/caskroom/homebrew-versions/blob/master/Casks/slicer-nightly.rb <code>slicer-nightly</code> cask] (a Ruby script) with the new version.
+
This automatically creates a pull request in [https://github.com/caskroom/homebrew-versions/ homebrew-versions] to update the [https://github.com/caskroom/homebrew-versions/blob/master/Casks/slicer-preview.rb <code>slicer-preview</code> cask] (a Ruby script) with the new version.
 
<pre>
 
<pre>
 
cask-repair --cask-version 4.7.0.26273,676538 --fail-on-error --blind-submit slicer-nightly
 
cask-repair --cask-version 4.7.0.26273,676538 --fail-on-error --blind-submit slicer-nightly
 
</pre>
 
</pre>
  
== Steps to upgrade Slicer app (for users) ==
 
  
=== Setup ===
+
==Steps to upgrade Slicer app (for users)==
 +
 
 +
===Setup===
 
<pre>
 
<pre>
 
# Install homebrew + homebrew-cask
 
# Install homebrew + homebrew-cask
Line 52: Line 58:
  
 
# Install Slicer.app (nightly)
 
# Install Slicer.app (nightly)
brew cask install slicer-nightly
+
brew cask install slicer-preview
 
 
# Install cask-upgrade
 
brew tap buo/cask-upgrade
 
 
</pre>
 
</pre>
  
=== Upgrade ===
+
===Upgrade===
Download and install nightly version of Slicer.app:
+
Download and install preview version of Slicer.app:
 
<pre>
 
<pre>
brew cu slicer-nightly
+
brew cask upgrade slicer-preview
 
</pre>
 
</pre>

Latest revision as of 22:40, 12 October 2020

Home < Documentation < Labs < HomebrewCask

This page was created based on the discussions Add Slicer Nightly to Homebrew (macOS) and Slicer installation on Mac using homebrew

Introduction

The purpose of this Lab is to offer an alternative way to install / update Slicer for macOS users using the command line. The process is much more convenient than the traditional way, but it requires minimal computer skills that not all users might have. Therefore this alternative way is specially intended to be used by developers or engineers instead of medical staff and casual users.

Definitions

Homebrew

Homebrew is "the missing package manager for macOS". It is designed for installing UNIX tools and other open-source applications. It will quickly download and install them, compiling them from source. Homebrew can install stuff like:

  • vim
  • ffmpeg
  • python

Homebrew Cask

Homebrew Cask extends Homebrew with support for installing binary apps — the kind you normally drag to your Applications folder from DMG files. For example:

  • 3D Slicer
  • Google Chrome

Homebrew Versions

Homebrew Versions lets you install alternate versions of the apps from Homebrew Cask. For example:

  • 3D Slicer Preview
  • Google Chrome Canary


Steps to update Slicer cask (for maintainers)

Adding an SSH key to GitHub and the KeyChain might be needed.

Setup

# Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install cask-repair
brew install vitorgalvao/tiny-scripts/cask-repair

Update

This automatically creates a pull request in homebrew-versions to update the slicer-preview cask (a Ruby script) with the new version.

cask-repair --cask-version 4.7.0.26273,676538 --fail-on-error --blind-submit slicer-nightly


Steps to upgrade Slicer app (for users)

Setup

# Install homebrew + homebrew-cask
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Tell brew to look also in homebrew-versions
brew tap caskroom/versions

# Install Slicer.app (nightly)
brew cask install slicer-preview

Upgrade

Download and install preview version of Slicer.app:

brew cask upgrade slicer-preview