libusb 0.5.0-x64-mingw32 → 0.5.1-x64-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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73cc1af425996963568d9c77e4909d821a825140
4
- data.tar.gz: f68970c05f9bd6cdf91dd1e640afd872a074d00c
3
+ metadata.gz: 7a4bd5976cd03324ad2345ce42c220da84fe9a90
4
+ data.tar.gz: 9412dd0efbf424aed55987eff4e81baf202da6e9
5
5
  SHA512:
6
- metadata.gz: 3b0b81620aac1dcc34065a8f19e86e40ee672676f507c9f87998af9fbbf581c420c8b5748afd202a37b28efbbf00cd80db278ba059a19ac0d30cb643eb366e42
7
- data.tar.gz: 8de2450c4be88e6157990ce53368b38897b2333fde913f7c60024a600143df29b1c318083c67ffc815f92d7c6b94c957d209050c681acc93667f2556d69e77ff
6
+ metadata.gz: c7fb7068c318e2a034882fe7f54bad93c203960974c65c790f7e522cb7d7dcc842b60ad94e465f7c2453d5cc784d22b0b547eefa1b1f7c23d7a491133e04019f
7
+ data.tar.gz: dbd3595551464323fb62366fb61994177e992a846fb022ee3f02fbe060fc81fd7926845bd16baeb140f9dbc07ac99244b9dee2d07b4f7b11f6d47580fffb84a2
@@ -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
 
@@ -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'
@@ -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
@@ -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: x64-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
@@ -1,3 +0,0 @@
1
- O��F�QВ�������Gޯ��K����ڇ��l�/+�՞+q\"bZ3��9��d_)�BO���6���/�K�;e�����⧇SJv&jL�<�^b���N�=чf{�������u,�.!m�Jee���K6�?H��C��%
2
- �@��¿O��0,��≪ֵ��Md��F�K5��jd2�WP��+�����s�x������qx��Z�V%*�U��W�G�,SQC۲]m,.z�a�
3
- ���
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- j����z��(f��G�W�A&F�:?$�v�R����}��1�B�>&v��G,�~s-Z�F)��i,�����6�"NI�P@����
2
- {��~�(�������N�h�g � ���PpD����� ���;s�����/�������q��`���e�׌��ZT��yK�l�T�gN�
metadata.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- s`���4�a}*&|�
2
- Q_��١e���P����N4��⏉��S7x�9�^˷�r��q,�\�V�#�Xh��!o�{�0��<��V�۠����ދ^ӐV�x�i���x;cMy\���8c;�Xܫ(�*��8�� ����P���qUdr{w[B�(�8B��Sm�
3
- ���0R���1� �̜��x���'E�ji��H�����5���P��t�a4{, �c*��ߎ�|�)�]��