-
Notifications
You must be signed in to change notification settings - Fork 34
100 lines (83 loc) · 2.88 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
class PostgresqlAT84 < Formula
desc "Relational database management system"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v8.4.22/postgresql-8.4.22.tar.bz2"
sha256 "5c1d56ce77448706d9dd03b2896af19d9ab1b9b8dcdb96c39707c74675ca3826"
license "PostgreSQL"
head "https://git.postgresql.org/git/postgresql.git", branch: "REL8_4_STABLE"
livecheck do
url "https://ftp.postgresql.org/pub/source/"
regex(%r{href=["']?v?(8\.4(?:\.\d+)*)/?["' >]}i)
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: "2014-07-24", because: :unsupported
depends_on "gettext"
depends_on "openldap"
depends_on "ossp-uuid"
depends_on "perl"
depends_on "readline"
depends_on "tcl-tk"
# Fix uuid-ossp build issues: https://archives.postgresql.org/pgsql-general/2012-07/msg00654.php
patch :DATA
def install
args = %W[
--prefix=#{prefix}
--enable-dtrace
--enable-nls
--enable-thread-safety
--with-gssapi
--with-krb5
--with-ldap
--with-libxml
--with-libxslt
--with-ossp-uuid
--with-pam
--with-perl
--with-python
--with-tcl
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 openldap 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"
system "./configure", *args
system "make", "install"
system "make", "-C", "contrib", "install"
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
__END__
--- a/contrib/uuid-ossp/uuid-ossp.c 2012-07-30 18:34:53.000000000 -0700
+++ b/contrib/uuid-ossp/uuid-ossp.c 2012-07-30 18:35:03.000000000 -0700
@@ -9,6 +9,8 @@
*-------------------------------------------------------------------------
*/
+#define _XOPEN_SOURCE
+
#include "postgres.h"
#include "fmgr.h"
#include "utils/builtins.h"