libspotify 12.1.51.1-i686-linux → 12.1.51.2-i686-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a342092f6bed0759b7f5eb83048046cbac289ec
4
+ data.tar.gz: 65e3898c9b7d1f07d6c6ff84fff67f8aae7edc5d
5
+ SHA512:
6
+ metadata.gz: 30d9f82f28618e8504a56f8892d71008f5421d3adefee8c0d7d018a0bdacee20cf3008e077d2ecdcc6b33a416c7246ced75435b4110ba07e42d256a1ea4e4383
7
+ data.tar.gz: ac2c7058d05b78498ee88deb455e827c8a2a663ad497bff998e5cba77b88d2aaaa1576dd978e306a8b6bada9c215838ee009c04b60aace9a8b42c17cd0127b2f
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 installation.
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
- # Version policy
9
+ ## Version policy
8
10
 
9
- Given `12.1.51.0`, the `12.1.51` is the libspotify version, and the last `0` means it’s the first version released
10
- of the libspotify gem for this libspotify version.
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,67 @@
1
1
  desc "Build the libspotify gem for supported platforms"
2
2
  task :build do
3
- require 'fileutils'
3
+ require "rubygems/package"
4
+ require "fileutils"
4
5
 
5
6
  root = File.dirname(__FILE__)
6
- bins = File.join(root, 'bin/')
7
- pkgs = File.join(root, 'pkg/')
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 'lib/libspotify'
12
+ require_relative "lib/libspotify"
12
13
 
13
14
  # Maps platform to libspotify binary name.
14
15
  platforms =
15
16
  {
16
- "universal-darwin" => "libspotify-darwin.dylib",
17
- "i686-linux" => "libspotify-i686-linux.so",
18
- "x86_64-linux" => "libspotify-x86_64-linux.so",
19
- Gem::Platform::RUBY => nil, # fallback platform
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
- # Load our gem specification.
23
- original = Gem::Specification.load('libspotify.gemspec')
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
- # output bling.
26
- puts
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, name|
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
- print "[#{platform}]: "
45
+ puts
46
+ puts "[#{platform}]"
34
47
  spec.platform = platform
35
48
 
36
- if name.nil? # pure ruby build
37
- spec.files.delete('libspotify.library')
38
- FileUtils.rm(LIBSPOTIFY_BIN, verbose: true)
49
+ if source_binaries.empty?
50
+ puts "Pure ruby build."
51
+ spec.post_install_message = "Binary libspotify gem could not be installed. You will need to install libspotify separately."
39
52
  else
40
- source_binary = File.join(bins, name)
41
- begin
42
- FileUtils.cp(source_binary, LIBSPOTIFY_BIN, verbose: true)
43
- rescue Errno::ENOENT
44
- puts "Missing #{source_binary}. Cannot build for #{platform}."
45
- exit(false)
53
+ source_binaries.each do |binary|
54
+ src_name = "bin/#{binaries[binary]}"
55
+ dest_name = "bin/#{binary}"
56
+ FileUtils.cp(src_name, dest_name, verbose: true)
57
+ spec.files << dest_name
46
58
  end
47
59
  end
48
60
 
49
- # Annoying.
50
- Gem.configuration.verbose = false
51
-
52
61
  # Move the build binary to the pkg/ directory.
53
- gemname = Gem::Builder.new(spec).build
62
+ gemname = Gem::Package.build(spec)
54
63
  File.join(pkgs, File.basename(gemname)).tap do |gempath|
55
- FileUtils.mv(gemname, gempath)
64
+ FileUtils.mv(gemname, gempath, verbose: true)
56
65
  end
57
66
  end
58
67
 
@@ -61,12 +70,19 @@ task :build do
61
70
  gempaths.each do |path|
62
71
  puts " gem push pkg/#{File.basename(path)}"
63
72
  end
73
+
74
+ puts
64
75
  puts "Do not forget to push to GitHub as well."
65
76
  end
66
77
 
67
78
  desc "Launch an IRB console with the gem loaded."
68
79
  task :console do
69
- exec 'irb -Ilib -rlibspotify'
80
+ exec "irb -Ilib -rlibspotify"
81
+ end
82
+
83
+ require "rspec/core/rake_task"
84
+ RSpec::Core::RakeTask.new("spec") do |task|
85
+ task.ruby_opts = "-W2"
70
86
  end
71
87
 
72
- task :default => :console
88
+ task :default => :spec
data/lib/libspotify.rb CHANGED
@@ -1 +1,41 @@
1
- LIBSPOTIFY_BIN = File.expand_path("../libspotify.library", File.dirname(__FILE__))
1
+ module Libspotify
2
+ VERSION = "12.1.51"
3
+ GEM_VERSION = "#{VERSION}.2"
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 = File.read('README.md')
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.files << "libspotify.library"
13
+ gem.license = "MIT"
14
14
 
15
- gem.version = "12.1.51.1"
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.1
5
- prerelease:
4
+ version: 12.1.51.2
6
5
  platform: i686-linux
7
6
  authors:
8
7
  - Kim Burgestrand
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-01 00:00:00.000000000 Z
11
+ date: 2013-04-07 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: ! '# libspotify
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,42 +18,37 @@ 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
47
- - libspotify.library
28
+ - spec/libspotify_spec.rb
29
+ - bin/i686-linux
48
30
  homepage: https://github.com/Burgestrand/libspotify
49
- licenses: []
31
+ licenses:
32
+ - MIT
33
+ metadata: {}
50
34
  post_install_message:
51
35
  rdoc_options: []
52
36
  require_paths:
53
37
  - lib
54
38
  required_ruby_version: !ruby/object:Gem::Requirement
55
- none: false
56
39
  requirements:
57
- - - ! '>='
40
+ - - '>='
58
41
  - !ruby/object:Gem::Version
59
42
  version: '0'
60
- segments:
61
- - 0
62
- hash: -685144165072869494
63
43
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
44
  requirements:
66
- - - ! '>='
45
+ - - '>='
67
46
  - !ruby/object:Gem::Version
68
47
  version: '0'
69
- segments:
70
- - 0
71
- hash: -685144165072869494
72
48
  requirements: []
73
49
  rubyforge_project:
74
- rubygems_version: 1.8.24
50
+ rubygems_version: 2.0.3
75
51
  signing_key:
76
- specification_version: 3
52
+ specification_version: 4
77
53
  summary: A binary ruby gem for distribution of libspotify.
78
54
  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.
data/libspotify.library DELETED
Binary file