libspotify 12.1.51.3-x86-mingw32 → 12.1.51.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +50 -24
- data/lib/libspotify.rb +81 -26
- data/libspotify.gemspec +9 -2
- data/spec/libspotify_spec.rb +20 -6
- metadata +30 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fa437ddd34703a65b9de201d4dd97b365bf100f
|
4
|
+
data.tar.gz: 8e8c1610c71647c999115d4b98cfc8d24fdb3ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d43c34234b2251464552e5b7052978edea59bd4eaf6f91c5bb95802525e6fe1ae8a2b627202d07f409b4a04240ebed292e39cff64c7f5d4e94513760451d5c06
|
7
|
+
data.tar.gz: c1662feeaa26aaaaa6f5e78d855d81c64ed5d5176bc32c1feac3c632086f9c99968d30500ca94298c5288691c0ec0ce5a9f5cdf0e4a22973f72adf37e71ff619
|
data/Rakefile
CHANGED
@@ -11,29 +11,22 @@ task :build do
|
|
11
11
|
# We want the right binary location.
|
12
12
|
require_relative "lib/libspotify"
|
13
13
|
|
14
|
-
|
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
|
-
"x86-mingw32" => %w"windows.dll",
|
22
|
-
"universal-java" => %w"universal-darwin i686-linux x86_64-linux armv5-linux",
|
23
|
-
Gem::Platform::RUBY => [], # fallback platform
|
24
|
-
}
|
14
|
+
platforms = Libspotify::PLATFORMS.dup
|
15
|
+
platforms[Gem::Platform::RUBY] = [] # fallback platform
|
16
|
+
platforms["universal-java"] = platforms.values.flatten.uniq
|
25
17
|
|
26
18
|
# Maps binaries to system path.
|
27
19
|
binaries =
|
28
20
|
{
|
29
|
-
"universal-darwin" => "
|
30
|
-
"
|
31
|
-
"x86_64-linux" => "
|
32
|
-
"armv5-linux" => "
|
33
|
-
"
|
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",
|
23
|
+
"x86_64-linux" => "libspotify-12.1.51-Linux-x86_64-release/lib/libspotify.so",
|
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",
|
34
26
|
# armv5 works on both armv6 and armv7, so we always use armv5.
|
35
|
-
|
36
|
-
|
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",
|
37
30
|
}
|
38
31
|
|
39
32
|
# Load our gem specification.
|
@@ -55,12 +48,9 @@ task :build do
|
|
55
48
|
If you are on ARM (e.g. Raspberry PI), you might want to install the gem with explicit --platform:
|
56
49
|
$> gem install libspotify --platform arm-linux
|
57
50
|
MSG
|
58
|
-
elsif source_binaries.none? { |binary| File.exists?(binaries[binary]) }
|
59
|
-
puts "Skipping #{platform} build. Binaries missing."
|
60
|
-
next
|
61
51
|
else
|
62
52
|
source_binaries.each do |binary|
|
63
|
-
src_name = binaries
|
53
|
+
src_name = "bin/#{binaries.fetch(binary)}"
|
64
54
|
dest_name = "bin/#{binary}"
|
65
55
|
FileUtils.cp(src_name, dest_name, verbose: true)
|
66
56
|
spec.files << dest_name
|
@@ -72,10 +62,10 @@ task :build do
|
|
72
62
|
File.join(pkgs, File.basename(gemname)).tap do |gempath|
|
73
63
|
FileUtils.mv(gemname, gempath, verbose: true)
|
74
64
|
end
|
75
|
-
end
|
65
|
+
end
|
76
66
|
|
77
67
|
puts
|
78
|
-
puts "
|
68
|
+
puts "All gems successfully built. To publish, do:"
|
79
69
|
gempaths.each do |path|
|
80
70
|
puts " gem push pkg/#{File.basename(path)}"
|
81
71
|
end
|
@@ -84,6 +74,42 @@ task :build do
|
|
84
74
|
puts "Do not forget to tag and push to GitHub as well."
|
85
75
|
end
|
86
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
|
+
|
87
113
|
desc "Launch an IRB console with the gem loaded."
|
88
114
|
task :console do
|
89
115
|
exec "irb -Ilib -rlibspotify"
|
data/lib/libspotify.rb
CHANGED
@@ -1,41 +1,96 @@
|
|
1
1
|
module Libspotify
|
2
2
|
VERSION = "12.1.51"
|
3
|
-
GEM_VERSION = "#{VERSION}.
|
3
|
+
GEM_VERSION = "#{VERSION}.4"
|
4
4
|
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
13
|
-
|
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
|
60
|
+
"x86_64"
|
22
61
|
when /86/
|
23
|
-
"
|
24
|
-
when /
|
62
|
+
"x86"
|
63
|
+
when /arm/
|
25
64
|
hf = "hf" if hard_float?
|
26
|
-
"
|
65
|
+
"armv#{arm_version}#{hf}"
|
66
|
+
else
|
67
|
+
RbConfig::CONFIG["host_cpu"]
|
27
68
|
end
|
28
|
-
when /mingw|mswin/
|
29
|
-
"windows.dll"
|
30
|
-
else
|
31
|
-
"unknown-%s-%s" % RbConfig::CONFIG.values_at("host_cpu", "host_os")
|
32
69
|
end
|
33
|
-
end
|
34
70
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
39
94
|
end
|
40
95
|
end
|
41
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
|
-
|
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,5 +20,6 @@ Gem::Specification.new do |gem|
|
|
14
20
|
|
15
21
|
gem.version = Libspotify::GEM_VERSION
|
16
22
|
gem.platform = Gem::Platform::RUBY
|
17
|
-
gem.add_development_dependency "rspec"
|
23
|
+
gem.add_development_dependency "rspec", "~> 2.0"
|
24
|
+
gem.add_development_dependency "rake", "~> 10.0"
|
18
25
|
end
|
data/spec/libspotify_spec.rb
CHANGED
@@ -18,26 +18,33 @@ describe Libspotify do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
specify "linux-gnu:i686" do
|
21
|
-
release_name.should eq "
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 "
|
75
|
+
release_name.should eq "weird-cpu-weird-os"
|
62
76
|
end
|
63
77
|
end
|
64
78
|
|
metadata
CHANGED
@@ -1,46 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libspotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.1.51.
|
4
|
+
version: 12.1.51.4
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Kim Burgestrand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
|
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.
|
28
45
|
email:
|
29
46
|
- kim@burgestrand.se
|
30
47
|
executables: []
|
31
48
|
extensions: []
|
32
49
|
extra_rdoc_files: []
|
33
50
|
files:
|
34
|
-
- .gitignore
|
35
|
-
- .rspec
|
51
|
+
- ".gitignore"
|
52
|
+
- ".rspec"
|
36
53
|
- Gemfile
|
37
54
|
- README.md
|
38
55
|
- Rakefile
|
39
56
|
- bin/.gitkeep
|
57
|
+
- bin/x86-windows.dll
|
40
58
|
- lib/libspotify.rb
|
41
59
|
- libspotify.gemspec
|
42
60
|
- spec/libspotify_spec.rb
|
43
|
-
- bin/windows.dll
|
44
61
|
homepage: https://github.com/Burgestrand/libspotify
|
45
62
|
licenses:
|
46
63
|
- MIT
|
@@ -51,17 +68,17 @@ require_paths:
|
|
51
68
|
- lib
|
52
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
70
|
requirements:
|
54
|
-
- -
|
71
|
+
- - ">="
|
55
72
|
- !ruby/object:Gem::Version
|
56
73
|
version: '0'
|
57
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
75
|
requirements:
|
59
|
-
- -
|
76
|
+
- - ">="
|
60
77
|
- !ruby/object:Gem::Version
|
61
78
|
version: '0'
|
62
79
|
requirements: []
|
63
80
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.2.2
|
65
82
|
signing_key:
|
66
83
|
specification_version: 4
|
67
84
|
summary: A binary ruby gem for distribution of libspotify.
|