<commit_before>class Openni < Formula
  homepage "http://www.openni.org/"

  head "https://github.com/OpenNI/OpenNI.git"

  stable do
    url "https://github.com/OpenNI/OpenNI/archive/Stable-1.5.7.10.tar.gz"
    sha256 "34b0bbf68633bb213dcb15408f979d5384bdceb04e151fa519e107a12e225852"

    # Fix for Mavericks
    patch do
      url "https://github.com/OpenNI/OpenNI/pull/92.diff"
      sha256 "d2bc9bd628cc463b4e7cdc9bf3abc3ba78d04e4d451d02f7f6cf7d0c4d032634"
    end
  end

  devel do
    url "https://github.com/OpenNI/OpenNI/archive/Unstable-1.5.8.5.tar.gz"
    sha256 "766d3b9745e8d486ad2998e1437bb161188282cfc1553502386457d1438df42f"

    # Fix for Mavericks
    patch do
      url "https://github.com/OpenNI/OpenNI/pull/95.diff"
      sha256 "722fb0a6e6e99a5cc7c7e862ac802dfd3d03785c27af1d20d7f48314ff5154dd"
    end
  end

  option :universal

  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "libusb"
  depends_on "doxygen" => :build

  def install
    ENV.universal_binary if build.universal?

    # Fix build files
    inreplace "Source/OpenNI/XnOpenNI.cpp", "/var/lib/ni/", "#{var}/lib/ni/"
    inreplace "Platform/Linux/Build/Common/CommonJavaMakefile", "/usr/share/java", "#{share}/java"

    # Build OpenNI
    cd "Platform/Linux/CreateRedist"
    chmod 0755, "RedistMaker"
    system "./RedistMaker"

    cd Dir.glob("../Redist/OpenNI-Bin-Dev-MacOSX-v*")[0]

    bin.install Dir["Bin/ni*"]
    lib.install Dir["Lib/*"]
    (include+"ni").install Dir["Include/*"]
    (share+"java").install Dir["Jar/*"]<commit_msg>openni: Fix compilation of HEAD<commit_after>class Openni < Formula
  homepage "http://www.openni.org/"

  stable do
    url "https://github.com/OpenNI/OpenNI/archive/Stable-1.5.7.10.tar.gz"
    sha256 "34b0bbf68633bb213dcb15408f979d5384bdceb04e151fa519e107a12e225852"

    # Fix for Mavericks
    patch do
      url "https://github.com/OpenNI/OpenNI/pull/92.diff"
      sha256 "d2bc9bd628cc463b4e7cdc9bf3abc3ba78d04e4d451d02f7f6cf7d0c4d032634"
    end
  end

  devel do
    url "https://github.com/OpenNI/OpenNI/archive/Unstable-1.5.8.5.tar.gz"
    sha256 "766d3b9745e8d486ad2998e1437bb161188282cfc1553502386457d1438df42f"

    # Fix for Mavericks
    patch do
      url "https://github.com/OpenNI/OpenNI/pull/95.diff"
      sha256 "722fb0a6e6e99a5cc7c7e862ac802dfd3d03785c27af1d20d7f48314ff5154dd"
    end
  end

  head do
    url "https://github.com/OpenNI/OpenNI.git"
    patch do
      url "https://github.com/OpenNI/OpenNI/pull/106.diff"
      sha256 "4aa53e8d6447417be32d1d7ff93788838ee837de291620cb753395be57a25d1d"
    end
  end

  option :universal

  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "libusb"
  depends_on "doxygen" => :build

  def install
    ENV.universal_binary if build.universal?

    # Fix build files
    inreplace "Source/OpenNI/XnOpenNI.cpp", "/var/lib/ni/", "#{var}/lib/ni/"
    inreplace "Platform/Linux/Build/Common/CommonJavaMakefile", "/usr/share/java", "#{share}/java"

    # Build OpenNI
    cd "Platform/Linux/CreateRedist"
    chmod 0755, "RedistMaker"
    system "./RedistMaker"

    cd Dir.glob("../Redist/OpenNI-Bin-Dev-MacOSX-v*")[0]

    bin.install Dir["Bin/ni*"]
    lib.install Dir["Lib/*"]
    (include+"ni").install Dir["Include/*"]
    (share+"java").install Dir["Jar/*"]
{'fraction_non_alphanumeric': 0.13257005122024706, 'fraction_numerical': 0.1304609822235613, 'mean_word_length': 3.529331514324693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 11, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, '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': '6215238', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1354, 'n_words': 191}