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

Adding Homebrew support #11

Closed
DhavalKapil opened this issue Jul 5, 2016 · 8 comments
Closed

Adding Homebrew support #11

DhavalKapil opened this issue Jul 5, 2016 · 8 comments

Comments

@DhavalKapil
Copy link
Owner

DhavalKapil commented Jul 5, 2016

As suggested by Jared Sartin:
https://dhavalkapil.com/blogs/Lua-Version-Manager/#comment-2764187295

@umireon
Copy link
Contributor

umireon commented Nov 7, 2016

I have recently written the Homebrew package definition for luaver.
https://github.com/umireon/homebrew-core/blob/umireon-luaver/Formula/luaver.rb

i hope this is helpful for you, or i can submit it instead of you 😃

@DhavalKapil
Copy link
Owner Author

Thanks for writing this out. Go ahead and submit it :) Let me know whenever it's merged and I'll close this issue.

@umireon
Copy link
Contributor

umireon commented Nov 7, 2016

Thank you, @DhavalKapil I will go ahead.
It should be great if a new version which includes #9 (supporting mac) is released.
With it, I can remove the messy patching section from this definition,
and then the Homebrew team will more likely to adopt this formula.

@DhavalKapil
Copy link
Owner Author

@umireon I don't have much time right now. Plan to release it by December.

@umireon
Copy link
Contributor

umireon commented Nov 7, 2016

Thank you for taking your time.
I created the request and I will ping here when it is accepted or not.
Homebrew/homebrew-core#6696

@umireon
Copy link
Contributor

umireon commented Nov 8, 2016

Now luaver is available on Homebrew 🍻 !

macOS user can install luaver via Homebrew by running brew install luaver.
Then, the installer shows the instruction to append the soucing luaver to their .bash_profile.
The following shows the console log of the installation.

$ brew install luaver
==> Using the sandbox
==> Downloading https://github.com/DhavalKapil/luaver/archive/v1.0.0.tar.gz
Already downloaded: /Users/umireon/Library/Caches/Homebrew/luaver-1.0.0.tar.gz
==> Downloading https://github.com/DhavalKapil/luaver/pull/9.patch
Already downloaded: /Users/umireon/Library/Caches/Homebrew/luaver--patch-390929ef53b6e8e372451049eeffbfa51b9e31d7071e386478b871a835aba2db.patch
==> Patching
==> Applying 9.patch
patching file luaver
==> Caveats
Add the following at the end of the correct file yourself:
  if which luaver > /dev/null; then . `which luaver`; fi
==> Summary
🍺  /usr/local/Cellar/luaver/1.0.0: 5 files, 31.6K, built in 1 second

@tobylane
Copy link

I saw the caveat but couldn't understand it before coming here. Is "correct file" the relevant profile for the user's shell? It may be possible for the installer to do this step, I think RVM does. If not that line could be more self explanatory.

@umireon
Copy link
Contributor

umireon commented Dec 21, 2016

@tobylane Homebrew will not allow a Formula to modify a user's shell profile because that will cause a lot of problems which is not relevant to Homebrew itself.

Anyway, that line can be improved a bit like nvm has:

$ brew info nvm
nvm: stable 0.32.1, HEAD
Manage multiple Node.js versions
https://github.com/creationix/nvm
/usr/local/Cellar/nvm/0.32.1 (7 files, 118.8K) *
  Built from source on 2016-11-27 at 21:35:10
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/nvm.rb
==> Caveats
Please note that upstream has asked us to make explicit managing
nvm via Homebrew is unsupported by them and you should check any
problems against the standard nvm install method prior to reporting.

You should create NVM's working directory if it doesn't exist:

  mkdir ~/.nvm

Add the following to ~/.bash_profile or your desired shell
configuration file:

  export NVM_DIR="$HOME/.nvm"
  . "/usr/local/opt/nvm/nvm.sh"

You can set $NVM_DIR to any location, but leaving it unchanged from
/usr/local/Cellar/nvm/0.32.1 will destroy any nvm-installed Node installations
upon upgrade/reinstall.

Type `nvm help` for further information.

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

(This describes too much, appearently to avoid troubles with upstream, though)

And, of course, you also can always improve luaver formula by sending a PR at Homebrew/homebrew-core 🍻 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants