<commit_before>class PostgresqlAT94 < Formula
  desc "Object-relational database system"
  homepage "https://www.postgresql.org/"
  url "https://ftp.postgresql.org/pub/source/v9.4.19/postgresql-9.4.19.tar.bz2"
  sha256 "03776b036b2a05371083558e10c21cc4b90bde9eb3aff60299c4ce7c084c168b"
  revision 1

  bottle do
    sha256 "d9a3c46b336b227a8e183c08bc33e46d2d9369d2b977bfdf3cee8a168a51d0b2" => :mojave
    sha256 "8a5c4a0787a6db560f4a3442950a52620e4cd48462fe18f491375157d65321f3" => :high_sierra
    sha256 "c5a2b6159b87048b4a10e04c36b6f061e30d5babc1d9f24bcd9eab2d0baf95e9" => :sierra
  end

  keg_only :versioned_formula

  depends_on "openssl"
  depends_on "readline"

  unless OS.mac?
    depends_on "libxslt"
    depends_on "perl"
    depends_on "util-linux" # for libuuid
  end

  def install
    # Fix "configure: error: readline library not found"
    if MacOS.version == :sierra || MacOS.version == :el_capitan
      ENV["SDKROOT"] = MacOS.sdk_path
    end

    ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib}"
    ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}"
    ENV.append_to_cflags "-D_XOPEN_SOURCE"

    args = %W[
      --disable-debug
      --prefix=#{prefix}
      --datadir=#{pkgshare}
      --docdir=#{doc}
      --enable-thread-safety
      --with-openssl
      --with-libxml
      --with-libxslt
      --with-perl
      --with-uuid=e2fs
    ]
    args += %w[
      --with-bonjour
      --with-gssapi
      --with-ldap
      --with-pam
    ] if OS.mac?

    # The CLT is required to build tcl support on 10.7 and 10.8 because tclConfig.sh is not part of the SDK
    if MacOS.version >= :mavericks || MacOS::CLT.installed?
      args << "--with-tcl"
      if File.exist?("#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh")
        args << "--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework"
      end
    end

    # As of Xcode/CLT 10.x the Perl headers were moved from /System
    # to inside the SDK, so we need to use `-iwithsysroot` instead
    # of `-I` to point to the correct location.
    # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org
    if DevelopmentTools.clang_build_version >= 1000
      inreplace "configure",
                "-I$perl_archlibexp/CORE",
                "-iwithsysroot $perl_archlibexp/CORE"
      inreplace "src/pl/plperl/GNUmakefile",
                "-I$(perl_archlibexp)/CORE",
                "-iwithsysroot $(perl_archlibexp)/CORE"
    end

    system "./configure", *args

    # Temporarily disable building/installing the documentation.<commit_msg>postgresql@9.4: Fix build for Linuxbrew<commit_after>class PostgresqlAT94 < Formula
  desc "Object-relational database system"
  homepage "https://www.postgresql.org/"
  url "https://ftp.postgresql.org/pub/source/v9.4.19/postgresql-9.4.19.tar.bz2"
  sha256 "03776b036b2a05371083558e10c21cc4b90bde9eb3aff60299c4ce7c084c168b"
  revision 1

  bottle do
    sha256 "d9a3c46b336b227a8e183c08bc33e46d2d9369d2b977bfdf3cee8a168a51d0b2" => :mojave
    sha256 "8a5c4a0787a6db560f4a3442950a52620e4cd48462fe18f491375157d65321f3" => :high_sierra
    sha256 "c5a2b6159b87048b4a10e04c36b6f061e30d5babc1d9f24bcd9eab2d0baf95e9" => :sierra
  end

  keg_only :versioned_formula

  depends_on "openssl"
  depends_on "readline"

  unless OS.mac?
    depends_on "libxslt"
    depends_on "perl"
    depends_on "util-linux" # for libuuid
  end

  def install
    # Fix "configure: error: readline library not found"
    if MacOS.version == :sierra || MacOS.version == :el_capitan
      ENV["SDKROOT"] = MacOS.sdk_path
    end

    ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib}"
    ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}"
    ENV.append_to_cflags "-D_XOPEN_SOURCE"

    args = %W[
      --disable-debug
      --prefix=#{prefix}
      --datadir=#{pkgshare}
      --docdir=#{doc}
      --enable-thread-safety
      --with-openssl
      --with-libxml
      --with-libxslt
      --with-perl
      --with-uuid=e2fs
    ]
    if OS.mac?
      args += %w[
        --with-bonjour
        --with-gssapi
        --with-ldap
        --with-pam
      ]

      # The CLT is required to build tcl support on 10.7 and 10.8 because tclConfig.sh is not part of the SDK
      if MacOS.version >= :mavericks || MacOS::CLT.installed?
        args << "--with-tcl"
        if File.exist?("#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh")
          args << "--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework"
        end
      end
    end

    # As of Xcode/CLT 10.x the Perl headers were moved from /System
    # to inside the SDK, so we need to use `-iwithsysroot` instead
    # of `-I` to point to the correct location.
    # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org
    if DevelopmentTools.clang_build_version >= 1000
      inreplace "configure",
                "-I$perl_archlibexp/CORE",
                "-iwithsysroot $perl_archlibexp/CORE"
      inreplace "src/pl/plperl/GNUmakefile",
                "-I$(perl_archlibexp)/CORE",
                "-iwithsysroot $(perl_archlibexp)/CORE"
    end

    system "./configure", *args

    # Temporarily disable building/installing the documentation.
{'fraction_non_alphanumeric': 0.12207174231332357, 'fraction_numerical': 0.08638360175695461, 'mean_word_length': 2.9288281811646297, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3187057', 'n_tokens_mistral': 2341, 'n_tokens_neox': 2048, 'n_words': 356}