libspotify 12.1.51.3-arm-linux → 12.1.51.4-arm-linux

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: b5312613800c9ce36bc43aa715f77e94a878e22e
4
- data.tar.gz: d8092ae425f00c1abae61848424f45aeabe1d63b
3
+ metadata.gz: 45853f9eb4e33324e3fe26706a186bbe5c73a784
4
+ data.tar.gz: f88e40c41be4dc5508b00e43290dcc9a6fe19892
5
5
  SHA512:
6
- metadata.gz: d1787223865dcfd41f8d400d20e8de8f3913645eac29d15657a58e006d00a3e75db24fe90cd807985d5159b3eb7dcf7e3d9f1a234f91d648983e595c49a030a9
7
- data.tar.gz: ad134d910f242848fa0f33b31208a9377d9427fd4582b475231e4be0489f36684e3fa4170153ab625e7d907fdd7dff9daa0ebf37947aff4a63a6bc7795d4f500
6
+ metadata.gz: 59dab059ab508d62681f25ce25f9ac06e153c2ec40759a5d1a32b30220e4386b7ade61b508aa440a691176f81ca5980f551863b13ebc74fc3574d40ba4eef4bc
7
+ data.tar.gz: 605eeda09917bfb8b77eda1e4bba43191c2e542046f83ea8d10bfc201af506df41e5d5c96aa9853536b2540f87fc43b01e96a9fa0b541389208040cbc0ba4d8c
data/Rakefile CHANGED
@@ -11,27 +11,22 @@ task :build do
11
11
  # We want the right binary location.
12
12
  require_relative "lib/libspotify"
13
13
 
14
- # Maps platform to libspotify binary name.
15
- platforms =
16
- {
17
- "universal-darwin" => %w"universal-darwin",
18
- "i686-linux" => %w"i686-linux",
19
- "x86_64-linux" => %w"x86_64-linux",
20
- "arm-linux" => %w"armv5-linux",
21
- "universal-java" => %w"universal-darwin i686-linux x86_64-linux armv5-linux",
22
- Gem::Platform::RUBY => [], # fallback platform
23
- }
14
+ platforms = Libspotify::PLATFORMS.dup
15
+ platforms[Gem::Platform::RUBY] = [] # fallback platform
16
+ platforms["universal-java"] = platforms.values.flatten.uniq
24
17
 
25
18
  # Maps binaries to system path.
26
19
  binaries =
27
20
  {
28
- "universal-darwin" => "libspotify-12.1.51-Darwin-universal/libspotify.framework/Versions/Current/libspotify",
29
- "i686-linux" => "libspotify-12.1.51-Linux-i686-release/lib/libspotify.so",
21
+ "universal-darwin" => "libspotify-12.1.51-Darwin-universal/libspotify-12.1.51-Darwin-universal/libspotify.framework/Versions/Current/libspotify",
22
+ "x86-linux" => "libspotify-12.1.51-Linux-i686-release/lib/libspotify.so",
30
23
  "x86_64-linux" => "libspotify-12.1.51-Linux-x86_64-release/lib/libspotify.so",
31
24
  "armv5-linux" => "libspotify-12.1.51-Linux-armv5-release/lib/libspotify.so",
25
+ "armv6hf-linux" => "libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release/lib/libspotify.so",
32
26
  # armv5 works on both armv6 and armv7, so we always use armv5.
33
- # "armv6-linux" => "libspotify-12.1.51-Linux-armv6-release/lib/libspotify.so",
34
- # "armv7-linux" => "libspotify-12.1.51-Linux-armv7-release/lib/libspotify.so",
27
+ "armv6-linux" => "libspotify-12.1.51-Linux-armv6-release/lib/libspotify.so",
28
+ "armv7-linux" => "libspotify-12.1.51-Linux-armv7-release/lib/libspotify.so",
29
+ "x86-windows.dll" => "libspotify-12.1.51-win32-release/lib/libspotify.dll",
35
30
  }
36
31
 
37
32
  # Load our gem specification.
@@ -55,7 +50,7 @@ task :build do
55
50
  MSG
56
51
  else
57
52
  source_binaries.each do |binary|
58
- src_name = "bin/#{binaries[binary]}"
53
+ src_name = "bin/#{binaries.fetch(binary)}"
59
54
  dest_name = "bin/#{binary}"
