<commit_before>class Compcert < Formula
  desc "Formally verified C compiler"
  homepage "http://compcert.inria.fr"
  url "http://compcert.inria.fr/release/compcert-3.0.1.tgz"
  sha256 "09c7dc18c681231c6e83a963b283b66a9352a9611c9695f4b0c4b7df8c90f935"

  bottle do
    cellar :any_skip_relocation
    sha256 "57afe3b1c9d98bb4d74e38012c3653479cd7ac9072410cc8ec168582543ca534" => :sierra
    sha256 "751d20e855b3e356c34294f0c4fa40d0c8aa068632aac1d52dc2a33a74e7638a" => :el_capitan
    sha256 "aa1f679c5442e7de7b52c8fa7a79dbabad8f046921b85eac657248046c756389" => :yosemite
  end

  option "with-config-x86_64", "Build Compcert with ./configure 'x86_64'"

  depends_on "menhir" => :build
  depends_on "ocaml" => :build
  depends_on "opam" => :build

  def install
    ENV.permit_arch_flags

    # Compcert's configure script hard-codes gcc. On Lion and under, this
    # creates problems since Xcode's gcc does not support CFI,
    # but superenv will trick it into using clang which does. This
    # causes problems with the compcert compiler at runtime.
    inreplace "configure", "${toolprefix}gcc", "${toolprefix}#{ENV.cc}"

    ENV["OPAMYES"] = "1"
    ENV["OPAMROOT"] = Pathname.pwd/"opamroot"
    (Pathname.pwd/"opamroot").mkpath
    system "opam", "init", "--no-setup"
    system "opam", "install", "coq=8.6"

    if build.with? "config-x86_64"
      system "opam", "config", "exec", "--",
             "./configure", "-prefix", prefix, "x86_64-macosx"
    else
      system "opam", "config", "exec", "--",
             "./configure", "-prefix", prefix, "ia32-macosx"
    end

    system "opam", "config", "exec", "--",
           "make", "all"
    system "opam", "config", "exec", "--",
           "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      int printf(const char *fmt, ...);
      int main(int argc, char** argv) {
        printf("Hello, world!\\n");
        return 0;
      }
    EOS
    system bin/"ccomp", "test.c", "-o", "test"
    system "./test"
  end
end
<commit_msg>compcert: update 3.0.1 bottle.<commit_after>class Compcert < Formula
  desc "Formally verified C compiler"
  homepage "http://compcert.inria.fr"
  url "http://compcert.inria.fr/release/compcert-3.0.1.tgz"
  sha256 "09c7dc18c681231c6e83a963b283b66a9352a9611c9695f4b0c4b7df8c90f935"

  bottle do
    cellar :any_skip_relocation
    sha256 "8c5306716040478221d6bceb6d4b01e7bee04bcb33b0b1242b8b73eb887634c5" => :sierra
    sha256 "a1feea71910e24d885753b22505185a45c97262b63fef65c20a7a4b58e28d128" => :el_capitan
    sha256 "017b63dd93c64946977153b5c8e52e30ada1c3e79795498ba3c68ff0b040da8e" => :yosemite
  end

  option "with-config-x86_64", "Build Compcert with ./configure 'x86_64'"

  depends_on "menhir" => :build
  depends_on "ocaml" => :build
  depends_on "opam" => :build

  def install
    ENV.permit_arch_flags

    # Compcert's configure script hard-codes gcc. On Lion and under, this
    # creates problems since Xcode's gcc does not support CFI,
    # but superenv will trick it into using clang which does. This
    # causes problems with the compcert compiler at runtime.
    inreplace "configure", "${toolprefix}gcc", "${toolprefix}#{ENV.cc}"

    ENV["OPAMYES"] = "1"
    ENV["OPAMROOT"] = Pathname.pwd/"opamroot"
    (Pathname.pwd/"opamroot").mkpath
    system "opam", "init", "--no-setup"
    system "opam", "install", "coq=8.6"

    if build.with? "config-x86_64"
      system "opam", "config", "exec", "--",
             "./configure", "-prefix", prefix, "x86_64-macosx"
    else
      system "opam", "config", "exec", "--",
             "./configure", "-prefix", prefix, "ia32-macosx"
    end

    system "opam", "config", "exec", "--",
           "make", "all"
    system "opam", "config", "exec", "--",
           "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      int printf(const char *fmt, ...);
      int main(int argc, char** argv) {
        printf("Hello, world!\\n");
        return 0;
      }
    EOS
    system bin/"ccomp", "test.c", "-o", "test"
    system "./test"
  end
end

{'fraction_non_alphanumeric': 0.14683419561468342, 'fraction_numerical': 0.10273466371027347, 'mean_word_length': 3.2335766423357666, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3349552', 'n_tokens_mistral': 1774, 'n_tokens_neox': 1552, 'n_words': 329}