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

Installation via Homebrew #11

Open
MahatmaFatalError opened this issue Sep 5, 2018 · 12 comments
Open

Installation via Homebrew #11

MahatmaFatalError opened this issue Sep 5, 2018 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@MahatmaFatalError
Copy link

Are there any plans to support Homebrew?

@theory
Copy link
Owner

theory commented Sep 5, 2018

What would that look like, @MahatmaFatalError? Homebrew has its own Postgres build.

@MadBomber
Copy link

Once I get pgenv working on the mac, I can take a look at adopting it the homebrew package manager. Basically, I see the mod as just using the command brew install postgresql@{version} in the place of the download and build function. Then its just a matter of managing which directory from /usr/local/Cellar/postgresql/{version} is on top of the $PATH. Seems simple but the devil is in the details.

@MadBomber
Copy link

FYI. I had to replace the shebang line with #!/usr/bin/env bash to get it to work on my Mac.

@MadBomber
Copy link

I've thought about the hooking into homebrew for a few minutes. I'm not sure that it is a good idea. As is pgenv is a nice simple tool. It has access to MANY MORE versions of PostgreSQL than are available under brew. For example consider this:

ruby-2.6.0-preview2  mars:~ $ brew search postgresql
==> Formulae
postgresql ✔                postgresql@9.4              postgresql@9.5              postgresql@9.6

==> Casks
navicat-for-postgresql                                  photo-supreme-postgresql

Under homebrew I have the "latest" version install 10.5. However, after modifing the shebang of pgenv I was able to install and run PG 11beta3. That is not something I can do with my current configuration of homebrew.

Maybe its sufficient to add a small section to the README for MacOS that says how to install all of the prerequisites.

@MadBomber
Copy link

@MahatmaFatalError Did I just complete miss the point of your issue? Are you really asking if we could install pgenv using homebrew? brew install pgenv instead of using the git clone method outlined in the README?

@fluca1978
Copy link
Collaborator

@MadBomber I don't have any experience with homebrew, but if you have an installed PostgreSQL you can manage it with pgenv by setting PGENV_ROOT, but be aware of the linking mechanism. However, this does not sound a good idea to me too.

Instead, it is quite strange you had to change the shebang: the mac does not has /usr/bin in the user PATH?

@theory
Copy link
Owner

theory commented Sep 6, 2018

I'm not surprised you had to change the shebang line, @MadBomber. @fluca1978, I think we should change it to #!/usr/bin/env, following the precedent of the plenv commands, e.g., plenv-global.

@theory
Copy link
Owner

theory commented Sep 6, 2018

It would be easy enough to create a Homebrew formula that installs pgenv, and then the user can just use it like any other Homebrew app. All the dependencies should be satisfied by Homebrew already (although I'm not sure about the compiler).

fluca1978 added a commit that referenced this issue Sep 6, 2018
See comment <#11 (comment)>.
Seems reasonable to use the absolute path for `env` since it seems the same
on Linux, OSX and FreeBSD.
@theory
Copy link
Owner

theory commented Sep 9, 2018

@MadBomber Are you planning to submit a formula for pgenv to the Homebrew project? If so, I'd like to close this issue.

Thanks!

@MadBomber
Copy link

MadBomber commented Sep 10, 2018 via email

@rizkimhd
Copy link

I think it would be nice to be able to install pgenv through Homebrew brew install pgenv while keeping the pgenv to manage postgreSQL installations. Personally I install most of tools and applications using Homebrew (brew tap, brew install and brew cask install) so it would be nice if pgenv can be installed through Homebrew as well

@theory
Copy link
Owner

theory commented Nov 15, 2020

I have no objection at all if someone wants to submit a pull request to the Homebrew project to add a formula for pgenv. Could probably model it on plenv

@theory theory added the help wanted Extra attention is needed label Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants