From 8f9534ccc3f3c73a8e17a035cfe059830c679251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 4 Jul 2015 20:32:45 +0200 Subject: [PATCH] popcorntime: unbreak tarball job Fix evaluation error when srcs."${stdenv.system}" does not exist (e.g. on darwin). --- .../video/popcorntime/default.nix | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/video/popcorntime/default.nix b/pkgs/applications/video/popcorntime/default.nix index 0db56cc6fcd7..c588833b2f08 100644 --- a/pkgs/applications/video/popcorntime/default.nix +++ b/pkgs/applications/video/popcorntime/default.nix @@ -4,20 +4,21 @@ let version = "0.3.7.2"; - srcs = { - x86_64-linux = fetchurl { - url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux64.tar.xz"; - sha256 = "0lm9k4fr73a9p00i3xj2ywa4wvjf9csadm0pcz8d6imwwq44sa8b"; - }; - i686-linux = fetchurl { - url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux32.tar.xz"; - sha256 = "1dz1cp31qbwamm9pf8ydmzzhnb6d9z73bigdv3y74dgicz3dpr91"; - }; - }; - popcorntimePackage = stdenv.mkDerivation rec { name = "popcorntime-package-${version}"; - src = srcs."${stdenv.system}"; + src = + if stdenv.system == "x86_64-linux" then + fetchurl { + url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux64.tar.xz"; + sha256 = "0lm9k4fr73a9p00i3xj2ywa4wvjf9csadm0pcz8d6imwwq44sa8b"; + } + else if stdenv.system == "i686-linux" then + fetchurl { + url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux32.tar.xz"; + sha256 = "1dz1cp31qbwamm9pf8ydmzzhnb6d9z73bigdv3y74dgicz3dpr91"; + } + else + throw "Unsupported system ${stdenv.system}"; sourceRoot = "."; installPhase = '' mkdir -p $out