<commit_before>class GnuApl < Formula
  desc "GNU implementation of the programming language APL"
  homepage "https://www.gnu.org/software/apl/"
  url "https://ftp.gnu.org/gnu/apl/apl-1.7.tar.gz"
  mirror "https://ftpmirror.gnu.org/apl/apl-1.7.tar.gz"
  sha256 "8ff6e28256d7a3cdfa9dc6025e3905312310b27a43645ef5d617fd4a5b43b81f"

  bottle do
    sha256 "ba1839e1a64c434180af2b8ba81c43e35cacd685eed11fcbeaeced5c5e58b87f" => :sierra
    sha256 "1077298d934bc67c86d8196405f7ff312e52631ed3489bb868cf7d23196a6bf9" => :el_capitan
    sha256 "235adcfc3ec604544b0c18cd61b6b4f1b9bbe47f1415e6b94e13f9a7d9264115" => :yosemite
  end

  head do
    url "https://svn.savannah.gnu.org/svn/apl/trunk"

    depends_on "automake" => :build
    depends_on "autoconf" => :build
    depends_on "libtool" => :build
  end

  # GNU Readline is required; libedit won't work.
  depends_on "readline"
  depends_on :macos => :mavericks

  def install
    system "autoreconf", "-fiv" if build.head?
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}"
    system "make", "install"
  end

  test do
    (testpath/"hello.apl").write <<-EOS.undent
      'Hello world'
      )OFF
    EOS

    pid = fork do
      exec "#{bin}/APserver"
    end
    sleep 4

    begin<commit_msg>gnu-apl: workaround for Xcode 9<commit_after>class GnuApl < Formula
  desc "GNU implementation of the programming language APL"
  homepage "https://www.gnu.org/software/apl/"
  url "https://ftp.gnu.org/gnu/apl/apl-1.7.tar.gz"
  mirror "https://ftpmirror.gnu.org/apl/apl-1.7.tar.gz"
  sha256 "8ff6e28256d7a3cdfa9dc6025e3905312310b27a43645ef5d617fd4a5b43b81f"

  bottle do
    sha256 "ba1839e1a64c434180af2b8ba81c43e35cacd685eed11fcbeaeced5c5e58b87f" => :sierra
    sha256 "1077298d934bc67c86d8196405f7ff312e52631ed3489bb868cf7d23196a6bf9" => :el_capitan
    sha256 "235adcfc3ec604544b0c18cd61b6b4f1b9bbe47f1415e6b94e13f9a7d9264115" => :yosemite
  end

  head do
    url "https://svn.savannah.gnu.org/svn/apl/trunk"

    depends_on "automake" => :build
    depends_on "autoconf" => :build
    depends_on "libtool" => :build
  end

  # GNU Readline is required; libedit won't work.
  depends_on "readline"
  depends_on :macos => :mavericks

  def install
    # Work around "error: no member named 'signbit' in the global namespace"
    # encountered when trying to detect boost regex in configure
    ENV.delete("SDKROOT") if DevelopmentTools.clang_build_version >= 900

    system "autoreconf", "-fiv" if build.head?
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}"
    system "make", "install"
  end

  test do
    (testpath/"hello.apl").write <<-EOS.undent
      'Hello world'
      )OFF
    EOS

    pid = fork do
      exec "#{bin}/APserver"
    end
    sleep 4

    begin
{'fraction_non_alphanumeric': 0.11350099272005294, 'fraction_numerical': 0.11647915287888816, 'mean_word_length': 2.9568062827225132, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 18, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3902641', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1174, 'n_words': 209}