Skip to content

Commit

Permalink
pgcli: vendor libpq and drop :postgresql requirement
Browse files Browse the repository at this point in the history
Closes #15725.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
  • Loading branch information
ilovezfs committed Jul 18, 2017
1 parent 6dcc3dd commit 4c02954
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Formula/pgcli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Pgcli < Formula
homepage "https://pgcli.com/"
url "https://files.pythonhosted.org/packages/d2/71/59473625a4df68df7593b3fb86ac5a81bc5e29e2f9247acdfa4be08d3e43/pgcli-1.7.0.tar.gz"
sha256 "fd8ef5011a354063dd53c95e9b39125c601f8bd406f973a74601f919aafb1181"
revision 1

bottle do
cellar :any
Expand All @@ -13,7 +14,6 @@ class Pgcli < Formula

depends_on :python if MacOS.version <= :snow_leopard
depends_on "openssl"
depends_on :postgresql

resource "backports.csv" do
url "https://files.pythonhosted.org/packages/6a/0b/2071ad285e87dd26f5c02147ba13abf7ec777ff20416a60eb15ea204ca76/backports.csv-1.0.5.tar.gz"
Expand Down Expand Up @@ -85,9 +85,26 @@ class Pgcli < Formula
sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
end

resource "libpq" do
url "https://ftp.postgresql.org/pub/source/v9.6.3/postgresql-9.6.3.tar.bz2"
sha256 "1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6"
end

def install
resource("libpq").stage do
system "./configure", "--disable-debug",
"--prefix=#{libexec}/libpq",
"--with-openssl"
system "make"
system "make", "-C", "src/bin", "install"
system "make", "-C", "src/include", "install"
system "make", "-C", "src/interfaces", "install"
end

ENV.prepend_path "PATH", libexec/"libpq/bin"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resources.each do |r|
next if r.name == "libpq"
r.stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
Expand Down

0 comments on commit 4c02954

Please sign in to comment.