<commit_before>require 'formula'

# Note that cctools newer than 806 cannot build for PPC or for Tiger.
# Leopard+ users: submit a formula for a conditional
# newer version if you like.
#
# TODO: LLVM builds not supported yet.
class Cctools < Formula
  homepage 'http://opensource.apple.com/'
  url 'http://www.opensource.apple.com/tarballs/cctools/cctools-806.tar.gz'
  sha1 'e4f9a7ee0eef930e81d50b6b7300b8ddc1c7b341'

  depends_on 'cctools-headers' => :build
  depends_on 'ld64' => :build

  keg_only :provided_by_osx,
    "These modern versions of the tools were shipped with Xcode 4.1."

  def patches
    {
      :p0 => [
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/cctools-806-lto.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-9087924.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-9830754.patch',
        # Despite the patch name this is needed on 806 too
        'https://trac.macports.org/export/103985/trunk/dports/devel/cctools/files/cctools-822-no-lto.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-11136237.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-12475288.patch'
      ],
      # fixes up hardcoded paths in Makefiles
      :p1 => DATA
    }
  end

  def install
    ENV.j1 # see https://github.com/mistydemeo/tigerbrew/issues/102

    chmod 0755, 'libmacho/Makefile'
    inreplace 'libmacho/Makefile', '@PREFIX@', prefix

    args = %W[<commit_msg>cctools: add bottles<commit_after>require 'formula'

# Note that cctools newer than 806 cannot build for PPC or for Tiger.
# Leopard+ users: submit a formula for a conditional
# newer version if you like.
#
# TODO: LLVM builds not supported yet.
class Cctools < Formula
  homepage 'http://opensource.apple.com/'
  url 'http://www.opensource.apple.com/tarballs/cctools/cctools-806.tar.gz'
  sha1 'e4f9a7ee0eef930e81d50b6b7300b8ddc1c7b341'

  bottle do
    sha1 "0a1b8d858d2057ad85a1bd8fa9de934e54223c3f" => :tiger_g3
    sha1 "049866feb149128c031c37521f7be166435c6c15" => :tiger_g4e
    sha1 "6ec31fb6615accabf3a3defebd367e5cc7f78ffa" => :tiger_altivec
    sha1 "fc953e9dec74facebed0319911690769621dff09" => :leopard_g3
    sha1 "e51879f08bc81e9d1f59ba8333c5f3292ef62548" => :leopard_altivec
  end

  depends_on 'cctools-headers' => :build
  depends_on 'ld64' => :build

  keg_only :provided_by_osx,
    "These modern versions of the tools were shipped with Xcode 4.1."

  def patches
    {
      :p0 => [
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/cctools-806-lto.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-9087924.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-9830754.patch',
        # Despite the patch name this is needed on 806 too
        'https://trac.macports.org/export/103985/trunk/dports/devel/cctools/files/cctools-822-no-lto.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-11136237.patch',
        'https://trac.macports.org/export/103959/trunk/dports/devel/cctools/files/PR-12475288.patch'
      ],
      # fixes up hardcoded paths in Makefiles
      :p1 => DATA
    }
  end

  def install
    ENV.j1 # see https://github.com/mistydemeo/tigerbrew/issues/102

    chmod 0755, 'libmacho/Makefile'
    inreplace 'libmacho/Makefile', '@PREFIX@', prefix

    args = %W[
{'fraction_non_alphanumeric': 0.12394366197183099, 'fraction_numerical': 0.1028169014084507, 'mean_word_length': 3.4554579673776664, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, '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': '7118475', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1388, 'n_words': 229}