libspotify 12.1.51.4-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dc18a384c40ec18d5038c138aabc5d6a5c928058
4
+ data.tar.gz: ed74edeac734a6c9d4121a2c4c838c58f1f4216b
5
+ SHA512:
6
+ metadata.gz: b84ab3a2b75023331af40a94cb4c195a27ada7e3df0d2f7df3846cb8d9cd404dbb249402142a113798132c4175aa111c34a7b70f10692da9fe1be614504690fd
7
+ data.tar.gz: 0dd228d78b63293b03d35bcead2b66287522a5e14a6d6067f86222f6a6e98751d9e300de219aa1378a37a037ac9694f063bcd1c890c6dc5b4026d28382561c3b
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ bin/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ -Ilib
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,42 @@
1
+ # libspotify
2
+
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).
6
+
7
+ Please see [the official libspotify documentation at https://developer.spotify.com/technologies/libspotify/ for more information](https://developer.spotify.com/technologies/libspotify/).
8
+
9
+ ## Version policy
10
+
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
@@ -0,0 +1,123 @@
1
+ desc "Build the libspotify gem for supported platforms"
2
+ task :build do
3
+ require "rubygems/package"
4
+ require "fileutils"
5
+
6
+ root = File.dirname(__FILE__)
7
+ bins = File.join(root, "bin/")
8
+ pkgs = File.join(root, "pkg/")
9
+ FileUtils.mkdir_p(pkgs, verbose: true)
10
+
11
+ # We want the right binary location.
12
+ require_relative "lib/libspotify"
13
+
14
+ platforms = Libspotify::PLATFORMS.dup
15
+ platforms[Gem::Platform::RUBY] = [] # fallback platform
16
+ platforms["universal-java"] = platforms.values.flatten.uniq
17
+
18
+ # Maps binaries to system path.
19
+ binaries =
20
+ {
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",
26
+ # armv5 works on both armv6 and armv7, so we always use armv5.
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",
30
+ }
31
+
32
+ # Load our gem specification.
33
+ original = Gem::Specification.load("libspotify.gemspec")
34
+
35
+ # Now build the gem for each platform.
36
+ gempaths = platforms.each_pair.map do |platform, source_binaries|
37
+ # Make sure we don’t break anything.
38
+ spec = original.dup
39
+
40
+ puts
41
+ puts "[#{platform}]"
42
+ spec.platform = platform
43
+
44
+ if source_binaries.empty?
45
+ puts "Pure ruby build."
46
+ spec.post_install_message = <<-MSG.gsub(/ {2,}/, " ")
47
+ Binary libspotify gem could not be installed. You will need to install libspotify separately.
48
+ If you are on ARM (e.g. Raspberry PI), you might want to install the gem with explicit --platform:
49
+ $> gem install libspotify --platform arm-linux
50
+ MSG
51
+ else
52
+ source_binaries.each do |binary|
53
+ src_name = "bin/#{binaries.fetch(binary)}"
54
+ dest_name = "bin/#{binary}"
55
+ FileUtils.cp(src_name, dest_name, verbose: true)
56
+ spec.files << dest_name
57
+ end
58
+ end
59
+
60
+ # Move the build binary to the pkg/ directory.
61
+ gemname = Gem::Package.build(spec)
62
+ File.join(pkgs, File.basename(gemname)).tap do |gempath|
63
+ FileUtils.mv(gemname, gempath, verbose: true)
64
+ end
65
+ end
66
+
67
+ puts
68
+ puts "All gems successfully built. To publish, do:"
69
+ gempaths.each do |path|
70
+ puts " gem push pkg/#{File.basename(path)}"
71
+ end
72
+
73
+ puts
74
+ puts "Do not forget to tag and push to GitHub as well."
75
+ end
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
+
113
+ desc "Launch an IRB console with the gem loaded."
114
+ task :console do
115
+ exec "irb -Ilib -rlibspotify"
116
+ end
117
+
118
+ require "rspec/core/rake_task"
119
+ RSpec::Core::RakeTask.new("spec") do |task|
120
+ task.ruby_opts = "-W2"
121
+ end
122
+
123
+ task :default => :spec
@@ -0,0 +1,97 @@
1
+ module Libspotify
2
+ VERSION = "12.1.51"
3
+ GEM_VERSION = "#{VERSION}.4"
4
+
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
+ }
13
+
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
55
+
56
+ # @return [String] host cpu, even on jruby
57
+ def host_cpu
58
+ case RbConfig::CONFIG["host_cpu"]
59
+ when /86_64/
60
+ "x86_64"
61
+ when /86/
62
+ "x86"
63
+ when /arm/
64
+ hf = "hf" if hard_float?
65
+ "armv#{arm_version}#{hf}"
66
+ else
67
+ RbConfig::CONFIG["host_cpu"]
68
+ end
69
+ end
70
+
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
94
+ end
95
+ end
96
+
97
+ LIBSPOTIFY_BIN = Libspotify.binary_path
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ require File.expand_path('../lib/libspotify', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "libspotify"
6
+ gem.authors = ["Kim Burgestrand"]
7
+ gem.email = ["kim@burgestrand.se"]
8
+ gem.summary = %q{A binary ruby gem for distribution of libspotify.}
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
+
16
+ gem.homepage = "https://github.com/Burgestrand/libspotify"
17
+ gem.require_paths = ["lib"]
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.license = "MIT"
20
+
21
+ gem.version = Libspotify::GEM_VERSION
22
+ gem.platform = Gem::Platform::RUBY
23
+ gem.add_development_dependency "rspec", "~> 2.0"
24
+ gem.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,90 @@
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 "x86-linux"
22
+ end
23
+
24
+ specify "linux-gnu:x86_64" do
25
+ release_name.should eq "x86_64-linux"
26
+ end
27
+
28
+ specify "mingw32:i686" do
29
+ release_name.should eq "x86-windows.dll"
30
+ end
31
+
32
+ context "soft float" do
33
+ before { Libspotify.stub(hard_float?: false) }
34
+
35
+ specify "linux-gnueabi:armv5l" do
36
+ Libspotify.stub(arm_version: 5)
37
+ release_name.should eq "armv5-linux"
38
+ end
39
+
40
+ specify "linux-gnueabi:armv6l" do
41
+ Libspotify.stub(arm_version: 6)
42
+ release_name.should eq "armv6-linux"
43
+ end
44
+
45
+ specify "linux-gnueabi:armv7l" do
46
+ Libspotify.stub(arm_version: 7)
47
+ release_name.should eq "armv6-linux"
48
+ end
49
+ end
50
+
51
+ context "hard float" do
52
+ before { Libspotify.stub(hard_float?: true) }
53
+
54
+ specify "linux-gnueabi:armv5l" do
55
+ Libspotify.stub(arm_version: 5)
56
+ release_name.should eq "armv5hf-linux"
57
+ end
58
+
59
+ specify "linux-gnueabi:armv6l" do
60
+ Libspotify.stub(arm_version: 6)
61
+ release_name.should eq "armv6hf-linux"
62
+ end
63
+
64
+ specify "linux-gnueabi:armv7l" do
65
+ Libspotify.stub(arm_version: 7)
66
+ release_name.should eq "armv6hf-linux"
67
+ end
68
+ end
69
+
70
+ specify "linux:weird-cpu" do
71
+ release_name.should eq "weird-cpu-linux"
72
+ end
73
+
74
+ specify "weird-os:weird-cpu" do
75
+ release_name.should eq "weird-cpu-weird-os"
76
+ end
77
+ end
78
+
79
+ specify "LIBSPOTIFY_BIN is equivalent to #binary_path" do
80
+ LIBSPOTIFY_BIN.should eq Libspotify.binary_path
81
+ end
82
+
83
+ specify "GEM_VERSION" do
84
+ Libspotify::GEM_VERSION.should match(/\A#{Regexp.quote(Libspotify::VERSION)}/)
85
+ end
86
+
87
+ specify "VERSION" do
88
+ Libspotify::VERSION.should eq "12.1.51"
89
+ end
90
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: libspotify
3
+ version: !ruby/object:Gem::Version
4
+ version: 12.1.51.4
5
+ platform: x86-linux
6
+ authors:
7
+ - Kim Burgestrand
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
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.
45
+ email:
46
+ - kim@burgestrand.se
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".gitignore"
52
+ - ".rspec"
53
+ - Gemfile
54
+ - README.md
55
+ - Rakefile
56
+ - bin/.gitkeep
57
+ - bin/x86-linux
58
+ - lib/libspotify.rb
59
+ - libspotify.gemspec
60
+ - spec/libspotify_spec.rb
61
+ homepage: https://github.com/Burgestrand/libspotify
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.2.2
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: A binary ruby gem for distribution of libspotify.
85
+ test_files: []