libusb 0.3.1-x86-mingw32 → 0.3.2-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.md +6 -0
- data/Rakefile +2 -1
- data/lib/libusb/call.rb +6 -3
- data/lib/libusb/version_gem.rb +1 -1
- metadata +3 -5
- data/ext/extconf.rb +0 -33
data/History.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
0.3.2 / 2013-02-16
|
2
|
+
------------------
|
3
|
+
* Don't enforces DevKit installation on Windows.
|
4
|
+
* Fix error check on libusb_get_device_list(). Thanks to Paul Kunysch for the bug report.
|
5
|
+
* Add support for Cygwin. Requires ffi-1.4.0.
|
6
|
+
|
1
7
|
0.3.1 / 2013-01-22
|
2
8
|
------------------
|
3
9
|
* Fix loading of compiled libusb library on OSX
|
data/Rakefile
CHANGED
@@ -132,7 +132,8 @@ task :cross => [ :mingw32, :libusb_dll ] do |t|
|
|
132
132
|
spec.instance_variable_set(:"@cache_file", nil) if spec.respond_to?(:cache_file)
|
133
133
|
spec.platform = Gem::Platform.new('i386-mingw32')
|
134
134
|
spec.files << "lib/#{File.basename(LIBUSB_DLL)}"
|
135
|
-
spec.files -= `git ls-files ext
|
135
|
+
spec.files -= `git ls-files ext`.split("\n")
|
136
|
+
spec.extensions = []
|
136
137
|
|
137
138
|
# Generate a package for this gem
|
138
139
|
Gem::PackageTask.new(spec) do |pkg|
|
data/lib/libusb/call.rb
CHANGED
@@ -23,9 +23,12 @@ module LIBUSB
|
|
23
23
|
module Call
|
24
24
|
extend FFI::Library
|
25
25
|
|
26
|
+
root_path = File.expand_path("../../..", __FILE__)
|
26
27
|
ext = FFI::Platform::LIBSUFFIX
|
27
|
-
|
28
|
-
|
28
|
+
prefix = FFI::Platform::LIBPREFIX.empty? ? 'lib' : FFI::Platform::LIBPREFIX
|
29
|
+
bundled_dll = File.join(root_path, "lib/#{prefix}usb-1.0.#{ext}")
|
30
|
+
bundled_dll_cygwin = File.join(root_path, "bin/#{prefix}usb-1.0.#{ext}")
|
31
|
+
ffi_lib(["#{prefix}usb-1.0", bundled_dll, bundled_dll_cygwin])
|
29
32
|
|
30
33
|
ClassCodes = enum :libusb_class_code, [
|
31
34
|
:CLASS_PER_INTERFACE, 0,
|
@@ -165,7 +168,7 @@ module LIBUSB
|
|
165
168
|
attach_function 'libusb_set_debug', [:pointer, :int], :void
|
166
169
|
try_attach_function 'libusb_has_capability', [:libusb_capability], :int
|
167
170
|
|
168
|
-
attach_function 'libusb_get_device_list', [:pointer, :pointer], :
|
171
|
+
attach_function 'libusb_get_device_list', [:pointer, :pointer], :ssize_t
|
169
172
|
attach_function 'libusb_free_device_list', [:pointer, :int], :void
|
170
173
|
attach_function 'libusb_ref_device', [:pointer], :pointer
|
171
174
|
attach_function 'libusb_unref_device', [:pointer], :void
|
data/lib/libusb/version_gem.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libusb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: x86-mingw32
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -64,8 +64,7 @@ description: LIBUSB is a Ruby binding that gives Ruby programmers access to arbi
|
|
64
64
|
email:
|
65
65
|
- lars@greiz-reinsdorf.de
|
66
66
|
executables: []
|
67
|
-
extensions:
|
68
|
-
- ext/extconf.rb
|
67
|
+
extensions: []
|
69
68
|
extra_rdoc_files: []
|
70
69
|
files:
|
71
70
|
- .gitignore
|
@@ -76,7 +75,6 @@ files:
|
|
76
75
|
- History.md
|
77
76
|
- README.md
|
78
77
|
- Rakefile
|
79
|
-
- ext/extconf.rb
|
80
78
|
- lib/libusb.rb
|
81
79
|
- lib/libusb/call.rb
|
82
80
|
- lib/libusb/compat.rb
|
data/ext/extconf.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'ffi'
|
5
|
-
|
6
|
-
begin
|
7
|
-
module LibTest
|
8
|
-
extend FFI::Library
|
9
|
-
ext = FFI::Platform::LIBSUFFIX
|
10
|
-
bundled_dll = File.expand_path("../../lib/libusb-1.0.#{ext}", __FILE__)
|
11
|
-
ffi_lib(['libusb-1.0', bundled_dll])
|
12
|
-
end
|
13
|
-
rescue LoadError
|
14
|
-
# Unable to load libusb library on this system,
|
15
|
-
# so we build our bundled version:
|
16
|
-
|
17
|
-
libusb_dir = Dir[File.expand_path('../../ext/libusbx-*', __FILE__)].first
|
18
|
-
root_dir = File.expand_path('../..', __FILE__)
|
19
|
-
raise "could not find embedded libusb sources" unless libusb_dir
|
20
|
-
|
21
|
-
old_dir = Dir.pwd
|
22
|
-
Dir.chdir libusb_dir
|
23
|
-
cmd = "./configure --prefix=#{root_dir} && make && make install"
|
24
|
-
puts cmd
|
25
|
-
system cmd
|
26
|
-
raise "libusb build exited with #{$?.exitstatus}" if $?.exitstatus!=0
|
27
|
-
Dir.chdir old_dir
|
28
|
-
end
|
29
|
-
|
30
|
-
File.open("Makefile", "w") do |mf|
|
31
|
-
mf.puts "# Dummy makefile since libusb-1.0 is usable on this system"
|
32
|
-
mf.puts "all install::\n"
|
33
|
-
end
|