libspotify 12.1.51.1 → 12.1.51.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +1 -0
- data/README.md +36 -4
- data/Rakefile +50 -30
- data/lib/libspotify.rb +41 -1
- data/libspotify.gemspec +3 -3
- data/spec/libspotify_spec.rb +76 -0
- metadata +16 -37
- data/LICENSE.txt +0 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 64f9470bde55e71d13f1b167e925c68451188468
|
4
|
+
data.tar.gz: 8a3b373802f81ac0f72700582ef77bc30b1527ba
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e6c92680114b654a85844e63fbab2fb14bb1f6468797df6a5624e8c2374f727939e4eac992cead155a033a77a517289f211faa873c7ba35cee4a4fdf34139f2a
|
7
|
+
data.tar.gz: d24dfce03eaf2b3a4328c9c9233bb1158c0866d708c9ffaedd4a17ed7a9b42d0d46bc4b2e668cdbcb8598f0db5fcfa0d25b21e05d8b8a45c3e28391f86aa9d40
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
-Ilib
|
data/README.md
CHANGED
@@ -1,10 +1,42 @@
|
|
1
1
|
# libspotify
|
2
2
|
|
3
|
-
This is a mere ruby gem that bundles the libspotify binaries for ease of
|
3
|
+
This is a mere ruby gem that bundles the libspotify binaries for ease of
|
4
|
+
installation. If your platform is not supported, please create an issue in
|
5
|
+
[the issue tracker](https://github.com/Burgestrand/libspotify/issues).
|
4
6
|
|
5
7
|
Please see [the official libspotify documentation at https://developer.spotify.com/technologies/libspotify/ for more information](https://developer.spotify.com/technologies/libspotify/).
|
6
8
|
|
7
|
-
|
9
|
+
## Version policy
|
8
10
|
|
9
|
-
Given `12.1.51.0`, the `12.1.51` is the libspotify version, and the last `0`
|
10
|
-
of the libspotify gem for this libspotify
|
11
|
+
Given `12.1.51.0`, the `12.1.51` is the libspotify version, and the last `0`
|
12
|
+
means it’s the first version released of the libspotify gem for this libspotify
|
13
|
+
version.
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
Copyright (c) 2012 Kim Burgestrand
|
18
|
+
|
19
|
+
MIT License
|
20
|
+
|
21
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
22
|
+
a copy of this software and associated documentation files (the
|
23
|
+
"Software"), to deal in the Software without restriction, including
|
24
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
25
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
26
|
+
permit persons to whom the Software is furnished to do so, subject to
|
27
|
+
the following conditions:
|
28
|
+
|
29
|
+
The above copyright notice and this permission notice shall be
|
30
|
+
included in all copies or substantial portions of the Software.
|
31
|
+
|
32
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
33
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
34
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
35
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
36
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
37
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
38
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
39
|
+
|
40
|
+
## License (libspotify)
|
41
|
+
|
42
|
+
libspotify is released under it’s own license and terms of use: http://developer.spotify.com/technologies/libspotify/#terms-of-use
|
data/Rakefile
CHANGED
@@ -1,58 +1,71 @@
|
|
1
1
|
desc "Build the libspotify gem for supported platforms"
|
2
2
|
task :build do
|
3
|
-
require
|
3
|
+
require "rubygems/package"
|
4
|
+
require "fileutils"
|
4
5
|
|
5
6
|
root = File.dirname(__FILE__)
|
6
|
-
bins = File.join(root,
|
7
|
-
pkgs = File.join(root,
|
7
|
+
bins = File.join(root, "bin/")
|
8
|
+
pkgs = File.join(root, "pkg/")
|
8
9
|
FileUtils.mkdir_p(pkgs, verbose: true)
|
9
10
|
|
10
11
|
# We want the right binary location.
|
11
|
-
require_relative
|
12
|
+
require_relative "lib/libspotify"
|
12
13
|
|
13
14
|
# Maps platform to libspotify binary name.
|
14
15
|
platforms =
|
15
16
|
{
|
16
|
-
"universal-darwin" => "
|
17
|
-
"i686-linux" => "
|
18
|
-
"x86_64-linux" => "
|
19
|
-
|
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
|
20
23
|
}
|
21
24
|
|
22
|
-
#
|
23
|
-
|
25
|
+
# Maps binaries to system path.
|
26
|
+
binaries =
|
27
|
+
{
|
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",
|
30
|
+
"x86_64-linux" => "libspotify-12.1.51-Linux-x86_64-release/lib/libspotify.so",
|
31
|
+
"armv5-linux" => "libspotify-12.1.51-Linux-armv5-release/lib/libspotify.so",
|
32
|
+
# 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",
|
35
|
+
}
|
24
36
|
|
25
|
-
#
|
26
|
-
|
37
|
+
# Load our gem specification.
|
38
|
+
original = Gem::Specification.load("libspotify.gemspec")
|
27
39
|
|
28
40
|
# Now build the gem for each platform.
|
29
|
-
gempaths = platforms.each_pair.map do |platform,
|
41
|
+
gempaths = platforms.each_pair.map do |platform, source_binaries|
|
30
42
|
# Make sure we don’t break anything.
|
31
43
|
spec = original.dup
|
32
44
|
|
33
|
-
|
45
|
+
puts
|
46
|
+
puts "[#{platform}]"
|
34
47
|
spec.platform = platform
|
35
48
|
|
36
|
-
if
|
37
|
-
|
38
|
-
|
49
|
+
if source_binaries.empty?
|
50
|
+
puts "Pure ruby build."
|
51
|
+
spec.post_install_message = <<-MSG.gsub(/ {2,}/, " ")
|
52
|
+
Binary libspotify gem could not be installed. You will need to install libspotify separately.
|
53
|
+
If you are on ARM (e.g. Raspberry PI), you might want to install the gem with explicit --platform:
|
54
|
+
$> gem install libspotify --platform arm-linux
|
55
|
+
MSG
|
39
56
|
else
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
exit(false)
|
57
|
+
source_binaries.each do |binary|
|
58
|
+
src_name = "bin/#{binaries[binary]}"
|
59
|
+
dest_name = "bin/#{binary}"
|
60
|
+
FileUtils.cp(src_name, dest_name, verbose: true)
|
61
|
+
spec.files << dest_name
|
46
62
|
end
|
47
63
|
end
|
48
64
|
|
49
|
-
# Annoying.
|
50
|
-
Gem.configuration.verbose = false
|
51
|
-
|
52
65
|
# Move the build binary to the pkg/ directory.
|
53
|
-
gemname = Gem::
|
66
|
+
gemname = Gem::Package.build(spec)
|
54
67
|
File.join(pkgs, File.basename(gemname)).tap do |gempath|
|
55
|
-
FileUtils.mv(gemname, gempath)
|
68
|
+
FileUtils.mv(gemname, gempath, verbose: true)
|
56
69
|
end
|
57
70
|
end
|
58
71
|
|
@@ -61,12 +74,19 @@ task :build do
|
|
61
74
|
gempaths.each do |path|
|
62
75
|
puts " gem push pkg/#{File.basename(path)}"
|
63
76
|
end
|
77
|
+
|
78
|
+
puts
|
64
79
|
puts "Do not forget to push to GitHub as well."
|
65
80
|
end
|
66
81
|
|
67
82
|
desc "Launch an IRB console with the gem loaded."
|
68
83
|
task :console do
|
69
|
-
exec
|
84
|
+
exec "irb -Ilib -rlibspotify"
|
85
|
+
end
|
86
|
+
|
87
|
+
require "rspec/core/rake_task"
|
88
|
+
RSpec::Core::RakeTask.new("spec") do |task|
|
89
|
+
task.ruby_opts = "-W2"
|
70
90
|
end
|
71
91
|
|
72
|
-
task :default => :
|
92
|
+
task :default => :spec
|
data/lib/libspotify.rb
CHANGED
@@ -1 +1,41 @@
|
|
1
|
-
|
1
|
+
module Libspotify
|
2
|
+
VERSION = "12.1.51"
|
3
|
+
GEM_VERSION = "#{VERSION}.3"
|
4
|
+
|
5
|
+
module_function
|
6
|
+
|
7
|
+
# @return [String] full path to libspotify binary.
|
8
|
+
def binary_path
|
9
|
+
File.expand_path("../bin/#{release_name}", File.dirname(__FILE__))
|
10
|
+
end
|
11
|
+
|
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/
|
19
|
+
case RbConfig::CONFIG["host_cpu"]
|
20
|
+
when /86_64/
|
21
|
+
"x86_64-linux"
|
22
|
+
when /86/
|
23
|
+
"i686-linux"
|
24
|
+
when /armv(\d+)?/
|
25
|
+
v = $1
|
26
|
+
hf = "hf" if hard_float?
|
27
|
+
"armv5#{hf}-linux"
|
28
|
+
end
|
29
|
+
else
|
30
|
+
"unknown-%s-%s" % RbConfig::CONFIG.values_at("host_cpu", "host_os")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
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/)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
LIBSPOTIFY_BIN = Libspotify.binary_path
|
data/libspotify.gemspec
CHANGED
@@ -6,12 +6,12 @@ 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 =
|
9
|
+
gem.description = gem.summary
|
10
10
|
gem.homepage = "https://github.com/Burgestrand/libspotify"
|
11
11
|
gem.require_paths = ["lib"]
|
12
12
|
gem.files = `git ls-files`.split($/)
|
13
|
-
gem.
|
13
|
+
gem.license = "MIT"
|
14
14
|
|
15
|
-
gem.version =
|
15
|
+
gem.version = Libspotify::GEM_VERSION
|
16
16
|
gem.platform = Gem::Platform::RUBY
|
17
17
|
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require "libspotify"
|
2
|
+
|
3
|
+
describe Libspotify do
|
4
|
+
describe "binary_path" do
|
5
|
+
subject(:release_name) { File.basename(Libspotify.binary_path) }
|
6
|
+
|
7
|
+
before do
|
8
|
+
os, cpu = example.description.split(":", 2)
|
9
|
+
stub_const("RbConfig::CONFIG", "host_os" => os, "host_cpu" => cpu)
|
10
|
+
end
|
11
|
+
|
12
|
+
specify "darwin:i686" do
|
13
|
+
release_name.should eq "universal-darwin"
|
14
|
+
end
|
15
|
+
|
16
|
+
specify "darwin:x86_64" do
|
17
|
+
release_name.should eq "universal-darwin"
|
18
|
+
end
|
19
|
+
|
20
|
+
specify "linux-gnu:i686" do
|
21
|
+
release_name.should eq "i686-linux"
|
22
|
+
end
|
23
|
+
|
24
|
+
specify "linux-gnu:x86_64" do
|
25
|
+
release_name.should eq "x86_64-linux"
|
26
|
+
end
|
27
|
+
|
28
|
+
context "soft float" do
|
29
|
+
before { Libspotify.stub(hard_float?: false) }
|
30
|
+
|
31
|
+
specify "linux-gnueabi:armv5l" do
|
32
|
+
release_name.should eq "armv5-linux"
|
33
|
+
end
|
34
|
+
|
35
|
+
specify "linux-gnueabi:armv6l" do
|
36
|
+
release_name.should eq "armv5-linux"
|
37
|
+
end
|
38
|
+
|
39
|
+
specify "linux-gnueabi:armv7l" do
|
40
|
+
release_name.should eq "armv5-linux"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context "hard float" do
|
45
|
+
before { Libspotify.stub(hard_float?: true) }
|
46
|
+
|
47
|
+
specify "linux-gnueabi:armv5l" do
|
48
|
+
release_name.should eq "armv5hf-linux"
|
49
|
+
end
|
50
|
+
|
51
|
+
specify "linux-gnueabi:armv6l" do
|
52
|
+
release_name.should eq "armv5hf-linux"
|
53
|
+
end
|
54
|
+
|
55
|
+
specify "linux-gnueabi:armv7l" do
|
56
|
+
release_name.should eq "armv5hf-linux"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
specify "weird-os:weird-cpu" do
|
61
|
+
release_name.should eq "unknown-weird-cpu-weird-os"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
specify "LIBSPOTIFY_BIN is equivalent to #binary_path" do
|
66
|
+
LIBSPOTIFY_BIN.should eq Libspotify.binary_path
|
67
|
+
end
|
68
|
+
|
69
|
+
specify "GEM_VERSION" do
|
70
|
+
Libspotify::GEM_VERSION.should eq "12.1.51.2"
|
71
|
+
end
|
72
|
+
|
73
|
+
specify "VERSION" do
|
74
|
+
Libspotify::VERSION.should eq "12.1.51"
|
75
|
+
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,35 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libspotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.1.51.
|
5
|
-
prerelease:
|
4
|
+
version: 12.1.51.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kim Burgestrand
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-04-07 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
15
|
-
|
16
|
-
|
17
|
-
This is a mere ruby gem that bundles the libspotify binaries for ease of installation.
|
18
|
-
|
19
|
-
|
20
|
-
Please see [the official libspotify documentation at https://developer.spotify.com/technologies/libspotify/
|
21
|
-
for more information](https://developer.spotify.com/technologies/libspotify/).
|
22
|
-
|
23
|
-
|
24
|
-
# Version policy
|
25
|
-
|
26
|
-
|
27
|
-
Given `12.1.51.0`, the `12.1.51` is the libspotify version, and the last `0` means
|
28
|
-
it’s the first version released
|
29
|
-
|
30
|
-
of the libspotify gem for this libspotify version.
|
31
|
-
|
32
|
-
'
|
13
|
+
description: A binary ruby gem for distribution of libspotify.
|
33
14
|
email:
|
34
15
|
- kim@burgestrand.se
|
35
16
|
executables: []
|
@@ -37,41 +18,39 @@ extensions: []
|
|
37
18
|
extra_rdoc_files: []
|
38
19
|
files:
|
39
20
|
- .gitignore
|
21
|
+
- .rspec
|
40
22
|
- Gemfile
|
41
|
-
- LICENSE.txt
|
42
23
|
- README.md
|
43
24
|
- Rakefile
|
44
25
|
- bin/.gitkeep
|
45
26
|
- lib/libspotify.rb
|
46
27
|
- libspotify.gemspec
|
28
|
+
- spec/libspotify_spec.rb
|
47
29
|
homepage: https://github.com/Burgestrand/libspotify
|
48
|
-
licenses:
|
49
|
-
|
30
|
+
licenses:
|
31
|
+
- MIT
|
32
|
+
metadata: {}
|
33
|
+
post_install_message: |2
|
34
|
+
Binary libspotify gem could not be installed. You will need to install libspotify separately.
|
35
|
+
If you are on ARM (e.g. Raspberry PI), you might want to install the gem with explicit --platform:
|
36
|
+
$> gem install libspotify --platform arm-linux
|
50
37
|
rdoc_options: []
|
51
38
|
require_paths:
|
52
39
|
- lib
|
53
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
41
|
requirements:
|
56
|
-
- -
|
42
|
+
- - '>='
|
57
43
|
- !ruby/object:Gem::Version
|
58
44
|
version: '0'
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
hash: -685144165072869494
|
62
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
46
|
requirements:
|
65
|
-
- -
|
47
|
+
- - '>='
|
66
48
|
- !ruby/object:Gem::Version
|
67
49
|
version: '0'
|
68
|
-
segments:
|
69
|
-
- 0
|
70
|
-
hash: -685144165072869494
|
71
50
|
requirements: []
|
72
51
|
rubyforge_project:
|
73
|
-
rubygems_version:
|
52
|
+
rubygems_version: 2.0.3
|
74
53
|
signing_key:
|
75
|
-
specification_version:
|
54
|
+
specification_version: 4
|
76
55
|
summary: A binary ruby gem for distribution of libspotify.
|
77
56
|
test_files: []
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Kim Burgestrand
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|