libspotify 12.1.51.3-universal-darwin → 12.1.51.4-universal-darwin

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: 2a24c521cee19a90b1bd295cfad102393da8ca99
4
- data.tar.gz: 993047cc1a9552f1d5cc576a5663803717df7b11
3
+ metadata.gz: 77ef3ff01c1f22df9fb435550a67b6fd3ddf76bb
4
+ data.tar.gz: 6fcd9f1ba722abb04fb6b7b9ca4fa1fda97411bf
5
5
  SHA512:
6
- metadata.gz: 09e057fe497e8dec426e88281a55223d2b70fed3c9cdb8b15a5ce15cf4fd80a40cfd3dbc0478f0d5c211a963779b7e6d55951e3f77e4686490a627b96f0d6888
7
- data.tar.gz: cfdd805141e4858aabe956f7bec7b3259cd5d200ed4d96bc9c23af7c9fc160cb741d3f969cbeb7e90d8a6d610b90a86198ee1720cd44914161796b8570a06135
6
+ metadata.gz: 39d74da6741ac9abb7e82810dd049d11bf7548416d5514c3bc6bfa66ec55b9eb960651090b8fe3f5d36850c55163766d8a583f7a2b21176addd89d16a20e81d6
7
+ data.tar.gz: 8cfd475d8cbc2d5c398e45fd5f55861672ad5e80702ff9fcdb3ad5c1cce898b6a45991031d72ed18e6e0a25d31e48816382e3e879c9ea931d6e6f55541c3ecd5
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,63 @@
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: universal-darwin
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/universal-darwin
26
58
  - lib/libspotify.rb
27
59
  - libspotify.gemspec
28
60
  - spec/libspotify_spec.rb
29
- - bin/universal-darwin
30
61
  homepage: https://github.com/Burgestrand/libspotify
31
62
  licenses:
32
63
  - MIT
@@ -37,17 +68,17 @@ require_paths:
37
68
  - lib
38
69
  required_ruby_version: !ruby/object:Gem::Requirement
39
70
  requirements:
40
- - - '>='
71
+ - - ">="
41
72
  - !ruby/object:Gem::Version
42
73
  version: '0'
43
74
  required_rubygems_version: !ruby/object:Gem::Requirement
44
75
  requirements:
45
- - - '>='
76
+ - - ">="
46
77
  - !ruby/object:Gem::Version
47
78
  version: '0'
48
79
  requirements: []
49
80
  rubyforge_project:
50
- rubygems_version: 2.0.3
81
+ rubygems_version: 2.2.2
51
82
  signing_key:
52
83
  specification_version: 4
53
84
  summary: A binary ruby gem for distribution of libspotify.