Merge branch 'libspotify' of git://github.com/lovek323/nixpkgs into lovek323-libspotify
Conflicts: pkgs/top-level/all-packages.nix
This commit is contained in:
commit
33d957b34b
|
@ -1,25 +1,56 @@
|
||||||
{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey }:
|
{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey, unzip }:
|
||||||
|
|
||||||
let version = "12.1.51"; in
|
let version = "12.1.51"; in
|
||||||
|
|
||||||
if stdenv.system != "x86_64-linux" then throw ''
|
if (stdenv.system == "x86_64-linux" && stdenv.system != "x86_64-darwin")
|
||||||
Check https://developer.spotify.com/technologies/libspotify/ for a tarball for your system and add it here
|
then throw "Check https://developer.spotify.com/technologies/libspotify/ for a tarball for your system and add it here"
|
||||||
'' else stdenv.mkDerivation {
|
else stdenv.mkDerivation {
|
||||||
name = "libspotify-${version}";
|
name = "libspotify-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src =
|
||||||
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-x86_64-release.tar.gz";
|
if stdenv.system == "x86_64-linux" then
|
||||||
|
fetchurl {
|
||||||
sha256 = "0n0h94i4xg46hfba95n3ypah93crwb80bhgsg00f6sms683lx8a3";
|
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-x86_64-release.tar.gz";
|
||||||
};
|
sha256 = "0n0h94i4xg46hfba95n3ypah93crwb80bhgsg00f6sms683lx8a3";
|
||||||
|
}
|
||||||
|
else if stdenv.system == "x86_64-darwin" then
|
||||||
|
fetchurl {
|
||||||
|
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
|
||||||
|
sha256 = "1gcgrc8arim3hnszcc886lmcdb4iigc08abkaa02l6gng43ky1c0";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
null;
|
||||||
|
|
||||||
|
# common
|
||||||
buildPhase = "true";
|
buildPhase = "true";
|
||||||
|
# no patch or build phase for darwin
|
||||||
|
phases = [ "unpackPhase" "installPhase" ]
|
||||||
|
++ stdenv.lib.optionals (stdenv.system == "x86_64-linux")
|
||||||
|
[ "patchPhase" "buildPhase" ];
|
||||||
|
installPhase = if (stdenv.system == "x86_64-linux")
|
||||||
|
then "installPhase"
|
||||||
|
else ''
|
||||||
|
mkdir -p "$out"/include/libspotify
|
||||||
|
mv -v libspotify.framework/Versions/Current/Headers/api.h \
|
||||||
|
"$out"/include/libspotify
|
||||||
|
mkdir -p "$out"/lib
|
||||||
|
mv -v libspotify.framework/Versions/Current/libspotify \
|
||||||
|
"$out"/lib/libspotify.dylib
|
||||||
|
mkdir -p "$out"/share/man
|
||||||
|
mv -v man3 "$out"/share/man
|
||||||
|
'';
|
||||||
|
|
||||||
installFlags = "prefix=$(out)";
|
|
||||||
|
|
||||||
postInstall = "mv -v share $out";
|
# darwin-specific
|
||||||
|
buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip;
|
||||||
|
|
||||||
patchPhase = "sed -i 's/ldconfig//' Makefile";
|
# linux-specific
|
||||||
|
installFlags = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
||||||
|
"prefix=$(out)";
|
||||||
|
patchPhase = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
||||||
|
"sed -i 's/ldconfig//' Makefile";
|
||||||
|
postInstall = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
||||||
|
"mv -v share $out";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
samples = if apiKey == null
|
samples = if apiKey == null
|
||||||
|
@ -27,35 +58,27 @@ if stdenv.system != "x86_64-linux" then throw ''
|
||||||
Please visit ${libspotify.meta.homepage} to get an api key then set config.libspotify.apiKey accordingly
|
Please visit ${libspotify.meta.homepage} to get an api key then set config.libspotify.apiKey accordingly
|
||||||
'' else stdenv.mkDerivation {
|
'' else stdenv.mkDerivation {
|
||||||
name = "libspotify-samples-${version}";
|
name = "libspotify-samples-${version}";
|
||||||
|
|
||||||
src = libspotify.src;
|
src = libspotify.src;
|
||||||
|
buildInputs = [ pkgconfig libspotify readline ]
|
||||||
buildInputs = [ pkgconfig libspotify alsaLib readline ];
|
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
|
||||||
|
|
||||||
postUnpack = "sourceRoot=$sourceRoot/share/doc/libspotify/examples";
|
postUnpack = "sourceRoot=$sourceRoot/share/doc/libspotify/examples";
|
||||||
|
|
||||||
patchPhase = "cp ${apiKey} appkey.c";
|
patchPhase = "cp ${apiKey} appkey.c";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
install -m 755 jukebox/jukebox $out/bin
|
install -m 755 jukebox/jukebox $out/bin
|
||||||
install -m 755 spshell/spshell $out/bin
|
install -m 755 spshell/spshell $out/bin
|
||||||
install -m 755 localfiles/posix_stu $out/bin
|
install -m 755 localfiles/posix_stu $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = libspotify.meta // { description = "Spotify API library samples"; };
|
meta = libspotify.meta // { description = "Spotify API library samples"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit apiKey;
|
inherit apiKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "Spotify API library";
|
description = "Spotify API library";
|
||||||
|
homepage = https://developer.spotify.com/technologies/libspotify;
|
||||||
homepage = https://developer.spotify.com/technologies/libspotify;
|
maintainers = with maintainers; [ lovek323 shlevy ];
|
||||||
|
license = licenses.unfree;
|
||||||
maintainers = [ stdenv.lib.maintainers.shlevy ];
|
|
||||||
|
|
||||||
license = stdenv.lib.licenses.unfree;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
29
pkgs/os-specific/darwin/install_name_tool/default.nix
Normal file
29
pkgs/os-specific/darwin/install_name_tool/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ stdenv }:
|
||||||
|
|
||||||
|
assert stdenv.isDarwin;
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "install_name_tool";
|
||||||
|
src = "/usr/bin/install_name_tool";
|
||||||
|
unpackPhase = "true";
|
||||||
|
configurePhase = "true";
|
||||||
|
buildPhase = "true";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out"/bin
|
||||||
|
ln -s "$src" "$out"/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Change dynamic shared library install names";
|
||||||
|
homepage = https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/install_name_tool.1.html;
|
||||||
|
maintainers = with maintainers; [ lovek323 ];
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
|
||||||
|
longDescription = ''
|
||||||
|
Install_name_tool changes the dynamic shared library install names and or
|
||||||
|
adds, changes or deletes the rpaths recorded in a Mach-O binary.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -448,6 +448,8 @@ let
|
||||||
|
|
||||||
setFile = callPackage ../development/tools/misc/setFile { };
|
setFile = callPackage ../development/tools/misc/setFile { };
|
||||||
|
|
||||||
|
install_name_tool = callPackage ../os-specific/darwin/install_name_tool { };
|
||||||
|
|
||||||
xcodeenv = callPackage ../development/mobile/xcodeenv { };
|
xcodeenv = callPackage ../development/mobile/xcodeenv { };
|
||||||
|
|
||||||
titaniumenv_2_1 = import ../development/mobile/titaniumenv {
|
titaniumenv_2_1 = import ../development/mobile/titaniumenv {
|
||||||
|
|
|
@ -6186,28 +6186,38 @@ pythonPackages = python.modules // rec {
|
||||||
pyspotify = buildPythonPackage rec {
|
pyspotify = buildPythonPackage rec {
|
||||||
name = "pyspotify-${version}";
|
name = "pyspotify-${version}";
|
||||||
|
|
||||||
version = "1.10";
|
version = "1.11";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchurl {
|
||||||
url = "https://github.com/mopidy/pyspotify.git";
|
url = "https://github.com/mopidy/pyspotify/archive/v1.11.tar.gz";
|
||||||
rev = "refs/tags/v${version}";
|
sha256 = "089ml6pqr3f2d15n70jpzbaqjp5pjgqlyv4algkxw92xscjw2izg";
|
||||||
sha256 = "1rvgrviwn6f037m8vq395chz6a1119dbsdhfwdbv5ambi0bak6ll";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ pkgs.libspotify ];
|
buildInputs = [ pkgs.libspotify ]
|
||||||
|
++ stdenv.lib.optional stdenv.isDarwin pkgs.install_name_tool;
|
||||||
|
|
||||||
# python zip complains about old timestamps
|
# python zip complains about old timestamps
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
find -print0 | xargs -0 touch
|
find -print0 | xargs -0 touch
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
|
find "$out" -name _spotify.so -exec \
|
||||||
|
install_name_tool -change \
|
||||||
|
@loader_path/../Frameworks/libspotify.framework/libspotify \
|
||||||
|
${pkgs.libspotify}/lib/libspotify.dylib \
|
||||||
|
{} \;
|
||||||
|
'';
|
||||||
|
|
||||||
# There are no tests
|
# There are no tests
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://pyspotify.mopidy.com;
|
homepage = http://pyspotify.mopidy.com;
|
||||||
description = "A Python interface to Spotify’s online music streaming service";
|
description = "A Python interface to Spotify’s online music streaming service";
|
||||||
maintainers = [ stdenv.lib.maintainers.rickynils ];
|
license = licenses.unfree;
|
||||||
|
maintainers = with maintainers; [ lovek323 rickynils ];
|
||||||
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue