diff options
| author | Phil Calvin | 2014-02-08 17:02:12 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2014-02-10 14:42:38 +0000 |
| commit | 25caadf9fa67b166dc8b1d5de0f9cfdb693ab713 (patch) | |
| tree | 88c3c0c2bd0b4219a0e8b1150c8e788a8821bd41 /Library | |
| parent | d2017489d95f6f7d4d2d7d4c2d6505b6c865d461 (diff) | |
| download | homebrew-25caadf9fa67b166dc8b1d5de0f9cfdb693ab713.tar.bz2 | |
b43-fwcutter 018 (new formula)
Extracts Broadcom firmware.
Part of the b43-tools package, this utility analyzes vendor-provided
drivers and extracts the proprietary firmware necessary for the Linux
b43 module to initialize Broadcom wireless chips.
This formula patches b43-fwcutter so that it builds on Mac OS. The
patch adds preprocessor directives to use Apple's xnu headers in favor
of GNU's `byteswap.h` This patch has been reported and accepted
upstream, but has not yet been officially released. See
<https://github.com/mbuesch/b43-tools/pull/1>.
This formula also patches the Makefile to honor Homebrew's
installation and manpage prefixes, since this tool has no configure
script.
Closes #26536.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/b43-fwcutter.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Library/Formula/b43-fwcutter.rb b/Library/Formula/b43-fwcutter.rb new file mode 100644 index 000000000..534e8b875 --- /dev/null +++ b/Library/Formula/b43-fwcutter.rb @@ -0,0 +1,48 @@ +require "formula" + +class B43Fwcutter < Formula + homepage "http://wireless.kernel.org/en/users/Drivers/b43" + url "http://bues.ch/b43/fwcutter/b43-fwcutter-018.tar.bz2" + sha1 "e77ff733ec43d77761330e16480b7ffa16c7c5dd" + + def patches + # Use OSSwapInt16/32 instead of GNU byteswap.h. + # This has been accepted upstream but has not yet been + # officially released. See: + # https://github.com/mbuesch/b43-tools/pull/1 + DATA + end + + def install + inreplace 'Makefile' do |m| + # Don't try to chown root:root on generated files + m.gsub! /install -o 0 -g 0/, 'install' + m.gsub! /install -d -o 0 -g 0/, 'install -d' + # Fix manpage installation directory + m.gsub! "$(PREFIX)/man", man + end + # b43-fwcutter has no ./configure + system "make", "PREFIX=#{prefix}", "install" + end + + test do + system "#{bin}/b43-fwcutter", "--version" + end +end + +__END__ +--- a/fwcutter.h ++++ b/fwcutter.h +@@ -22,2 +22,5 @@ + #define bswap_32bswap32 ++#elif defined(__APPLE__) ++#define bswap_16 OSSwapInt16 ++#define bswap_32 OSSwapInt32 + #endif +--- a/fwcutter.c ++++ b/fwcutter.c +@@ -42,2 +42,4 @@ + #include <sys/endian.h> ++#elif defined(__APPLE__) ++#include <libkern/OSByteOrder.h> + #else |
