3 So you want to contribute to the project. **THIS IS GREAT NEWS!** Seriously. We're
4 all pretty happy about this. Here's how to get started:
6 * [Getting Set Up To Contribute](#getting-set-up-to-contribute)
7 * [Adding a Cask](#adding-a-cask)
8 * [Testing Your New Cask](#testing-your-new-cask)
9 * [Finding a Home For Your Cask](#finding-a-home-for-your-cask)
10 * [Submitting Your Changes](#submitting-your-changes)
11 * [Cleaning up](#cleaning-up)
12 * [Reporting Bugs](#reporting-bugs)
15 ## Getting Set Up To Contribute
17 1. Fork the repository in GitHub with the 'Fork' button
18 2. Add your GitHub fork as a remote for your homebrew-cask Tap
21 $ github_user='<my-github-username>'
22 $ cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
23 $ git remote add "$github_user" "https://github.com/$github_user/homebrew-cask"
29 Making a Cask is easy: a Cask is a small Ruby file.
33 Here's a Cask for `Alfred.app` as an example. Note that you may repeat
34 the `app` stanza as many times as you need, to define multiple apps:
37 cask :v1 => 'alfred' do
39 sha256 'a32565cdb1673f4071593d4cc9e1c26bc884218b62fef8abc450daa47ba8fa92'
41 url 'https://cachefly.alfredapp.com/Alfred_2.3_264.zip'
43 homepage 'http://www.alfredapp.com/'
47 app 'Alfred 2.app/Contents/Preferences/Alfred Preferences.app'
51 Here is another Cask for `Unity.pkg`:
54 cask :v1 => 'unity' do
56 sha256 '6fb72bfacf78df072559dd9a024a9d47e49b5717c8f17d53f05e2fc74a721876'
58 url 'http://netstorage.unity3d.com/unity/unity-4.5.4.dmg'
61 homepage 'http://unity3d.com/unity/'
66 uninstall :pkgutil => 'com.unity3d.*'
70 And here is one for `Firefox.app`. Note that it has an unversioned download (the download `url` does not contain the version number, unlike the example above). It also suppresses the checksum with `sha256 :no_check` (necessary since the checksum will change when a new distribution is made available). This combination of `version :latest` and `sha256 :no_check` is currently the preferred mechanism when an unversioned download URL is available:
73 cask :v1 => 'firefox' do
77 url 'https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US'
79 homepage 'https://www.mozilla.org/en-US/firefox/'
86 ### Generating a Token for the Cask
88 The Cask **token** is the mnemonic string people will use to interact with
89 the Cask via `brew cask install`, `brew cask search`, etc. The name of the
90 Cask **file** is simply the token with the extension `.rb` appended.
92 The easiest way to generate a token for a Cask is to run this command:
94 $ "$(brew --repository)/Library/Taps/caskroom/homebrew-cask/developer/bin/generate_cask_token" '/full/path/to/new/software.app'
97 If the software you wish to Cask is not installed, or does not have an
98 associated App bundle, just give the full proper name of the software
99 instead of a pathname:
101 $ "$(brew --repository)/Library/Taps/caskroom/homebrew-cask/developer/bin/generate_cask_token" 'Google Chrome'
104 If the `generate_cask_token` script does not work for you, see [Cask Token Details](#cask-token-details).
107 ### The `brew cask create` Command
109 Once you know the token, create your Cask with the handy-dandy
110 `brew cask create` command.
113 $ brew cask create my-new-cask
116 This will open `$EDITOR` with a template for your new Cask, to be stored in
117 the file `my-new-cask.rb`. Running the `create` command above will get you
118 a template that looks like this:
121 cask :v1 => 'my-new-cask' do
136 Fill in the following stanzas for your Cask:
139 | ------------------ | ----------- |
140 | `version` | application version; give the value `:latest` if an unversioned download is available
141 | `sha256` | SHA-256 checksum of the file downloaded from `url`, calculated by the command `shasum -a 256 <file>`. Can be suppressed by using the special value `:no_check`. (see also [Checksum Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#checksum-stanza-details))
142 | `url` | URL to the `.dmg`/`.zip`/`.tgz` file that contains the application (see also [URL Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#url-stanza-details))
143 | `name` | the full and proper name defined by the vendor, and any useful alternate names (see also [Name Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#name-stanza-details))
144 | `homepage` | application homepage; used for the `brew cask home` command
145 | `license` | a symbol identifying the license for the application. Valid category licenses include `:oss`, `:closed`, and `:unknown`. It is OK to leave as `:unknown`. (see also [License Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#license-stanza-details))
146 | `app` | relative path to an `.app` bundle that should be linked into the `~/Applications` folder on installation (see also [App Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#app-stanza-details))
148 Other commonly-used stanzas are:
151 | ------------------ | ----------- |
152 | `pkg` | relative path to a `.pkg` file containing the distribution (see also [Pkg Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#pkg-stanza-details))
153 | `uninstall` | procedures to uninstall a Cask. Optional unless the `pkg` stanza is used. (see also [Uninstall Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#uninstall-stanza-details))
155 Additional stanzas you might need for special use-cases:
158 | ---------------------- | ----------- |
159 | `prefpane` | relative path to a preference pane that should be linked into the `~/Library/PreferencePanes` folder on installation
160 | `colorpicker` | relative path to a ColorPicker plugin that should be linked into the `~/Library/ColorPickers` folder on installation
161 | `qlplugin` | relative path to a QuickLook plugin that should be linked into the `~/Library/QuickLook` folder on installation
162 | `font` | relative path to a font that should be linked into the `~/Library/Fonts` folder on installation
163 | `widget` | relative path to a widget that should be linked into the `~/Library/Widgets` folder on installation (ALPHA: DOES NOT WORK YET)
164 | `service` | relative path to a service that should be linked into the `~/Library/Services` folder on installation
165 | `binary` | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation
166 | `input_method` | relative path to a input method that should be linked into the `~/Library/Input Methods` folder on installation
167 | `screen_saver` | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation
168 | `suite` | relative path to a containing directory that should be linked into the `~/Applications` folder on installation
169 | `container :nested =>` | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc.
170 | `caveats` | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#caveats-stanza-details))
172 Even more special-use stanzas are listed at [Optional Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#optional-stanzas) and [Legacy Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#legacy-stanzas).
177 SourceForge projects are a common way to distribute binaries, but they
178 provide many different styles of URLs to get to the goods.
180 We prefer URLs of this format:
183 http://sourceforge.net/projects/$PROJECTNAME/files/latest/download
186 This lets the project maintainers choose the best URL for download.
188 If the "latest" URL does not point to a valid file for a Mac app, then we
189 fall back to this format:
192 http://downloads.sourceforge.net/sourceforge/$PROJECTNAME/$FILENAME.$EXT
195 Or, if it’s from [SourceForge.JP](http://sourceforge.jp/):
198 http://$STRING.sourceforge.jp/$PROJECTNAME/$RELEASEID/$FILENAME.$EXT
201 `$STRING` is typically of the form `dl` or `$USER.dl`.
203 ### Personal Hosting Such as Dropbox
205 URLs from dropbox.com or cl.ly/cloudapp.com are not readily distinguishable
206 as being controlled by the original software vendor. These URLs should be
207 used only when given as such on the official project website.
209 Also make sure to give the URL for the binary download itself, rather than
210 a preview page. (See <https://www.dropbox.com/help/201/en>.)
212 ### Some Providers Block Command-line Downloads
214 Some hosting providers actively block command-line HTTP clients (example:
215 FossHub). Such URLs cannot be used in Casks.
217 ### Vendor URLs Are Preferred
219 When possible, it is best to use a download URL from the original developer
220 or vendor, rather than an aggregator such as macupdate.com.
223 ### Cask Token Details
225 If a token conflicts with an already-existing Cask, authors should manually
226 make the new token unique by prepending the vendor name. Example:
227 [unison.rb](../Casks/unison.rb) and [panic-unison.rb](../Casks/panic-unison.rb).
229 If possible, avoid creating tokens which differ only by the placement of
232 To generate a token manually, or to learn about exceptions for unusual cases,
233 see [cask_token_reference.md](doc/cask_token_reference.md).
236 ### Archives With Subfolders
238 When a downloaded archive expands to a subfolder, the subfolder name must be
239 included in the `app` value.
243 * Texmaker is downloaded to the file `TexmakerMacosxLion.zip`.
244 * `TexmakerMacosxLion.zip` unzips to a folder called `TexmakerMacosxLion`.
245 * The folder `TexmakerMacosxLion` contains the application `texmaker.app`.
246 * So, the `app` stanza should include the subfolder as a relative path:
249 app 'TexmakerMacosxLion/texmaker.app'
254 All Casks and code in the homebrew-cask project should be indented using two
258 ## Testing Your New Cask
260 Give it a shot with `brew cask install my-new-cask`
262 Did it install? If something went wrong, `brew cask uninstall my-new-cask` and
263 edit your Cask to fix it.
265 If everything looks good, you'll also want to make sure your Cask passes audit
268 `brew cask audit my-new-cask --download`
270 If your application and homebrew-cask do not work well together, feel free to
271 [file an issue](https://github.com/caskroom/homebrew-cask/issues) after checking
275 ## Finding a Home For Your Cask
277 We maintain separate Taps for different types of binaries.
279 ### Latest Stable Versions
281 Latest stable versions live in the main repository at [caskroom/homebrew-cask](https://github.com/caskroom/homebrew-cask).
282 Software in the main repo should run on the latest release of OS X or the previous
283 point release (currently: Mavericks and Mountain Lion).
285 ### But There Is No Stable Version!
287 When an App is only available as an unstable version (e.g. beta, nightly), or in cases where such a version is
288 the general standard, then an "unstable" version can go into the main repo.
290 ### Unstable, Development, or Legacy Versions
292 When an App already exists in the main repo, alternate versions can be Casked
293 and submitted to [caskroom/homebrew-versions](https://github.com/caskroom/homebrew-versions).
297 Before submitting a trial, please make sure it can be made into a full working version
298 without the need to be redownloaded. If an App provides a trial but the only way to buy the full version
299 is via the Mac App Store, it does not currently belong in any of the official repos.
301 ### Unofficial Builds
303 When an App developer does not offer a binary download, please submit the
304 Cask to [caskroom/homebrew-unofficial](http://github.com/caskroom/homebrew-unofficial).
305 For a location to host unofficial builds, contact our sister project [alehouse](https://github.com/alehouse).
309 Font Casks live in the [caskroom/homebrew-fonts](https://github.com/caskroom/homebrew-fonts)
310 repository. See the font repo [CONTRIBUTING.md](https://github.com/caskroom/homebrew-fonts/blob/master/CONTRIBUTING.md)
314 ## Submitting Your Changes
316 Hop into your Tap and check to make sure your new Cask is there:
319 $ cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
323 # (use "git add <file>..." to include in what will be committed)
325 # Casks/my-new-cask.rb
328 So far, so good. Now make a feature branch that you'll use in your pull
332 $ git checkout -b my-new-cask
333 Switched to a new branch 'my-new-cask'
336 Stage your Cask with `git add Casks/my-new-cask.rb`. You can view the changes
337 that are to be committed with `git diff --cached`.
339 Commit your changes with `git commit -v`.
343 For any git project, some good rules for commit messages are
345 * the first line is commit summary, 50 characters or less,
346 * followed by an empty line
347 * followed by an explanation of the commit, wrapped to 72 characters.
349 See [a note about git commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
352 The first line of a commit message becomes the **title** of a pull
353 request on GitHub, like the subject line of an email. Including
354 the key info in the first line will help us respond faster to
357 For Cask commits in the homebrew-cask project, we like to include
358 the Application name, version number (or `:latest`), and purpose of
359 the commit in the first line.
361 Examples of good, clear commit summaries:
363 * `Add Transmission.app v1.0`
364 * `Upgrade Transmission.app to v2.82`
365 * `Fix checksum in Transmission.app Cask`
366 * `Add CodeBox Latest`
368 Examples of difficult, unclear commit summaries:
375 Push your changes to your GitHub account:
378 $ github_user='<my-github-username>'
379 $ git push "$github_user" my-new-cask
382 If you are using [GitHub two-factor authentication](https://github.com/blog/1614-two-factor-authentication)
383 and set your remote repository as HTTPS you will need to set up
384 a personal access token and use that instead your password.
385 See more on https://help.github.com/articles/https-cloning-errors#provide-access-token-if-2fa-enabled
387 ### Filing a Pull Request on GitHub
389 Now go to *your* GitHub repository at
390 https://github.com/my-github-username/homebrew-cask, switch branch to your
391 topic branch and click the 'Pull Request' button. You can then add further
392 comments to your pull request.
394 Congratulations! You are done now, and your Cask should be pulled in or
395 otherwise noticed in a while.
399 If your pull request has multiple commits which revise the same lines of
400 code, it is better to [squash](http://davidwalsh.name/squash-commits-git) those commits together into one logical unit.
402 But you don't always have to squash -- it is fine for a pull request to
403 contain multiple commits when there is a logical reason for the separation.
408 After your Pull Request is away, you might want to get yourself back onto
409 `master`, so that `brew update` will pull down new Casks properly.
412 cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
421 We still have bugs -- and we are busy fixing them! If you have a problem, don't
422 be shy about reporting it on our [GitHub issues page](https://github.com/caskroom/homebrew-cask/issues?state=open).
424 When reporting bugs, remember that homebrew-cask is an independent project from
425 Homebrew. Do your best to direct bug reports to the appropriate project. If
426 your command-line started with `brew cask`, bring the bug to us first!
428 Before reporting a bug, make sure you have the latest versions of Homebrew,
429 homebrew-cask, and all Taps by running the following command:
432 $ brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
435 ## Working On homebrew-cask Itself
437 If you'd like to hack on the Ruby code in the project itself, please
438 see [hacking.md](doc/hacking.md).