<commit_before>require 'formula'

class Mutt < Formula
  homepage 'http://www.mutt.org/'
  url 'ftp://ftp.mutt.org/mutt/devel/mutt-1.5.22.tar.gz'
  sha1 '728a114cb3a44df373dbf1292fc34dd8321057dc'

  head do
    url 'http://dev.mutt.org/hg/mutt#HEAD', :using => :hg

    resource 'html' do
      url 'http://dev.mutt.org/doc/manual.html', :using => :nounzip
    end

    depends_on :autoconf
    depends_on :automake
  end

  option "with-debug", "Build with debug option enabled"
  option "with-sidebar-patch", "Apply sidebar (folder list) patch" unless build.head?
  option "with-trash-patch", "Apply trash folder patch"
  option "with-slang", "Build against slang instead of ncurses"
  option "with-ignore-thread-patch", "Apply ignore-thread patch"
  option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch"
  option "with-pgp-multiple-crypt-hook-patch", "Apply PGP multiple-crypti-hook patch"
  option "with-confirm-attachment-patch", "Apply confirm attachment patch"

  depends_on 'tokyo-cabinet'
  depends_on 's-lang' => :optional

  def patches
    urls = [
      ['with-sidebar-patch', 'https://raw.github.com/nedos/mutt-sidebar-patch/master/mutt-sidebar.patch'],
      ['with-trash-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features/trash-folder'],
      # original source for this went missing, patch sourced from Arch at
      # https://aur.archlinux.org/packages/mutt-ignore-thread/
      ['with-ignore-thread-patch', 'https://gist.github.com/mistydemeo/5522742/raw/1439cc157ab673dc8061784829eea267cd736624/ignore-thread-1.5.21.patch'],
      ['with-pgp-verbose-mime-patch',
          'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.2/features-old/patch-1.5.4.vk.pgp_verbose_mime'],
      ['with-pgp-multiple-crypt-hook-patch',
          'http://localhost.lu/mutt/patches/patch-1.5.22.sc.multiple-crypt-hook.1'],
      ['with-pgp-combined-crypt-hook-patch',
          'http://localhost.lu/mutt/patches/patch-1.5.22.sc.crypt-combined.1'],
      ['with-confirm-attachment-patch', 'https://gist.github.com/tlvince/5741641/raw/c926ca307dc97727c2bd88a84dcb0d7ac3bb4bf5/mutt-attach.patch'],
    ]

    if build.with? "ignore-thread-patch" and build.with? "sidebar-patch"
      puts "\n"<commit_msg>Add in TLS cipher picking patch for mutt.<commit_after>require 'formula'

class Mutt < Formula
  homepage 'http://www.mutt.org/'
  url 'ftp://ftp.mutt.org/mutt/devel/mutt-1.5.22.tar.gz'
  sha1 '728a114cb3a44df373dbf1292fc34dd8321057dc'

  head do
    url 'http://dev.mutt.org/hg/mutt#HEAD', :using => :hg

    resource 'html' do
      url 'http://dev.mutt.org/doc/manual.html', :using => :nounzip
    end

    depends_on :autoconf
    depends_on :automake
  end

  option "with-debug", "Build with debug option enabled"
  option "with-sidebar-patch", "Apply sidebar (folder list) patch" unless build.head?
  option "with-trash-patch", "Apply trash folder patch"
  option "with-slang", "Build against slang instead of ncurses"
  option "with-ignore-thread-patch", "Apply ignore-thread patch"
  option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch"
  option "with-pgp-multiple-crypt-hook-patch", "Apply PGP multiple-crypti-hook patch"
  option "with-confirm-attachment-patch", "Apply confirm attachment patch"
  option "with-tls-ciphers-patch", "Apply configure TLS ciphers patch"

  depends_on 'tokyo-cabinet'
  depends_on 's-lang' => :optional
  depends_on 'openssl' if build.with? "tls-ciphers-patch"

  def patches
    urls = [
      ['with-sidebar-patch', 'https://raw.github.com/nedos/mutt-sidebar-patch/master/mutt-sidebar.patch'],
      ['with-trash-patch', 'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.4/features/trash-folder'],
      # original source for this went missing, patch sourced from Arch at
      # https://aur.archlinux.org/packages/mutt-ignore-thread/
      ['with-ignore-thread-patch', 'https://gist.github.com/mistydemeo/5522742/raw/1439cc157ab673dc8061784829eea267cd736624/ignore-thread-1.5.21.patch'],
      ['with-pgp-verbose-mime-patch',
          'http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.2/features-old/patch-1.5.4.vk.pgp_verbose_mime'],
      ['with-pgp-multiple-crypt-hook-patch',
          'http://localhost.lu/mutt/patches/patch-1.5.22.sc.multiple-crypt-hook.1'],
      ['with-pgp-combined-crypt-hook-patch',
          'http://localhost.lu/mutt/patches/patch-1.5.22.sc.crypt-combined.1'],
      ['with-confirm-attachment-patch', 'https://gist.github.com/tlvince/5741641/raw/c926ca307dc97727c2bd88a84dcb0d7ac3bb4bf5/mutt-attach.patch'],
      ['with-tls-ciphers-patch', 'http://dev.mutt.org/trac/raw-attachment/ticket/3167/mutt-ssl-ciphers-patch.diff' ]
    ]

    if build.with? "ignore-thread-patch" and build.with? "sidebar-patch"
      puts "\n"
{'fraction_non_alphanumeric': 0.1597164303586322, 'fraction_numerical': 0.05212677231025855, 'mean_word_length': 3.5297450424929178, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 8, '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': '1801068', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1761, 'n_words': 272}