60
55
  FileUtils.cp(src_name, dest_name, verbose: true)
61
56
  spec.files << dest_name
@@ -79,6 +74,42 @@ task :build do
79
74
  puts "Do not forget to tag and push to GitHub as well."
80
75
  end
81
76
 
77
+ desc "Download all known libspotify releases and unpack them"
78
+ task :download do
79
+ urls = %w[
80
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.64-iOS-universal.zip
81
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Android-arm-release.tar.gz
82
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-win32-release.zip
83
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Darwin-universal.zip
84
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Linux-i686-release.tar.gz
85
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Linux-x86_64-release.tar.gz
86
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Linux-armv5-release.tar.gz
87
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Linux-armv6-release.tar.gz
88
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Linux-armv7-release.tar.gz
89
+ https://developer.spotify.com/download/libspotify/libspotify-12.1.103-Linux-armv6-bcm2708hardfp-release.tar.gz
90
+ ]
91
+
92
+ Dir.chdir "bin" do
93
+ urls.map do |url|
94
+ Thread.new do
95
+ unless File.exist?(File.basename(url))
96
+ sh "curl", "-O", "-s", url
97
+ else
98
+ puts "Skipping #{url}."
99
+ end
100
+ end
101
+ end.map(&:join)
102
+
103
+ Dir["./*.zip"].each do |zipfile|
104
+ sh "unzip", zipfile, "-d", File.basename(zipfile, ".zip")
105
+ end
106
+
107
+ Dir["./*.tar.gz"].each do |tarfile|
108
+ sh "tar", "xvfz", tarfile
109
+ end
110
+ end
111
+ end
112
+
82
113
  desc "Launch an IRB console with the gem loaded."
83
114
  task :console do
84
115
  exec "irb -Ilib -rlibspotify"
data/lib/libspotify.rb CHANGED
@@ -1,40 +1,96 @@
1
1
  module Libspotify
2
2
  VERSION = "12.1.51"
3
- GEM_VERSION = "#{VERSION}.3"
3
+ GEM_VERSION = "#{VERSION}.4"
4
4
 
5
- module_function
5
+ # Maps platform to libspotify binary name.
6
+ PLATFORMS = {
7
+ "universal-darwin" => %w"universal-darwin",
8
+ "x86-linux" => %w"x86-linux",
9
+ "x86_64-linux" => %w"x86_64-linux",
10
+ "arm-linux" => %w"armv6-linux armv6hf-linux",
11
+ "x86-mingw32" => %w"x86-windows.dll",
12
+ }
6
13
 
7
- # @return [String] full path to libspotify binary.
8
- def binary_path
9
- File.expand_path("../bin/#{release_name}", File.dirname(__FILE__))
10
- end
14
+ class << self
15
+ # @return [String] full path to libspotify binary.
16
+ def binary_path
17
+ File.expand_path("../bin/#{release_name}", File.dirname(__FILE__))
18
+ end
19
+
20
+ # @return [String] name of libspotify binary.
21
+ def release_name
22
+ host_platform = Gem::Platform.new(host_string)
23
+
24
+ _, binaries = PLATFORMS.find do |platform, _|
25
+ Gem::Platform.new(platform) === host_platform
26
+ end
27
+
28
+ binaries ||= []
29
+
30
+ binary = if binaries.length == 1
31
+ binaries[0]
32
+ elsif host_cpu =~ /armv(\d+)(hf)?/
33
+ host_version = $1.to_i
34
+ host_hf = $2
35
+
36
+ matches = PLATFORMS["arm-linux"].select do |bin|
37
+ version, hf = bin.match(/armv(\d+)(hf)?/)[1..2]
38
+ hf == host_hf && version.to_i <= host_version
39
+ end
40
+
41
+ matches.max_by { |bin| bin[/armv(\d+)/, 1].to_i }
42
+ else
43
+ nil # no rules for matching binaries, what to do?
44
+ end
45
+
46
+ binary || host_string
47
+ end
48
+
49
+ private
50
+
51
+ # @return [String] platform name of the host, even on jruby
52
+ def host_string
53
+ "#{host_cpu}-#{host_os}"
54
+ end
11
55
 
