Merge pull request #8579 from jraygauthier/jrg/i686_linux_libspotify
Add support for libspotify on `i686-linux`.
This commit is contained in:
commit
f71b7f08af
|
@ -1,8 +1,11 @@
|
||||||
{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey, unzip, gnused }:
|
{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey, unzip, gnused }:
|
||||||
|
|
||||||
let version = "12.1.51"; in
|
let
|
||||||
|
version = "12.1.51";
|
||||||
|
isLinux = (stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux");
|
||||||
|
in
|
||||||
|
|
||||||
if (stdenv.system != "x86_64-linux" && stdenv.system != "x86_64-darwin")
|
if (stdenv.system != "x86_64-linux" && stdenv.system != "x86_64-darwin" && stdenv.system != "i686-linux")
|
||||||
then throw "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}";
|
||||||
|
@ -18,6 +21,11 @@ else stdenv.mkDerivation {
|
||||||
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
|
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
|
||||||
sha256 = "1gcgrc8arim3hnszcc886lmcdb4iigc08abkaa02l6gng43ky1c0";
|
sha256 = "1gcgrc8arim3hnszcc886lmcdb4iigc08abkaa02l6gng43ky1c0";
|
||||||
}
|
}
|
||||||
|
else if stdenv.system == "i686-linux" then
|
||||||
|
fetchurl {
|
||||||
|
url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-i686-release.tar.gz";
|
||||||
|
sha256 = "1bjmn64gbr4p9irq426yap4ipq9rb84zsyhjjr7frmmw22xb86ll";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
|
|
||||||
|
@ -26,9 +34,9 @@ else stdenv.mkDerivation {
|
||||||
# no patch or build phase for darwin
|
# no patch or build phase for darwin
|
||||||
phases =
|
phases =
|
||||||
[ "unpackPhase" ] ++
|
[ "unpackPhase" ] ++
|
||||||
(stdenv.lib.optionals (stdenv.system == "x86_64-linux") [ "patchPhase" "buildPhase" ]) ++
|
(stdenv.lib.optionals (isLinux) [ "patchPhase" "buildPhase" ]) ++
|
||||||
[ "installPhase" ];
|
[ "installPhase" ];
|
||||||
installPhase = if (stdenv.system == "x86_64-linux")
|
installPhase = if (isLinux)
|
||||||
then "installPhase"
|
then "installPhase"
|
||||||
else ''
|
else ''
|
||||||
mkdir -p "$out"/include/libspotify
|
mkdir -p "$out"/include/libspotify
|
||||||
|
@ -46,11 +54,11 @@ else stdenv.mkDerivation {
|
||||||
buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip;
|
buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip;
|
||||||
|
|
||||||
# linux-specific
|
# linux-specific
|
||||||
installFlags = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
installFlags = stdenv.lib.optionalString (isLinux)
|
||||||
"prefix=$(out)";
|
"prefix=$(out)";
|
||||||
patchPhase = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
patchPhase = stdenv.lib.optionalString (isLinux)
|
||||||
"${gnused}/bin/sed -i 's/ldconfig//' Makefile";
|
"${gnused}/bin/sed -i 's/ldconfig//' Makefile";
|
||||||
postInstall = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
postInstall = stdenv.lib.optionalString (isLinux)
|
||||||
"mv -v share $out";
|
"mv -v share $out";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|
Loading…
Reference in a new issue