Skip to content

Commit

Permalink
update with latest brew
Browse files Browse the repository at this point in the history
  • Loading branch information
maparent committed Jan 12, 2024
1 parent 936552b commit 6bcf4fa
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 91 deletions.
95 changes: 50 additions & 45 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class PostgresqlPlpyAT15 < Formula
desc "Python3 as procedural language for Postgres"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2"
sha256 "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9"
url "https://ftp.postgresql.org/pub/source/v15.5/postgresql-15.5.tar.bz2"
sha256 "8f53aa95d78eb8e82536ea46b68187793b42bba3b4f65aa342f540b23c9b10a6"
license "PostgreSQL"
revision 1
revision 2

livecheck do
url "https://ftp.postgresql.org/pub/source/"
Expand All @@ -17,26 +17,28 @@ class PostgresqlPlpyAT15 < Formula
deprecate! date: "2027-11-11", because: :unsupported

depends_on "postgresql@15"
depends_on "python@3.10"
depends_on "python@3.11"

def install
print "#{buildpath}/stage"
ENV.delete "PKG_CONFIG_LIBDIR"
ENV.prepend "LDFLAGS", "-L#{Formula["openssl@3"].opt_lib} -L#{Formula["readline"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["openssl@3"].opt_include} -I#{Formula["readline"].opt_include}"
ENV.prepend "PYTHON", "#{HOMEBREW_PREFIX}/opt/python@3.10/bin/python3.10"
ENV.prepend "PYTHON", "#{HOMEBREW_PREFIX}/opt/python@3.11/bin/python3.11"

# Fix 'libintl.h' file not found for extensions
ENV.prepend "LDFLAGS", "-L#{Formula["gettext"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["gettext"].opt_include}"
if OS.mac?
# Fix 'libintl.h' file not found for extensions
ENV.prepend "LDFLAGS", "-L#{Formula["gettext"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["gettext"].opt_include}"
end