12
- # @api private
13
- # @return [String] name of libspotify binary.
14
- def release_name
15
- case RbConfig::CONFIG["host_os"]
16
- when /darwin/
17
- "universal-darwin"
18
- when /linux/
56
+ # @return [String] host cpu, even on jruby
57
+ def host_cpu
19
58
  case RbConfig::CONFIG["host_cpu"]
20
59
  when /86_64/
21
- "x86_64-linux"
60
+ "x86_64"
22
61
  when /86/
23
- "i686-linux"
24
- when /armv(\d+)?/
25
- v = $1
62
+ "x86"
63
+ when /arm/
26
64
  hf = "hf" if hard_float?
27
- "armv5#{hf}-linux"
65
+ "armv#{arm_version}#{hf}"
66
+ else
67
+ RbConfig::CONFIG["host_cpu"]
28
68
  end
29
- else
30
- "unknown-%s-%s" % RbConfig::CONFIG.values_at("host_cpu", "host_os")
31
69
  end
32
- end
33
70
 
34
- # @api private
35
- # @return [Boolean] true if on a hard floating point OS of arm
36
- def hard_float?
37
- `readelf -a #{RbConfig.ruby}`.match(/Tag_ABI_VFP_args/)
71
+ # @return [String] host os, even on jruby
72
+ def host_os
73
+ case RbConfig::CONFIG["host_os"]
74
+ when /darwin/
75
+ "darwin"
76
+ when /linux/
77
+ "linux"
78
+ when /mingw|mswin/
79
+ "mingw32"
80
+ else
81
+ RbConfig::CONFIG["host_os"]
82
+ end
83
+ end
84
+
85
+ # @return [Integer, nil] ARM instruction set version
86
+ def arm_version
87
+ File.read("/proc/cpuinfo")[/ARMv(\d+)/i, 1].to_i
88
+ end
89
+
90
+ # @return [Boolean] true if on a hard floating point OS of arm
91
+ def hard_float?
92
+ `readelf -a #{RbConfig.ruby}`.match(/Tag_ABI_VFP_args/)
93
+ end
38
94
  end
39
95
  end
40
96
 
data/libspotify.gemspec CHANGED
@@ -6,7 +6,13 @@ Gem::Specification.new do |gem|
6
6
  gem.authors = ["Kim Burgestrand"]
7
7
  gem.email = ["kim@burgestrand.se"]
8
8
  gem.summary = %q{A binary ruby gem for distribution of libspotify.}
9
- gem.description = gem.summary
9
+
10
+ gem.description = <<-DESCRIPTION
11
+ libspotify is a ruby gem for distribution of libspotify binaries. It allows
12
+ download of libspotify through the rubygems package manager, and provides an
13
+ API for retrieving the binary file path.
14
+ DESCRIPTION
15
+
10
16
  gem.homepage = "https://github.com/Burgestrand/libspotify"
11
17
  gem.require_paths = ["lib"]
12
18
  gem.files = `git ls-files`.split($/)
@@ -14,4 +20,6 @@ Gem::Specification.new do |gem|
14
20
 
15
21
  gem.version = Libspotify::GEM_VERSION
16
22
  gem.platform = Gem::Platform::RUBY
23
+ gem.add_development_dependency "rspec", "~> 2.0"
24
+ gem.add_development_dependency "rake", "~> 10.0"
17
25
  end
@@ -18,26 +18,33 @@ describe Libspotify do
18
18
  end
19
19
 
20
20
  specify "linux-gnu:i686" do
21
- release_name.should eq "i686-linux"
21
+ release_name.should eq "x86-linux"
22
22
  end
23
23
 
24
24
  specify "linux-gnu:x86_64" do
25
25
  release_name.should eq "x86_64-linux"
26
26
  end
27
27
 
28
+ specify "mingw32:i686" do
29
+ release_name.should eq "x86-windows.dll"
30
+ end
31
+
28
32
  context "soft float" do
29
33
  before { Libspotify.stub(hard_float?: false) }
30
34
 
31
35
  specify "linux-gnueabi:armv5l" do
36
+ Libspotify.stub(arm_version: 5)
32
37
  release_name.should eq "armv5-linux"
33
38
  end
34
39
 
