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

extensions: add Postgres 16 support #44

Closed
wants to merge 9 commits into from
14 changes: 11 additions & 3 deletions Formula/hypopg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Hypopg < Formula
url "https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.0.tar.gz"
sha256 "0821011743083226fc9b813c1f2ef5897a91901b57b6bea85a78e466187c6819"
license "PostgreSQL"
revision 1

livecheck do
url :stable
Expand All @@ -23,14 +24,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"

mkdir_p lib/neon_postgres.name/v
mv "hypopg.so", lib/neon_postgres.name/v
mv "hypopg.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "hypopg.control", share/neon_postgres.name/v/"extension"
Expand All @@ -39,7 +47,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/ip4r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ip4r < Formula
url "https://github.com/RhodiumToad/ip4r/archive/refs/tags/2.4.2.tar.gz"
sha256 "0f7b1f159974f49a47842a8ab6751aecca1ed1142b6d5e38d81b064b2ead1b4b"
license "PostgreSQL"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,16 +19,23 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"
system "make", "install", "DESTDIR=#{buildpath}/stage-#{v}"

stage_dir = Pathname("stage-#{v}#{HOMEBREW_PREFIX}")
mkdir_p lib/neon_postgres.name/v
mv Dir[stage_dir/"lib"/neon_postgres.name/v/"*.so"], lib/neon_postgres.name/v
mv Dir[stage_dir/"lib"/neon_postgres.name/v/"*.#{dlsuffix}"], lib/neon_postgres.name/v

from_ext_dir = stage_dir/"share"/neon_postgres.name/v/"extension"
to_ext_dir = share/neon_postgres.name/v/"extension"
Expand All @@ -39,7 +47,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/pg_cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PgCron < Formula
url "https://github.com/citusdata/pg_cron/archive/refs/tags/v1.6.0.tar.gz"
sha256 "383a627867d730222c272bfd25cd5e151c578d73f696d32910c7db8c665cc7db"
license "PostgreSQL"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,14 +19,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"

mkdir_p lib/neon_postgres.name/v
mv "pg_cron.so", lib/neon_postgres.name/v
mv "pg_cron.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "pg_cron.control", share/neon_postgres.name/v/"extension"
Expand All @@ -34,7 +42,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/pg_embedding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PgEmbedding < Formula
url "https://github.com/neondatabase/pg_embedding/archive/refs/tags/0.3.6.tar.gz"
sha256 "b2e2b359335d26987778c7fae0c9bcc8ebc3530fc214113be1ddbc8a136e52ac"
license "Apache-2.0"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,14 +19,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"

mkdir_p lib/neon_postgres.name/v
mv "embedding.so", lib/neon_postgres.name/v
mv "embedding.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "embedding.control", share/neon_postgres.name/v/"extension"
Expand All @@ -34,7 +42,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/pg_hashids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PgHashids < Formula
url "https://github.com/iCyberon/pg_hashids/archive/refs/tags/v1.2.1.tar.gz"
sha256 "74576b992d9277c92196dd8d816baa2cc2d8046fe102f3dcd7f3c3febed6822a"
license "MIT"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,13 +19,20 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

system "make", "clean", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"
system "make", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"

mkdir_p lib/neon_postgres.name/v
mv "pg_hashids.so", lib/neon_postgres.name/v
mv "pg_hashids.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "pg_hashids.control", share/neon_postgres.name/v/"extension"
Expand All @@ -33,7 +41,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
9 changes: 7 additions & 2 deletions Formula/pgjwt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Pgjwt < Formula
version "2.0"
sha256 "dae8ed99eebb7593b43013f6532d772b12dfecd55548d2673f2dfd0163f6d2b9"
license "MIT"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -19,8 +20,12 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
system "make", "clean", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"
system "make", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"

Expand All @@ -31,7 +36,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/pgvector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Pgvector < Formula
url "https://github.com/pgvector/pgvector/archive/refs/tags/v0.5.0.tar.gz"
sha256 "d8aa3504b215467ca528525a6de12c3f85f9891b091ce0e5864dd8a9b757f77b"
license "PostgreSQL"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,14 +19,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"

mkdir_p lib/neon_postgres.name/v
mv "vector.so", lib/neon_postgres.name/v
mv "vector.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "vector.control", share/neon_postgres.name/v/"extension"
Expand All @@ -34,7 +42,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/postgresql-hll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PostgresqlHll < Formula
url "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v2.18.tar.gz"
sha256 "e2f55a6f4c4ab95ee4f1b4a2b73280258c5136b161fe9d059559556079694f0e"
license "Apache-2.0"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,14 +19,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["PG_CONFIG"] = neon_postgres.pg_bin_for(v)/"pg_config"
system "make", "clean"
system "make"

mkdir_p lib/neon_postgres.name/v
mv "hll.so", lib/neon_postgres.name/v
mv "hll.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "hll.control", share/neon_postgres.name/v/"extension"
Expand All @@ -34,7 +42,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down
14 changes: 11 additions & 3 deletions Formula/rum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Rum < Formula
url "https://github.com/postgrespro/rum/archive/refs/tags/1.3.13.tar.gz"
sha256 "6ab370532c965568df6210bd844ac6ba649f53055e48243525b0b7e5c4d69a7d"
license "PostgreSQL"
revision 1

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -18,14 +19,21 @@ def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions with: "v16"
end

def install
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

ENV["USE_PGXS"] = "1"
system "make", "clean", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"
system "make", "PG_CONFIG=#{neon_postgres.pg_bin_for(v)}/pg_config"

mkdir_p lib/neon_postgres.name/v
mv "rum.so", lib/neon_postgres.name/v
mv "rum.#{dlsuffix}", lib/neon_postgres.name/v

mkdir_p share/neon_postgres.name/v/"extension"
cp "rum.control", share/neon_postgres.name/v/"extension"
Expand All @@ -34,7 +42,7 @@ def install
end

test do
neon_postgres.pg_versions.each do |v|
pg_versions.each do |v|
pg_ctl = neon_postgres.pg_bin_for(v)/"pg_ctl"
psql = neon_postgres.pg_bin_for(v)/"psql"
port = free_port
Expand Down