<commit_before>class OpenZwave < Formula
  desc "Library for selected Z-Wave PC controllers"
  homepage "http://www.openzwave.com"
  url "http://old.openzwave.com/downloads/openzwave-1.2.919.tar.gz"
  sha256 "473229f3dd3d6b260e6584b17e5c5f2e09e61805f89763f486a9f7aa2b4181ba"

  bottle do
    sha256 "68502b64e9fb7031f9fc5fe4fa7e6714fd5e5ab93d467169e7e47e90c322ff64" => :sierra
    sha256 "4bf1d8a8ba3fcf4ee39df9bfe09017d3a432047e5e6bf0dce6f6e612ad174b95" => :el_capitan
    sha256 "9ceb267d8fb564daefb535f65ac71f426535f7552b9feffcb3638793f0c40810" => :yosemite
    sha256 "753eb6cb76dd0c170c1e84285a702fb9fb49c76aa8d59970ecea2160938f0bba" => :mavericks
    sha256 "be2b4c51703ee93865a6c755a4394b6271eb599ea98a7431b54d090276a0e9f7" => :mountain_lion
  end

  # Patch to build a .dylib instead of a .so
  # This patch has been merged upstream and can be removed after the next release:
  # https://code.google.com/p/open-zwave/source/detail?r=954
  patch :DATA

  def install
    ENV["BUILD"] = "release"
    ENV["PREFIX"] = prefix

    system "make", "install"
  end

  test do
    (testpath/"test.cpp").write <<-EOS.undent
      #include <iostream>
      #include "Options.h"
      int main() {
        OpenZWave::Options::Create("", "", "");
        return 0;
      }
    EOS
    system ENV.cxx, "-o", "test", "-I", prefix/"include/openzwave", "-lopenzwave", "test.cpp"
    system "./test"
  end
end

__END__
diff --git a/cpp/build/Makefile b/cpp/build/Makefile
index 24df4f5..b064029 100644
--- a/cpp/build/Makefile
+++ b/cpp/build/Makefile
@@ -23,16 +23,24 @@ top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../)
 
 include $(top_srcdir)/cpp/build/support.mk
 
+#Mac prefers a dylib, not a so
+ifeq ($(UNAME),Darwin)
+SHARED_LIB_NAME=libopenzwave-$(VERSION).dylib
+SHARED_LIB_UNVERSIONED=libopenzwave.dylib
+else
+SHARED_LIB_NAME=libopenzwave.so.$(VERSION)
+SHARED_LIB_UNVERSIONED=libopenzwave.so
+endif
 
 #if we are on a Mac, add these flags and libs to the compile and link phases 
 ifeq ($(UNAME),Darwin)
 CFLAGS	+= -c -DDARWIN -arch i386 -arch x86_64<commit_msg>open-zwave: fix test on 10.13<commit_after>class OpenZwave < Formula
  desc "Library for selected Z-Wave PC controllers"
  homepage "http://www.openzwave.com"
  url "http://old.openzwave.com/downloads/openzwave-1.2.919.tar.gz"
  sha256 "473229f3dd3d6b260e6584b17e5c5f2e09e61805f89763f486a9f7aa2b4181ba"

  bottle do
    sha256 "68502b64e9fb7031f9fc5fe4fa7e6714fd5e5ab93d467169e7e47e90c322ff64" => :sierra
    sha256 "4bf1d8a8ba3fcf4ee39df9bfe09017d3a432047e5e6bf0dce6f6e612ad174b95" => :el_capitan
    sha256 "9ceb267d8fb564daefb535f65ac71f426535f7552b9feffcb3638793f0c40810" => :yosemite
    sha256 "753eb6cb76dd0c170c1e84285a702fb9fb49c76aa8d59970ecea2160938f0bba" => :mavericks
    sha256 "be2b4c51703ee93865a6c755a4394b6271eb599ea98a7431b54d090276a0e9f7" => :mountain_lion
  end

  # Patch to build a .dylib instead of a .so
  # This patch has been merged upstream and can be removed after the next release:
  # https://code.google.com/p/open-zwave/source/detail?r=954
  patch :DATA

  def install
    ENV["BUILD"] = "release"
    ENV["PREFIX"] = prefix

    system "make", "install"
  end

  test do
    (testpath/"test.cpp").write <<-EOS.undent
      #include <iostream>
      #include "Options.h"
      int main() {
        OpenZWave::Options::Create("", "", "");
        return 0;
      }
    EOS
    system ENV.cxx, "-o", "test", "-I", prefix/"include/openzwave", "-L#{lib}", "-lopenzwave", "test.cpp"
    system "./test"
  end
end

__END__
diff --git a/cpp/build/Makefile b/cpp/build/Makefile
index 24df4f5..b064029 100644
--- a/cpp/build/Makefile
+++ b/cpp/build/Makefile
@@ -23,16 +23,24 @@ top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../)
 
 include $(top_srcdir)/cpp/build/support.mk
 
+#Mac prefers a dylib, not a so
+ifeq ($(UNAME),Darwin)
+SHARED_LIB_NAME=libopenzwave-$(VERSION).dylib
+SHARED_LIB_UNVERSIONED=libopenzwave.dylib
+else
+SHARED_LIB_NAME=libopenzwave.so.$(VERSION)
+SHARED_LIB_UNVERSIONED=libopenzwave.so
+endif
 
 #if we are on a Mac, add these flags and libs to the compile and link phases 
 ifeq ($(UNAME),Darwin)
 CFLAGS	+= -c -DDARWIN -arch i386 -arch x86_64
{'fraction_non_alphanumeric': 0.12678741658722592, 'fraction_numerical': 0.14204003813155386, 'mean_word_length': 4.305941845764854, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '6137865', 'n_tokens_mistral': 2089, 'n_tokens_neox': 1758, 'n_words': 316}