aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorHugo Vincent2013-03-05 23:06:56 +0000
committerAdam Vandenberg2013-05-01 21:09:15 -0700
commit53ac99a6196fab8a35c267e73286adbf03a06b7a (patch)
tree29875804450592103a1f5509bff0beb913aa3662 /Library/Formula
parent0be75662df5293d17f4a13d2206670e9344c730d (diff)
downloadhomebrew-53ac99a6196fab8a35c267e73286adbf03a06b7a.tar.bz2
libnfc 1.7.0-rc6
Update libnfc to latest, add config file (generated by brew, in prefix) and add a patch to support PN532-based NFC devices with USB CDC/ACM interfaces, such as the OpenPCD2 http://www.openbeacon.org/OpenPCD_2_RFID_Reader_for_13.56MHz Closes #18272. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/libnfc.rb35
1 files changed, 19 insertions, 16 deletions
diff --git a/Library/Formula/libnfc.rb b/Library/Formula/libnfc.rb
index 5b846410b..a406731d5 100644
--- a/Library/Formula/libnfc.rb
+++ b/Library/Formula/libnfc.rb
@@ -2,10 +2,8 @@ require 'formula'
class Libnfc < Formula
homepage 'http://www.libnfc.org/'
- url 'http://libnfc.googlecode.com/files/libnfc-1.7.0-rc1.tar.gz'
- sha1 'b8660604c950c50c12d68025672bf553e50f111d'
-
- option 'with-pn532_uart', 'Enable PN532 UART support'
+ url 'http://libnfc.googlecode.com/files/libnfc-1.7.0-rc6.tar.gz'
+ sha1 'c4ff27dd126fad013297ea035a5f5a1fb02d8f33'
depends_on 'pkg-config' => :build
depends_on 'libusb-compat'
@@ -13,24 +11,16 @@ class Libnfc < Formula
# 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
+ # Another patch adds support for USB CDC / ACM type serial ports (tty.usbmodem)
def patches
DATA
end
def install
- args = %W[
- --disable-debug
- --disable-dependency-tracking
- --prefix=#{prefix}
- ]
-
- if build.include? 'with-pn532_uart'
- args << "--enable-serial-autoprobe"
- args << "--with-drivers=pn532_uart"
- end
-
- system "./configure", *args
+ system "./configure", "--disable-debug", "--disable-dependency-tracking",
+ "--prefix=#{prefix}"
system "make install"
+ (prefix/'etc/nfc/libnfc.conf').write "allow_intrusive_scan=yes"
end
end
@@ -55,3 +45,16 @@ index ec9e2fc..41797b2 100644
/**
* @macro HAL
* @brief Execute corresponding driver function if exists.
+diff --git a/libnfc/buses/uart_posix.c b/libnfc/buses/uart_posix.c
+index 7b687c1..686f9ed 100644
+--- a/libnfc/buses/uart_posix.c
++++ b/libnfc/buses/uart_posix.c
+@@ -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 };
++const char *serial_ports_device_radix[] = { "tty.SLAB_USBtoUART", "tty.usbserial-", "tty.usbmodem", NULL };
+ # elif defined (__FreeBSD__) || defined (__OpenBSD__)
+ const char *serial_ports_device_radix[] = { "cuaU", "cuau", NULL };
+ # elif defined (__linux__)