summary refs log tree commit diff
path: root/pkgs/development/libraries/libspotify
diff options
context:
space:
mode:
authorRaymond Gauthier <jraygauthier@gmail.com>2015-06-23 19:54:59 -0400
committerRaymond Gauthier <jraygauthier@gmail.com>2015-07-01 00:27:10 -0400
commit8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8 (patch)
treeb17e15e8452bc1075f00883de8ce97a00eba8f77 /pkgs/development/libraries/libspotify
parent8e564526fc50d59a7abbb8bdfd8fbd0009c403d0 (diff)
downloadnixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar.gz
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar.bz2
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar.lz
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar.xz
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.tar.zst
nixpkgs-8edc6b07dfff2baa358cbbd6ca0420f638ba0ee8.zip
libspotify: support `i686-linux` platform.
Diffstat (limited to 'pkgs/development/libraries/libspotify')
-rw-r--r--pkgs/development/libraries/libspotify/default.nix22
1 files changed, 15 insertions, 7 deletions
diff --git a/pkgs/development/libraries/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix
index 56d15cd1e80..02bd1f966e6 100644
--- a/pkgs/development/libraries/libspotify/default.nix
+++ b/pkgs/development/libraries/libspotify/default.nix
@@ -1,8 +1,11 @@
 { 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"
 else stdenv.mkDerivation {
   name = "libspotify-${version}";
@@ -18,6 +21,11 @@ else stdenv.mkDerivation {
         url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
         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
       null;
 
@@ -26,9 +34,9 @@ else stdenv.mkDerivation {
   # no patch or build phase for darwin
   phases = 
     [ "unpackPhase" ] ++ 
-    (stdenv.lib.optionals (stdenv.system == "x86_64-linux") [ "patchPhase" "buildPhase" ]) ++
+    (stdenv.lib.optionals (isLinux) [ "patchPhase" "buildPhase" ]) ++
     [ "installPhase" ];
-  installPhase = if (stdenv.system == "x86_64-linux")
+  installPhase = if (isLinux)
     then "installPhase"
     else ''
       mkdir -p "$out"/include/libspotify
@@ -46,11 +54,11 @@ else stdenv.mkDerivation {
   buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip;
 
   # linux-specific
-  installFlags = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+  installFlags = stdenv.lib.optionalString (isLinux)
     "prefix=$(out)";
-  patchPhase = stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+  patchPhase = stdenv.lib.optionalString (isLinux)
     "${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";
 
   passthru = {