35
40
  specify "linux-gnueabi:armv6l" do
36
- release_name.should eq "armv5-linux"
41
+ Libspotify.stub(arm_version: 6)
42
+ release_name.should eq "armv6-linux"
37
43
  end
38
44
 
39
45
  specify "linux-gnueabi:armv7l" do
40
- release_name.should eq "armv5-linux"
46
+ Libspotify.stub(arm_version: 7)
47
+ release_name.should eq "armv6-linux"
41
48
  end
42
49
  end
43
50
 
@@ -45,20 +52,27 @@ describe Libspotify do
45
52
  before { Libspotify.stub(hard_float?: true) }
46
53
 
47
54
  specify "linux-gnueabi:armv5l" do
55
+ Libspotify.stub(arm_version: 5)
48
56
  release_name.should eq "armv5hf-linux"
49
57
  end
50
58
 
51
59
  specify "linux-gnueabi:armv6l" do
52
- release_name.should eq "armv5hf-linux"
60
+ Libspotify.stub(arm_version: 6)
61
+ release_name.should eq "armv6hf-linux"
53
62
  end
54
63
 
55
64
  specify "linux-gnueabi:armv7l" do
56
- release_name.should eq "armv5hf-linux"
65
+ Libspotify.stub(arm_version: 7)
66
+ release_name.should eq "armv6hf-linux"
57
67
  end
58
68
  end
59
69
 
70
+ specify "linux:weird-cpu" do
71
+ release_name.should eq "weird-cpu-linux"
72
+ end
73
+
60
74
  specify "weird-os:weird-cpu" do
61
- release_name.should eq "unknown-weird-cpu-weird-os"
75
+ release_name.should eq "weird-cpu-weird-os"
62
76
  end
63
77
  end
64
78
 
@@ -67,7 +81,7 @@ describe Libspotify do
67
81
  end
68
82
 
69
83
  specify "GEM_VERSION" do
70
- Libspotify::GEM_VERSION.should eq "12.1.51.2"
84
+ Libspotify::GEM_VERSION.should match(/\A#{Regexp.quote(Libspotify::VERSION)}/)
71
85
  end
72
86
 
73
87
  specify "VERSION" do
metadata CHANGED
@@ -1,32 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libspotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.51.3
4
+ version: 12.1.51.4
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Kim Burgestrand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-07 00:00:00.000000000 Z
12
- dependencies: []
13
- description: A binary ruby gem for distribution of libspotify.
11
+ date: 2014-05-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: |
42
+ libspotify is a ruby gem for distribution of libspotify binaries. It allows
43
+ download of libspotify through the rubygems package manager, and provides an
44
+ API for retrieving the binary file path.
14
45
  email:
15
46
  - kim@burgestrand.se
16
47
  executables: []
17
48
  extensions: []
18
49
  extra_rdoc_files: []
19
50
  files:
20
- - .gitignore
21
- - .rspec
51
+ - ".gitignore"
52
+ - ".rspec"
22
53
  - Gemfile
23
54
  - README.md
24
55
  - Rakefile
25
56
  - bin/.gitkeep
57
+ - bin/armv6-linux
58
+ - bin/armv6hf-linux
26
59
  - lib/libspotify.rb
27
60
  - libspotify.gemspec
28
61
  - spec/libspotify_spec.rb
29
- - bin/armv5-linux
30
62
  homepage: https://github.com/Burgestrand/libspotify
31
63
  licenses:
32
64
  - MIT
@@ -37,17 +69,17 @@ require_paths:
37
69
  - lib
38
70
  required_ruby_version: !ruby/object:Gem::Requirement
39
71
  requirements:
40
- - - '>='
72
+ - - ">="
41
73
  - !ruby/object:Gem::Version
42
74
  version: '0'
43
75
  required_rubygems_version: !ruby/object:Gem::Requirement
44
76
  requirements:
45
- - - '>='
77
+ - - ">="
46
78
  - !ruby/object:Gem::Version
47
79
  version: '0'
48
80
  requirements: []
49
81
  rubyforge_project:
50
- rubygems_version: 2.0.3
82
+ rubygems_version: 2.2.2
51
83
  signing_key:
52
84
  specification_version: 4
53
85
  summary: A binary ruby gem for distribution of libspotify.