<commit_before>require 'formula'

class Hidapi < Formula
  homepage 'https://github.com/signal11/hidapi'
  url 'https://github.com/signal11/hidapi/archive/hidapi-0.8.0-rc1.tar.gz'
  sha1 '5e72a4c7add8b85c8abcdd360ab8b1e1421da468'

  depends_on 'autoconf' => :build
  depends_on 'automake' => :build
  depends_on 'libtool' => :build
  depends_on 'pkg-config' => :build

  def install
    system './bootstrap'
    system "./configure", "--prefix=#{prefix}"
    system "make install"
  end

  test do
    (testpath/'test.c').write <<-EOS.undent
      #include "hidapi.h"
      int main(void)
      {
        return hid_exit();
      }
    EOS

    flags = ["-I#{include}/hidapi", "-L#{lib}", "-lhidapi"] + ENV.cflags.to_s.split
    system ENV.cc, "-o", "test", "test.c", *flags
    system './test'
  end
end<commit_msg>hidapi: add 0.8.0-rc1 bottle.<commit_after>require 'formula'

class Hidapi < Formula
  homepage 'https://github.com/signal11/hidapi'
  url 'https://github.com/signal11/hidapi/archive/hidapi-0.8.0-rc1.tar.gz'
  sha1 '5e72a4c7add8b85c8abcdd360ab8b1e1421da468'

  bottle do
    cellar :any
    sha1 "f3af3a129f163480bfa90d082a95cccd3469da5b" => :mavericks
    sha1 "39200d818b0b7889b351c781e4c94a42c3c749c4" => :mountain_lion
    sha1 "68edd3c5c191007340c14cae9537371e0b975f4a" => :lion
  end

  depends_on 'autoconf' => :build
  depends_on 'automake' => :build
  depends_on 'libtool' => :build
  depends_on 'pkg-config' => :build

  def install
    system './bootstrap'
    system "./configure", "--prefix=#{prefix}"
    system "make install"
  end

  test do
    (testpath/'test.c').write <<-EOS.undent
      #include "hidapi.h"
      int main(void)
      {
        return hid_exit();
      }
    EOS

    flags = ["-I#{include}/hidapi", "-L#{lib}", "-lhidapi"] + ENV.cflags.to_s.split
    system ENV.cc, "-o", "test", "test.c", *flags
    system './test'
  end
end
{'fraction_non_alphanumeric': 0.15691489361702127, 'fraction_numerical': 0.07765957446808511, 'mean_word_length': 3.18, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '1173115', 'n_tokens_mistral': 819, 'n_tokens_neox': 774, 'n_words': 136}