-
Notifications
You must be signed in to change notification settings - Fork 34
102 lines (84 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
class PostgresqlAT11 < Formula
desc "Relational database management system"
homepage "https://www.postgresql.org/"
version = "11.22"
url "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"
sha256 "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"
license "PostgreSQL"
livecheck do
url "https://ftp.postgresql.org/pub/source/"
regex(%r{href=["']?v?(11(?:\.\d+)*)/?["' >]}i)
end
head do
url "https://git.postgresql.org/git/postgresql.git", branch: "REL_11_STABLE"
depends_on "docbook-xsl" => :build
end
keg_only :versioned_formula
option "with-cassert", "Enable assertion checks (for debugging)"
deprecated_option "enable-cassert" => "with-cassert"
# https://www.postgresql.org/support/versioning/
deprecate! date: "2023-11-09", because: :unsupported
depends_on "pkg-config" => :build
depends_on "gettext"
depends_on "icu4c"
depends_on "openldap"
depends_on "[email protected]"
depends_on "python@3"
depends_on "readline"
depends_on "tcl-tk"
depends_on "llvm" => :optional
def install
args = %W[
--prefix=#{prefix}
--enable-dtrace
--enable-nls
--with-bonjour
--with-gssapi
--with-icu
--with-ldap
--with-libxml
--with-libxslt
--with-openssl
--with-uuid=e2fs
--with-pam
--with-perl
--with-python
--with-tcl
PYTHON=python3
XML2_CONFIG=:
]
# Add include and library directories of dependencies, so that
# they can be used for compiling extensions. Superenv does this
# when compiling this package, but won't record it for pg_config.
deps = %w[gettext icu4c openldap [email protected] readline tcl-tk]
with_includes = deps.map { |f| Formula[f].opt_include }.join(":")
with_libraries = deps.map { |f| Formula[f].opt_lib }.join(":")
args << "--with-includes=#{with_includes}"
args << "--with-libraries=#{with_libraries}"
args << "--enable-cassert" if build.with? "cassert"
args << "--with-llvm" if build.with? "llvm"
extra_version = ""
extra_version += "+git" if build.head?
extra_version += " (Homebrew petere/postgresql)"
args << "--with-extra-version=#{extra_version}"
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
system "./configure", *args
system "make", "install-world"
end
def caveats
<<~EOS
To use this PostgreSQL installation, do one or more of the following:
- Call all programs explicitly with #{opt_prefix}/bin/...
- Add #{opt_bin} to your PATH
- brew link -f #{name}
- Install the postgresql-common package
To access the man pages, do one or more of the following:
- Refer to them by their full path, like `man #{opt_share}/man/man1/psql.1`
- Add #{opt_share}/man to your MANPATH
- brew link -f #{name}
EOS
end
test do
system "#{bin}/initdb", "pgdata"
end
end