<commit_before>class Expat < Formula
  desc "XML 1.0 parser"
  homepage "https://libexpat.github.io/"
  url "https://downloads.sourceforge.net/project/expat/expat/2.2.2/expat-2.2.2.tar.bz2"
  mirror "https://fossies.org/linux/www/expat-2.2.2.tar.bz2"
  sha256 "4376911fcf81a23ebd821bbabc26fd933f3ac74833f74924342c29aad2c86046"
  head "https://github.com/libexpat/libexpat.git"

  bottle do
    cellar :any
    sha256 "695b20a2db6da52fa0dd6a8a27b625ebbbbde60501d467bfdb2c35c014560f95" => :sierra
    sha256 "fc2aeee22d324256fd60e57207a6b25ae73321007ad937b0c4d079c4525872d8" => :el_capitan
    sha256 "cdf5f497c262b7ea270e38618ff4c54d7f6da22dc3c97355e977dfcb45223b08" => :yosemite
  end

  keg_only :provided_by_osx, "macOS includes Expat 1.5"

  # On Ubuntu 14, fix the error: You do not have support for any sources of high quality entropy
  depends_on "libbsd" unless OS.mac?

  def install
    system "./configure", "--prefix=#{prefix}",
                          "--mandir=#{man}",
                          *("--with-libbsd" unless OS.mac?)
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <stdio.h>
      #include "expat.h"

      static void XMLCALL my_StartElementHandler(
        void *userdata,
        const XML_Char *name,
        const XML_Char **atts)
      {
        printf("tag:%s|", name);
      }
<commit_msg>expat: update 2.2.2 bottle for Linuxbrew.<commit_after>class Expat < Formula
  desc "XML 1.0 parser"
  homepage "https://libexpat.github.io/"
  url "https://downloads.sourceforge.net/project/expat/expat/2.2.2/expat-2.2.2.tar.bz2"
  mirror "https://fossies.org/linux/www/expat-2.2.2.tar.bz2"
  sha256 "4376911fcf81a23ebd821bbabc26fd933f3ac74833f74924342c29aad2c86046"
  head "https://github.com/libexpat/libexpat.git"

  bottle do
    cellar :any
    sha256 "695b20a2db6da52fa0dd6a8a27b625ebbbbde60501d467bfdb2c35c014560f95" => :sierra
    sha256 "fc2aeee22d324256fd60e57207a6b25ae73321007ad937b0c4d079c4525872d8" => :el_capitan
    sha256 "cdf5f497c262b7ea270e38618ff4c54d7f6da22dc3c97355e977dfcb45223b08" => :yosemite
    sha256 "43ca94be46362d2640610df5b7b40291411aa9d6f88690743a97fb2ea3d9dee8" => :x86_64_linux
  end

  keg_only :provided_by_osx, "macOS includes Expat 1.5"

  # On Ubuntu 14, fix the error: You do not have support for any sources of high quality entropy
  depends_on "libbsd" unless OS.mac?

  def install
    system "./configure", "--prefix=#{prefix}",
                          "--mandir=#{man}",
                          *("--with-libbsd" unless OS.mac?)
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <stdio.h>
      #include "expat.h"

      static void XMLCALL my_StartElementHandler(
        void *userdata,
        const XML_Char *name,
        const XML_Char **atts)
      {
        printf("tag:%s|", name);
      }

{'fraction_non_alphanumeric': 0.11603740907516454, 'fraction_numerical': 0.14825077935573258, 'mean_word_length': 3.2037845705967976, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, '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': '2078878', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1158, 'n_words': 196}