args = std_configure_args + %W[
--prefix=#{prefix}
--datadir=#{HOMEBREW_PREFIX}/share/postgresql@15
--libdir=#{opt_lib}
--includedir=#{opt_include}
--libdir=#{HOMEBREW_PREFIX}/lib/postgresql@15
--includedir=#{HOMEBREW_PREFIX}/include/postgresql@15
--sysconfdir=#{etc}
--docdir=#{doc}
--mandir=#{libexec}/man
--enable-nls
--enable-thread-safety
--with-gssapi
Expand All @@ -45,10 +47,12 @@ def install
--with-libxml
--with-libxslt
--with-lz4
--with-zstd
--with-openssl
--with-pam
--with-python
--with-uuid=e2fs
--with-extra-version=\ (#{tap.user})
]
if OS.mac?
args += %w[
Expand All @@ -59,55 +63,56 @@ def install

# PostgreSQL by default uses xcodebuild internally to determine this,
# which does not work on CLT-only installs.
args << "PG_SYSROOT=#{MacOS.sdk_path}" if MacOS.sdk_root_needed?
args << "PG_SYSROOT=#{MacOS.sdk_path}" if OS.mac? && MacOS.sdk_root_needed?

system "./configure", *args
system "make", "pkglibdir=#{opt_lib}/postgresql",
"pkgincludedir=#{opt_include}/postgresql",
"includedir_server=#{opt_include}/postgresql/server"
system "make", "pkglibdir=#{lib}/postgresql@15",
"pkgincludedir=#{include}/postgresql@15",
"includedir_server=#{include}/postgresql@15/server"
mkdir "stage"
chdir "src/pl/plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@15",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@15",
"libdir=#{lib}/postgresql@15",
"pkglibdir=#{lib}/postgresql@15",
"includedir=#{include}/postgresql@15",
"pkgincludedir=#{include}/postgresql@15",
"includedir_server=#{include}/postgresql@15/server",
"includedir_internal=#{include}/postgresql@15/internal"
end
chdir "contrib/hstore_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@15",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@15",
"libdir=#{lib}/postgresql@15",
"pkglibdir=#{lib}/postgresql@15",
"includedir=#{include}/postgresql@15",
"pkgincludedir=#{include}/postgresql@15",
"includedir_server=#{include}/postgresql@15/server",
"includedir_internal=#{include}/postgresql@15/internal"
end
chdir "contrib/ltree_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@15",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@15",
"libdir=#{lib}/postgresql@15",
"pkglibdir=#{lib}/postgresql@15",
"includedir=#{include}/postgresql@15",
"pkgincludedir=#{include}/postgresql@15",
"includedir_server=#{include}/postgresql@15/server",
"includedir_internal=#{include}/postgresql@15/internal"
end
chdir "contrib/jsonb_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@15",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@15",
"libdir=#{lib}/postgresql@15",
"pkglibdir=#{lib}/postgresql@15",
"includedir=#{include}/postgresql@15",
"pkgincludedir=#{include}/postgresql@15",
"includedir_server=#{include}/postgresql@15/server",
"includedir_internal=#{include}/postgresql@15/internal"
end
(lib/"postgresql").install Dir["stage/**/lib/postgresql/*"]
(include/"postgresql/server").install Dir["stage/**/include/postgresql/server/*"]
(lib/"postgresql@15").install Dir["stage/**/lib/postgresql@15/*"]
(include/"postgresql@15/server").install Dir["stage/**/include/postgresql@15/server/*"]
(share/"postgresql@15").install Dir["stage/**/share/postgresql@15/*"]
(share/"postgresql@15/extension").install Dir["stage/**/share/postgresql@15/extension/*"]
end
end
97 changes: 51 additions & 46 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class PostgresqlPlpyAT16 < Formula
desc "Python3 as procedural language for Postgres"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v16.0/postgresql-16.0.tar.bz2"
sha256 "df9e823eb22330444e1d48e52cc65135a652a6fdb3ce325e3f08549339f51b99"
url "https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.bz2"
sha256 "ce3c4d85d19b0121fe0d3f8ef1fa601f71989e86f8a66f7dc3ad546dd5564fec"
license "PostgreSQL"
revision 1
revision 2

livecheck do
url "https://ftp.postgresql.org/pub/source/"
Expand All @@ -17,26 +17,28 @@ class PostgresqlPlpyAT16 < Formula
deprecate! date: "2028-11-09", because: :unsupported

depends_on "postgresql@16"
depends_on "python@3.10"
depends_on "python@3.11"

def install
print "#{buildpath}/stage"
ENV.delete "PKG_CONFIG_LIBDIR"
ENV.prepend "LDFLAGS", "-L#{Formula["openssl@3"].opt_lib} -L#{Formula["readline"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["openssl@3"].opt_include} -I#{Formula["readline"].opt_include}"
ENV.prepend "PYTHON", "#{HOMEBREW_PREFIX}/opt/python@3.10/bin/python3.10"
ENV.prepend "PYTHON", "#{HOMEBREW_PREFIX}/opt/python@3.11/bin/python3.11"

# Fix 'libintl.h' file not found for extensions
ENV.prepend "LDFLAGS", "-L#{Formula["gettext"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["gettext"].opt_include}"
if OS.mac?
# Fix 'libintl.h' file not found for extensions
ENV.prepend "LDFLAGS", "-L#{Formula["gettext"].opt_lib}"
ENV.prepend "CPPFLAGS", "-I#{Formula["gettext"].opt_include}"
end

args = std_configure_args + %W[
--prefix=#{prefix}
--datadir=#{HOMEBREW_PREFIX}/share/postgresql@16
--libdir=#{opt_lib}
--includedir=#{opt_include}
--libdir=#{HOMEBREW_PREFIX}/lib/postgresql@16
--includedir=#{HOMEBREW_PREFIX}/include/postgresql@16
--sysconfdir=#{etc}
--docdir=#{doc}
--mandir=#{libexec}/man
--enable-nls
--enable-thread-safety
--with-gssapi
Expand All @@ -45,10 +47,12 @@ def install
--with-libxml
--with-libxslt
--with-lz4
--with-zstd
--with-openssl
--with-pam
--with-python
--with-uuid=e2fs
--with-extra-version=\ (#{tap.user})
]
if OS.mac?
args += %w[
Expand All @@ -59,55 +63,56 @@ def install

# PostgreSQL by default uses xcodebuild internally to determine this,
# which does not work on CLT-only installs.
args << "PG_SYSROOT=#{MacOS.sdk_path}" if MacOS.sdk_root_needed?
args << "PG_SYSROOT=#{MacOS.sdk_path}" if OS.mac? && MacOS.sdk_root_needed?

system "./configure", *args
system "make", "pkglibdir=#{opt_lib}/postgresql",
"pkgincludedir=#{opt_include}/postgresql",
"includedir_server=#{opt_include}/postgresql/server"
system "make", "pkglibdir=#{lib}/postgresql@16",
"pkgincludedir=#{include}/postgresql@16",
"includedir_server=#{include}/postgresql@16/server"
mkdir "stage"
chdir "src/pl/plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@16",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@16",
"libdir=#{lib}/postgresql@16",
"pkglibdir=#{lib}/postgresql@16",
"includedir=#{include}/postgresql@16",
"pkgincludedir=#{include}/postgresql@16",
"includedir_server=#{include}/postgresql@16/server",
"includedir_internal=#{include}/postgresql@16/internal"
end
chdir "contrib/hstore_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@16",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@16",
"libdir=#{lib}/postgresql@16",
"pkglibdir=#{lib}/postgresql@16",
"includedir=#{include}/postgresql@16",
"pkgincludedir=#{include}/postgresql@16",
"includedir_server=#{include}/postgresql@16/server",
"includedir_internal=#{include}/postgresql@16/internal"
end
chdir "contrib/ltree_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@16",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@16",
"libdir=#{lib}/postgresql@16",
"pkglibdir=#{lib}/postgresql@16",
"includedir=#{include}/postgresql@16",
"pkgincludedir=#{include}/postgresql@16",
"includedir_server=#{include}/postgresql@16/server",
"includedir_internal=#{include}/postgresql@16/internal"
end
chdir "contrib/jsonb_plpython" do
system "make", "install", "DESTDIR=#{buildpath}/stage",
"datadir=#{HOMEBREW_PREFIX}/share/postgresql@16",
"libdir=#{lib}",
"pkglibdir=#{lib}/postgresql",
"includedir=#{include}",
"pkgincludedir=#{include}/postgresql",
"includedir_server=#{include}/postgresql/server",
"includedir_internal=#{include}/postgresql/internal"
"datadir=#{share}/postgresql@16",
"libdir=#{lib}/postgresql@16",
"pkglibdir=#{lib}/postgresql@16",
"includedir=#{include}/postgresql@16",
"pkgincludedir=#{include}/postgresql@16",
"includedir_server=#{include}/postgresql@16/server",
"includedir_internal=#{include}/postgresql@16/internal"
end
(lib/"postgresql").install Dir["stage/**/lib/postgresql/*"]
(include/"postgresql/server").install Dir["stage/**/include/postgresql/server/*"]
(share/"postgresql@16/extension").install Dir["stage/**/share/postgresql@16/extension/*"]
(lib/"postgresql@16").install Dir["stage/**/lib/postgresql@16/*"]
# (include/"postgresql@16/server").install Dir["stage/**/include/postgresql@16/server/*"]
# (share/"postgresql@16").install Dir["stage/**/share/postgresql@16/*"]
# (share/"postgresql@16/extension").install Dir["stage/**/share/postgresql@16/extension/*"]
end
end

0 comments on commit 6bcf4fa

Please sign in to comment.