Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COPYING
ChangeLog
Manifest.txt
README
Rakefile
ext/usb/constants.h
ext/usb/extconf.rb
ext/usb/usb.c
lib/usb.rb
sample/usb-power
14 changes: 11 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ LGPL

== Install

% ruby extconf.rb
% make
% make install
% gem install usb

== Packaging

% rake package

== Releasing to rubygems.org

Make sure to `gem install hoe-git` first.

% rake release VERSION=0.3.0

== Reference Manual

Expand Down
29 changes: 29 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- ruby -*-

require 'rubygems'
require 'hoe'
gem 'rake-compiler', '>= 0.4.1'
require "rake/extensiontask"

Hoe.plugin :git # gem install hoe-git

Hoe.spec 'usb' do
developer 'Tanaka Akira', '[email protected]'

self.history_file = 'ChangeLog'
self.readme_file = 'README'
self.testlib = :minitest

extra_dev_deps << ['rake-compiler', '>= 0.4.1']

self.spec_extras = {
:extensions => ["ext/usb/extconf.rb"],
:homepage => 'http://www.a-k-r.org/ruby-usb/'
}

Rake::ExtensionTask.new "usb", spec do |ext|
ext.lib_dir = File.join(*['lib', ENV['FAT_DIR']].compact)
end
end

task :test => :compile
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions ext/usb/mkmf.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
have_library: checking for usb_init() in -lusb... -------------------- no

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lusb -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘usb_init’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘usb_init’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/folders/yv/c2r06v597n5bdpw_bf8qcmb80000gp/T//ccoOdXex.out
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))usb_init; return 0; }
/* end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lusb -lpthread -ldl "
ld: warning: ignoring file /usr/local/lib/libusb.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_usb_init", referenced from:
_t in cc1jogpT.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/yv/c2r06v597n5bdpw_bf8qcmb80000gp/T//cck9xeTb.out (No such file or directory)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { usb_init(); return 0; }
/* end */

--------------------

have_header: checking for ruby/st.h... -------------------- yes

"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <ruby/st.h>
/* end */

--------------------

File renamed without changes.
2 changes: 2 additions & 0 deletions lib/usb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
#

module USB
VERSION = '0.3.0'

def USB.busses
result = []
bus = USB.first_bus
Expand Down