<commit_before>require "language/node"

class Emscripten < Formula
  desc "LLVM bytecode to JavaScript compiler"
  homepage "https://emscripten.org/"
  url "https://github.com/emscripten-core/emscripten/archive/2.0.16.tar.gz"
  sha256 "6a1732596349637953ba5c403c47ce064c80773816050066a5b130293666f59c"
  license all_of: [
    "Apache-2.0", # binaryen
    "Apache-2.0" => { with: "LLVM-exception" }, # llvm
    any_of: ["MIT", "NCSA"], # emscripten
  ]
  head "https://github.com/emscripten-core/emscripten.git"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+)+)$/i)
  end

  bottle do
    sha256 cellar: :any, arm64_big_sur: "077122fb453e065bf0732ade8a75afc0bf27bf49e2e56a52c60319178f338b4e"
    sha256 cellar: :any, big_sur:       "429b4e9318c8b11009b8216b54360100f1ebfc6607265d79006771db35bf02f0"
    sha256 cellar: :any, catalina:      "14dd5f2f1edc31e2e3600115a4a0db3b86e782abf9ec76d62f389c9d2ab24101"
    sha256 cellar: :any, mojave:        "82753560825770ada70b02929287524471156515f71ba08239b4dd74e05af856"
  end

  depends_on "cmake" => :build
  depends_on "node"
  depends_on "python@3.9"
  depends_on "yuicompressor"

  # Use emscripten's recommended binaryen revision to avoid build failures.
  # See llvm resource below for instructions on how to update this.
  resource "binaryen" do
    url "https://github.com/WebAssembly/binaryen.git",
        revision: "89b8af006bc56cb4bf68f12a80b1cfe8e7a353d4"
  end

  # emscripten needs argument '-fignore-exceptions', which is only available in llvm >= 12
  # To find the correct llvm revision, find a corresponding commit at:
  # https://github.com/emscripten-core/emsdk/blob/master/emscripten-releases-tags.txt
  # Then take this commit and go to:
  # https://chromium.googlesource.com/emscripten-releases/+/<commit>/DEPS
  # Then use the listed llvm_project_revision for the resource below.
  resource "llvm" do
    url "https://github.com/llvm/llvm-project.git",
        revision: "1c5f08312874717caf5d94729d825c32845773ec"
  end

  def install
    ENV.cxx11

    # All files from the repository are required as emscripten is a collection
    # of scripts which need to be installed in the same layout as in the Git
    # repository.
    libexec.install Dir["*"]<commit_msg>emscripten 2.0.17<commit_after>require "language/node"

class Emscripten < Formula
  desc "LLVM bytecode to JavaScript compiler"
  homepage "https://emscripten.org/"
  url "https://github.com/emscripten-core/emscripten/archive/2.0.17.tar.gz"
  sha256 "f9a7e8868c16f850755ace69e971f278a44433c0eec9e74496ee22a3bcd9c64e"
  license all_of: [
    "Apache-2.0", # binaryen
    "Apache-2.0" => { with: "LLVM-exception" }, # llvm
    any_of: ["MIT", "NCSA"], # emscripten
  ]
  head "https://github.com/emscripten-core/emscripten.git"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+)+)$/i)
  end

  bottle do
    sha256 cellar: :any, arm64_big_sur: "077122fb453e065bf0732ade8a75afc0bf27bf49e2e56a52c60319178f338b4e"
    sha256 cellar: :any, big_sur:       "429b4e9318c8b11009b8216b54360100f1ebfc6607265d79006771db35bf02f0"
    sha256 cellar: :any, catalina:      "14dd5f2f1edc31e2e3600115a4a0db3b86e782abf9ec76d62f389c9d2ab24101"
    sha256 cellar: :any, mojave:        "82753560825770ada70b02929287524471156515f71ba08239b4dd74e05af856"
  end

  depends_on "cmake" => :build
  depends_on "node"
  depends_on "python@3.9"
  depends_on "yuicompressor"

  # Use emscripten's recommended binaryen revision to avoid build failures.
  # See llvm resource below for instructions on how to update this.
  resource "binaryen" do
    url "https://github.com/WebAssembly/binaryen.git",
        revision: "67094a4a9b013a9705bcbf49ec7e0e8ab744389c"
  end

  # emscripten needs argument '-fignore-exceptions', which is only available in llvm >= 12
  # To find the correct llvm revision, find a corresponding commit at:
  # https://github.com/emscripten-core/emsdk/blob/master/emscripten-releases-tags.txt
  # Then take this commit and go to:
  # https://chromium.googlesource.com/emscripten-releases/+/<commit>/DEPS
  # Then use the listed llvm_project_revision for the resource below.
  resource "llvm" do
    url "https://github.com/llvm/llvm-project.git",
        revision: "3b677b81cec7b3c5132aee8fccc30252d87deb69"
  end

  def install
    ENV.cxx11

    # All files from the repository are required as emscripten is a collection
    # of scripts which need to be installed in the same layout as in the Git
    # repository.
    libexec.install Dir["*"]
{'fraction_non_alphanumeric': 0.10022271714922049, 'fraction_numerical': 0.13608017817371937, 'mean_word_length': 4.091836734693878, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 14, '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': '7208879', 'n_tokens_mistral': 2030, 'n_tokens_neox': 1709, 'n_words': 356}