Skip to content
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

Add support for custom options/flags #125

Closed
mkouhia opened this issue Jan 3, 2013 · 11 comments
Closed

Add support for custom options/flags #125

mkouhia opened this issue Jan 3, 2013 · 11 comments

Comments

@mkouhia
Copy link

mkouhia commented Jan 3, 2013

Take Firefox cask for an example; brew cask install firefox will install en-US version of Firefox by default. Could there be some switch to install different version of the program?

To install the British English version user could do something like

brew cask install firefox --lang en-GB
@passcod
Copy link
Contributor

passcod commented Jan 4, 2013

Currently you can very dirtily hack it in (CAUTION: ugliness) but I can imagine making this easier (ignoring unknown flags would be a start, placing them in Cask#flags or something would be better). Anyway, here's the hack:

class Firefox < Cask
  lang = ARGV.grep(/^\./).first.sub(/^\./,'')

  url "http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/17.0.1/mac/#{lang}/Firefox%2017.0.1.dmg"
  homepage "http://www.mozilla.org/#{lang}/firefox/"
  version '17.0.1'
end
$ brew cask info firefox .fr_FR
# Because it works OK and there won't
# be a cask that starts with a dot.
firefox: 17.0.1
http://www.mozilla.org/fr_FR/firefox/
Not installed
https://github.com/phinze/cask/commits/master/Casks/firefox.rb

Error: No available cask for .fr_FR

Such a hack will never ever make it in the official Casks, of course, but you're welcome to use it in a tap.

@mkouhia
Copy link
Author

mkouhia commented Jan 4, 2013

Thanks for the hack; that'll be handy in some occasions!

@passcod passcod mentioned this issue Feb 20, 2013
@ioerror
Copy link
Contributor

ioerror commented Feb 21, 2013

How would the hash be checked for the different downloads in this case?

@passcod
Copy link
Contributor

passcod commented Feb 21, 2013

I think it would be possible with a simple switch/conditional.

@ioerror
Copy link
Contributor

ioerror commented Feb 21, 2013

How would you like to see it happen, I think might be a better question? :)

I'd like to add Tor Browser's next release for every language and ensure that every hash is in the cask - so I'm open to helping make this happen.

faun pushed a commit to faun/homebrew-cask that referenced this issue Jun 15, 2014
…htly

sha256 checksum in webkit-nightly.rb
@phinze
Copy link
Contributor

phinze commented Jan 28, 2015

We've matured well beyond this point - we have plenty of solutions for the various cases that would cause a Cask author to want to add a flag. A general facility for Cask-specific flags is unlikely to make it in because of the difficulty in maintaining Casks with that much variance.

So given that, I'm closing this for now - anybody that feels strongly can feel free to petition for reopening. 👌 👂

@phinze phinze closed this as completed Jan 28, 2015
@vitorgalvao
Copy link
Member

Well, in regards to language flags, I do see them as useful. Maintaining separate casks in caskroom/versions is cumbersome and requires a bunch of work that sometimes even leaves some of the versions outdated. Consolidation into a single cask could really help with this.

@phinze
Copy link
Contributor

phinze commented Jan 28, 2015

@vitorgalvao ah good call - agreed. I think we should either open a fresh thread for that feature or rename this issue before reopening; I've always tracked this one as "Casks get to define their own flags". I think if we want to support a new flag we should do it first-class in core.

@vitorgalvao
Copy link
Member

Sounds good. I always find it better to open new issues, as we can start with an explanation of what we already know/decided without the baggage of the discussion about how we got there. Would you care to do it?

@januz
Copy link

januz commented Apr 26, 2015

sorry, so is there already a mechanism to select a different language for Firefox than en-US?

@radeksimko
Copy link
Contributor

@JanuZz See homebrew-versions and 26 versions of Firefox:
https://github.com/caskroom/homebrew-versions/search?utf8=%E2%9C%93&q=firefox

Available for installation via brew cask install caskroom/homebrew-versions/%CASK_NAME%

@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants