<commit_before>require 'formula'

class Doxygen < Formula
  homepage 'http://www.doxygen.org/'
  url 'http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.5.src.tar.gz'
  mirror 'http://downloads.sourceforge.net/project/doxygen/rel-1.8.5/doxygen-1.8.5.src.tar.gz'
  sha1 '1fc5ceec21122fe5037edee4c308ac94b59ee33e'

  head 'https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk'

  option 'with-dot', 'Build with dot command support from Graphviz.'
  option 'with-doxywizard', 'Build GUI frontend with qt support.'
  option 'with-libclang', 'Build with libclang support.'

  depends_on 'graphviz' if build.with? 'dot'
  depends_on 'qt' if build.with? 'doxywizard'
  depends_on 'llvm' => 'with-clang' if build.with? 'libclang'

  def patches
    DATA if build.with? 'doxywizard'
  end

  def install
    args = ["--prefix", prefix]
    args << '--with-libclang' if build.with? 'libclang'
    args << '--with-doxywizard' if build.with? 'doxywizard'
    system "./configure", *args
    # Per Macports:
    # https://trac.macports.org/browser/trunk/dports/textproc/doxygen/Portfile#L92
    inreplace %w[ libmd5/Makefile.libmd5
                  src/Makefile.libdoxycfg
                  tmake/lib/macosx-c++/tmake.conf
                  tmake/lib/macosx-intel-c++/tmake.conf
                  tmake/lib/macosx-uni-c++/tmake.conf ] do |s|
      # otherwise clang may use up large amounts of RAM while
      # processing localization files
      # gcc doesn't support the flag
      s.gsub! '-Wno-invalid-source-encoding', '' unless ENV.compiler == :clang
      # makefiles hardcode both cc and c++
      s.gsub! /cc$/, ENV.cc
      s.gsub! /c\+\+$/, ENV.cxx
    end

    # This is a terrible hack; configure finds lex/yacc OK but
    # one Makefile doesn't get generated with these, so pull<commit_msg>doxygen: remove unnecessary inreplace<commit_after>require 'formula'

class Doxygen < Formula
  homepage 'http://www.doxygen.org/'
  url 'http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.5.src.tar.gz'
  mirror 'http://downloads.sourceforge.net/project/doxygen/rel-1.8.5/doxygen-1.8.5.src.tar.gz'
  sha1 '1fc5ceec21122fe5037edee4c308ac94b59ee33e'

  head 'https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk'

  option 'with-dot', 'Build with dot command support from Graphviz.'
  option 'with-doxywizard', 'Build GUI frontend with qt support.'
  option 'with-libclang', 'Build with libclang support.'

  depends_on 'graphviz' if build.with? 'dot'
  depends_on 'qt' if build.with? 'doxywizard'
  depends_on 'llvm' => 'with-clang' if build.with? 'libclang'

  def patches
    DATA if build.with? 'doxywizard'
  end

  def install
    args = ["--prefix", prefix]
    args << '--with-libclang' if build.with? 'libclang'
    args << '--with-doxywizard' if build.with? 'doxywizard'
    system "./configure", *args
    # Per Macports:
    # https://trac.macports.org/browser/trunk/dports/textproc/doxygen/Portfile#L92
    inreplace %w[ libmd5/Makefile.libmd5
                  src/Makefile.libdoxycfg
                  tmake/lib/macosx-c++/tmake.conf
                  tmake/lib/macosx-intel-c++/tmake.conf
                  tmake/lib/macosx-uni-c++/tmake.conf ] do |s|
      # makefiles hardcode both cc and c++
      s.gsub! /cc$/, ENV.cc
      s.gsub! /c\+\+$/, ENV.cxx
    end

    # This is a terrible hack; configure finds lex/yacc OK but
    # one Makefile doesn't get generated with these, so pull
{'fraction_non_alphanumeric': 0.13639035861258084, 'fraction_numerical': 0.0205761316872428, 'mean_word_length': 2.8495475113122173, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2235399', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1238, 'n_words': 271}