libusb 0.5.0-x86-mingw32 → 0.5.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4f2652517795475456e7dfc2dd56e54e6607896
4
- data.tar.gz: 480f3a4f75a3695e9bde564a53bab6494637f41c
3
+ metadata.gz: ed7df63472832064810b9afba746070735f37b18
4
+ data.tar.gz: 8c7699ac1d4663a9de6574fa3c39bed4572edacf
5
5
  SHA512:
6
- metadata.gz: 5c0ae00ef71e1b7d4b70f9c8af804770cc861fe1b06a338e3feb1d5a7eef59588c111bb52d281c21db33c1343fc54c24521644c5a2e68013edd1ba22b358cdd4
7
- data.tar.gz: e272ea1f14b4c19f54be05b97e0b4a02f7d72bb602558b4e9c9b4d3fe8ae7de48a2e20676abd123be730058c43a2fe2f0e40cb0d5910851d2400db876ebc237c
6
+ metadata.gz: 5954178199020f79b67f52a2526c470c454d67216204b2e64c7424c833940b4e4f4ab32a9b26c834e67759d6b049e834d33e66ca60b17e2b880f90f5495be621
7
+ data.tar.gz: f94ca69ed5f18200d07084f38c8affc110a27bd318fc8d2f7725c1c26f870ef5b6ad900c1ba0ba49a6b8ef3f8ecfc3238b6c35b74181c62989486eacc90225d9
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  rvm:
3
4
  - "1.8.7"
4
5
  - "1.9.3"
data/History.md CHANGED
@@ -1,3 +1,11 @@
1
+ 0.5.1 / 2015-09-29
2
+ ------------------
3
+ * Add ability to force use of the system or builtin libusb-1.0 library.
4
+ Use: gem install libusb -- --enable-system-libusb / --disable-system-libusb
5
+ * Update to libusb-1.0.20.
6
+ * Build Windows binary gems per rake-compiler-dock.
7
+ * Fix memory leak in Context#pollfds and use libusb_free_pollfds() if available.
8
+
1
9
  0.5.0 / 2015-01-08
2
10
  ------------------
3
11
  * Add support for BOS describtors of libusb-1.0.16
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- -*- coding: utf-8 -*- -->
2
2
 
