2011-05-28 00:52:46 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libnfc < Formula
|
|
|
|
homepage 'http://www.libnfc.org/'
|
2013-10-17 02:22:42 +00:00
|
|
|
url 'https://libnfc.googlecode.com/files/libnfc-1.7.0.tar.bz2'
|
|
|
|
sha1 '5adfb6c6238b1659ad8609837dc8e59eb41a8768'
|
2012-12-26 18:03:21 +00:00
|
|
|
|
2014-05-01 21:08:51 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "6ef108d4cfb9dd7b7de6c8b487e84b013d791b6b" => :mavericks
|
|
|
|
sha1 "90ecfb5007d2536460e09331f9ac0ab3d5e99d4f" => :mountain_lion
|
|
|
|
sha1 "3797f5f195e93da48dea1b09ce2fc9d190df7365" => :lion
|
|
|
|
end
|
|
|
|
|
2012-12-26 18:03:21 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2011-05-28 00:52:46 +00:00
|
|
|
depends_on 'libusb-compat'
|
|
|
|
|
2012-12-26 18:03:21 +00:00
|
|
|
# Fixes the lack of MIN macro in sys/param.h on OS X which causes the formula not to compile
|
|
|
|
# Reported upstream:
|
|
|
|
# https://groups.google.com/forum/?fromgroups=#!topic/libnfc-devel/K0cwIdPuqJg
|
2013-03-05 23:06:56 +00:00
|
|
|
# Another patch adds support for USB CDC / ACM type serial ports (tty.usbmodem)
|
2014-03-19 17:07:55 +00:00
|
|
|
patch :DATA
|
2011-07-18 20:02:11 +00:00
|
|
|
|
2011-05-28 00:52:46 +00:00
|
|
|
def install
|
2013-03-05 23:06:56 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
2014-04-13 18:33:47 +00:00
|
|
|
"--prefix=#{prefix}", "--enable-serial-autoprobe"
|
2011-05-28 00:52:46 +00:00
|
|
|
system "make install"
|
2013-03-05 23:06:56 +00:00
|
|
|
(prefix/'etc/nfc/libnfc.conf').write "allow_intrusive_scan=yes"
|
2011-05-28 00:52:46 +00:00
|
|
|
end
|
|
|
|
end
|
2012-12-26 18:03:21 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/libnfc/nfc-internal.h b/libnfc/nfc-internal.h
|
|
|
|
index ec9e2fc..41797b2 100644
|
|
|
|
--- a/libnfc/nfc-internal.h
|
|
|
|
+++ b/libnfc/nfc-internal.h
|
|
|
|
@@ -33,6 +33,15 @@
|
|
|
|
|
|
|
|
#include "log.h"
|
|
|
|
|
|
|
|
+// Patch to compile on OS X
|
|
|
|
+// Tested on OS X Mountain Lion
|
|
|
|
+#ifndef MAX
|
|
|
|
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
|
|
|
+#endif
|
|
|
|
+#ifndef MIN
|
|
|
|
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* @macro HAL
|
|
|
|
* @brief Execute corresponding driver function if exists.
|
2013-07-17 22:25:18 +00:00
|
|
|
diff --git a/libnfc/buses/uart.c b/libnfc/buses/uart.c
|
2013-03-05 23:06:56 +00:00
|
|
|
index 7b687c1..686f9ed 100644
|
2013-07-17 22:25:18 +00:00
|
|
|
--- a/libnfc/buses/uart.c
|
|
|
|
+++ b/libnfc/buses/uart.c
|
2013-03-05 23:06:56 +00:00
|
|
|
@@ -46,7 +46,7 @@
|
|
|
|
#define LOG_CATEGORY "libnfc.bus.uart"
|
|
|
|
|
|
|
|
# if defined(__APPLE__)
|
|
|
|
-const char *serial_ports_device_radix[] = { "tty.SLAB_USBtoUART", "tty.usbserial-", NULL };
|
2014-04-13 18:33:47 +00:00
|
|
|
+const char *serial_ports_device_radix[] = { "tty.SLAB_USBtoUART", "tty.usbserial-", "tty.usbmodem", "tty.usbserial", NULL };
|
2013-03-05 23:06:56 +00:00
|
|
|
# elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
|
|
|
const char *serial_ports_device_radix[] = { "cuaU", "cuau", NULL };
|
|
|
|
# elif defined (__linux__)
|