<commit_before>require 'formula'

class TexInstalled < Requirement
  def message; <<-EOS.undent
    A TeX/LaTeX installation is required to install.
    You can obtain the TeX distribution for Mac OS X from:
        http://www.tug.org/mactex/
    After you install it, put its bin in your PATH and open a new Terminal tab.
    You should also do this because MacTex installs with root ownership:
        sudo chown -R $USER `brew --prefix`
    That will change all the files and directories back to being owned by you.
    EOS
  end
  def satisfied?
    which 'mpost'
  end
  def fatal?
    true
  end
end

class Lilypond < Formula
  homepage 'http://lilypond.org/'
  url 'http://download.linuxaudio.org/lilypond/sources/v2.16/lilypond-2.16.1.tar.gz'
  sha1 'ce923f27091ec5501df7bcd0596f1ffd7ab9b8b9'

  env :userpaths

  option 'with-doc', "Build documentation in addition to binaries (may require several hours)."

  depends_on TexInstalled.new
  depends_on 'pkg-config' => :build
  depends_on 'gettext'
  depends_on 'pango'
  depends_on 'guile'
  depends_on 'ghostscript'
  depends_on 'mftrace'
  depends_on 'fontforge'
  depends_on 'texinfo'
  depends_on :x11

  # Assert documentation dependencies if requested.
  if build.include? 'with-doc'
    depends_on 'netpbm'
    depends_on 'imagemagick'
    depends_on 'docbook'
    depends_on LanguageModuleDependency.new :python, 'dblatex', 'dbtexmf.dblatex'
    depends_on 'texi2html'
  end

  skip_clean :all

  fails_with :clang do
    build 421<commit_msg>Make lilypond use TeX requirement.<commit_after>require 'formula'

class Lilypond < Formula
  homepage 'http://lilypond.org/'
  url 'http://download.linuxaudio.org/lilypond/sources/v2.16/lilypond-2.16.1.tar.gz'
  sha1 'ce923f27091ec5501df7bcd0596f1ffd7ab9b8b9'

  option 'with-doc', "Build documentation in addition to binaries (may require several hours)."

  depends_on :tex
  depends_on 'pkg-config' => :build
  depends_on 'gettext'
  depends_on 'pango'
  depends_on 'guile'
  depends_on 'ghostscript'
  depends_on 'mftrace'
  depends_on 'fontforge'
  depends_on 'texinfo'
  depends_on :x11

  # Assert documentation dependencies if requested.
  if build.include? 'with-doc'
    depends_on 'netpbm'
    depends_on 'imagemagick'
    depends_on 'docbook'
    depends_on LanguageModuleDependency.new :python, 'dblatex', 'dbtexmf.dblatex'
    depends_on 'texi2html'
  end

  skip_clean :all

  fails_with :clang do
    build 421
{'fraction_non_alphanumeric': 0.08620689655172414, 'fraction_numerical': 0.029556650246305417, 'mean_word_length': 3.7690802348336594, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '1413383', 'n_tokens_mistral': 894, 'n_tokens_neox': 884, 'n_words': 235}