3
- [![Build Status](https://travis-ci.org/larskanis/libusb.png?branch=debug_travis)](https://travis-ci.org/larskanis/libusb)
3
+ [![Build Status](https://travis-ci.org/larskanis/libusb.svg)](https://travis-ci.org/larskanis/libusb)
4
4
 
5
5
  Access USB devices from Ruby
6
6
  ============================
@@ -89,6 +89,7 @@ If none could be found, a bundled libusb version is built and used, instead.
89
89
  Latest code can be used in this way:
90
90
 
91
91
  $ git clone git://github.com/larskanis/libusb.git
92
+ $ bundle
92
93
  $ rake install_gem
93
94
 
94
95
  Device hotplug support
@@ -117,21 +118,10 @@ systems.
117
118
  Cross compiling for Windows
118
119
  ---------------------------
119
120
 
120
- Libusb-gem can be build on a linux or darwin host for the win32 platform,
121
- using the mingw cross compiler collection. Libusb is downloaded from source
122
- git repo, cross compiled and included in the generated libusb.gem.
121
+ Libusb-gem can be cross built for the win32 platform, using the [rake-compiler-dock](https://github.com/larskanis/rake-compiler-dock) .
122
+ Just run:
123
123
 
124
- Install mingw32. On a debian based system this should work:
125
-
126
- $ apt-get install mingw32
127
-
128
- On MacOS X, if you have MacPorts installed:
129
-
130
- $ port install i386-mingw32-gcc
131
-
132
- Download and cross compile libusb for win32:
133
-
134
- $ rake cross gem
124
+ $ rake gem:windows
135
125
 
136
126
  If everything works, there should be `libusb-VERSION-x86-mingw32.gem` in the pkg
137
127
  directory.
data/Rakefile CHANGED
@@ -7,25 +7,32 @@ require 'pathname'
7
7
  require 'uri'
8
8
  require 'ostruct'
9
9
  require 'rake/clean'
10
+ require 'rake_compiler_dock'
10
11
 
11
12
  task :gem => :build
12
13
  task :compile do
13
14
  sh "ruby ext/extconf.rb"
14
15
  end
16
+
15
17
  task :test=>:compile do
16
18
  sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
17
19
  end
20
+
18
21
  travis_tests = %w[test_libusb_capability.rb test_libusb_structs.rb test_libusb_version.rb]
19
22
  task :travis=>:compile do
20
23
  sh "ruby -w -W2 -I. -Ilib -e \"#{travis_tests.map{|f| "require 'test/#{f}';"}.join}\" -- -v"
21
24
  end
22
25
  task :default => :test
23
26
 
27
+ task 'gem:windows' do
28
+ RakeCompilerDock.sh "bundle && rake cross gem"
29
+ end
30
+
24
31
  COMPILE_HOME = Pathname( "./tmp" ).expand_path
25
32
  STATIC_SOURCESDIR = COMPILE_HOME + 'sources'
26
33
 
27
34
  # Fetch tarball from sourceforge
28
- LIBUSB_VERSION = ENV['LIBUSB_VERSION'] || '1.0.19'
35
+ LIBUSB_VERSION = ENV['LIBUSB_VERSION'] || '1.0.20'
29
36
  LIBUSB_SOURCE_URI = URI( "http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-#{LIBUSB_VERSION}/libusb-#{LIBUSB_VERSION}.tar.bz2" )
30
37
  LIBUSB_TARBALL = STATIC_SOURCESDIR + File.basename( LIBUSB_SOURCE_URI.path )
31
38
 
data/lib/libusb.rb CHANGED
@@ -26,6 +26,7 @@ module LIBUSB
26
26
  autoload :Interface, 'libusb/interface'
27
27
  autoload :Setting, 'libusb/setting'
28
28
  autoload :SsCompanion, 'libusb/ss_companion'
29
+ autoload :Stdio, 'libusb/stdio'
29
30
  autoload :Bos, 'libusb/bos'
30
31
  %w[ Transfer BulkTransfer BulkStreamTransfer ControlTransfer InterruptTransfer IsoPacket IsochronousTransfer ].each do |klass|
31
32
  autoload klass, 'libusb/transfer'
data/lib/libusb/call.rb CHANGED
@@ -342,6 +342,7 @@ module LIBUSB
342
342
  attach_function 'libusb_get_pollfds', [:libusb_context], :pointer
343
343
  attach_function 'libusb_get_next_timeout', [:libusb_context, :pointer], :int
344
344
  attach_function 'libusb_set_pollfd_notifiers', [:libusb_context, :libusb_pollfd_added_cb, :libusb_pollfd_removed_cb, :pointer], :void
345
+ try_attach_function 'libusb_free_pollfds', [:pointer], :void
345
346
 
346
347
  callback :libusb_transfer_cb_fn, [:pointer], :void
347
348
 
@@ -260,8 +260,11 @@ module LIBUSB
260
260
  pollfds << Pollfd.new(pollfd[:fd], pollfd[:events])
261
261
  offs += FFI.type_size :pointer
262
262
  end
263
- # ppPollfds has to be released by free() -> give the GC this job
264
- ppPollfds.autorelease = true
263
+ if Call.respond_to?(:libusb_free_pollfds)
264
+ Call.libusb_free_pollfds(ppPollfds)
265
+ else
266
+ Stdio.free(ppPollfds)
267
+ end
265
268
  pollfds
266
269
  end
267
270
 
@@ -0,0 +1,25 @@
1
+ # This file is part of Libusb for Ruby.
2
+ #
3
+ # Libusb for Ruby is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Lesser General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # Libusb for Ruby is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public License
14
+ # along with Libusb for Ruby. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'rubygems'
17
+ require "ffi"
18
+
19
+ module LIBUSB
20
+ module Stdio
21
+ extend FFI::Library
22
+ ffi_lib FFI::Platform::LIBC
23
+ attach_function :free, [ :pointer ], :void
24
+ end
25
+ end
@@ -15,5 +15,5 @@
15
15
 
16
16
  module LIBUSB
17
17
  # Library version of libusb for Ruby
18
- VERSION = "0.5.0"
18
+ VERSION = "0.5.1"
19
19
  end
data/libusb.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.extensions = ['ext/extconf.rb']
23
23
 
24
24
  s.add_runtime_dependency 'ffi', '>= 1.0'
25
- s.add_development_dependency 'rake-compiler', '>= 0.6'
25
+ s.add_development_dependency 'rake-compiler', '~> 0.9'
26
+ s.add_development_dependency 'rake-compiler-dock', '~> 0.2'
26
27
  s.add_development_dependency 'bundler'
27
28
  end
metadata CHANGED
@@ -1,35 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libusb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Lars Kanis
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDLjCCAhagAwIBAgIBAjANBgkqhkiG9w0BAQUFADA9MQ4wDAYDVQQDDAVrYW5p
14
- czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
15
- Fw0xNDAyMjYwOTMzMDBaFw0xNTAyMjYwOTMzMDBaMD0xDjAMBgNVBAMMBWthbmlz
16
- MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
17
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
18
- HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
19
- 9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
20
- lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
21
- Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
22
- L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
23
- AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUvgTdT7fe
24
- x17ugO3IOsjEJwW7KP4wDQYJKoZIhvcNAQEFBQADggEBAFmIAhRT0awqLQN9e4Uv
25
- ZEk+jUWv4zkb+TWiKFJXlwjPyjGbZY9gVfOwAwMibYOK/t/+57ZzW3d0L12OUwvo
26
- on84NVvYtIr1/iskJFWFkMoIquAFCdi9p68stSPMQK2XcrJJuRot29fJtropsZBa
27
- 2cpaNd/sRYdK4oep2usdKifA1lI0hIkPb3r5nLfwG2lAqBH7WZsUICHcTgR0VEbG
28
- z9Ug5qQp9Uz73xC9YdGvGiuOX53LYobHAR4MWi2xxDlHI+ER8mRz0eY2FUuNu/Wj
29
- GrqF74zpLl7/KFdHC8VmzwZS18hvDjxeLVuVI2gIGnBInqnlqv05g/l4/1pISh5j
30
- dS4=
31
- -----END CERTIFICATE-----
32
- date: 2015-01-08 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2015-09-29 00:00:00.000000000 Z
33
12
  dependencies:
34
13
  - !ruby/object:Gem::Dependency
35
14
  name: ffi
@@ -49,16 +28,30 @@ dependencies:
49
28
  name: rake-compiler
50
29
  requirement: !ruby/object:Gem::Requirement
51
30
  requirements:
52
- - - ">="
31
+ - - "~>"
53
32
  - !ruby/object:Gem::Version
54
- version: '0.6'
33
+ version: '0.9'
55
34
  type: :development
56
35
  prerelease: false
57
36
  version_requirements: !ruby/object:Gem::Requirement
58
37
  requirements:
59
- - - ">="
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.9'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake-compiler-dock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '0.6'
54
+ version: '0.2'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
@@ -104,6 +97,7 @@ files:
104
97
  - lib/libusb/interface.rb
105
98
  - lib/libusb/setting.rb
106
99
  - lib/libusb/ss_companion.rb
100
+ - lib/libusb/stdio.rb
107
101
  - lib/libusb/transfer.rb
108
102
  - lib/libusb/version_gem.rb
109
103
  - lib/libusb/version_struct.rb
@@ -146,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
140
  version: '0'
147
141
  requirements: []
148
142
  rubyforge_project: libusb
149
- rubygems_version: 2.4.5
143
+ rubygems_version: 2.4.8
150
144
  signing_key:
151
145
  specification_version: 4
152
146
  summary: Access USB devices from Ruby via libusb-1.0
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- c�}n�C�� ^flE챐���_o?��-��'U��D^5��'����!j��H�����
2
- d�\Yh�HD_�U�y��g�hX=�R�-��ɘP����!9
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- pn���A�Z㄃��Zd�&x/���q�`�:8��()��/h����E�vغ��eL�^䙄r