about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p/soulseekqt/default.nix
blob: e525c564c509203c0faf5883cc127ea8e98dcab4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ stdenv
, fetchurl
, dbus
, zlib, fontconfig
, libX11, libxcb, libXau, libXdmcp, freetype, libbsd
}:

with stdenv.lib;
let
  libPath = makeLibraryPath
    [ stdenv.cc.cc dbus libX11 zlib libX11 libxcb libXau libXdmcp freetype fontconfig libbsd ];

  version = "2016-1-17";

  mainbin = "SoulseekQt-" + (version) +"-"+ (if stdenv.is64bit then "64bit" else "32bit");
  srcs = {
    "i686-linux" = fetchurl {
      url = "https://www.dropbox.com/s/kebk1b5ib1m3xxw/${mainbin}.tgz";
      sha256 = "0r9rhnfslkgbw3l7fnc0rcfqjh58amgh5p33kwam0qvn1h1frnir";
    };

    "x86_64-linux" = fetchurl {
      url = "https://www.dropbox.com/s/7qh902qv2sxyp6p/${mainbin}.tgz";
      sha256 = "05l3smpdvw8xdhv4v8a28j0yi1kvzhrha2ck23g4bl7x9wkay4cc";
    };
  };

in stdenv.mkDerivation rec {

  name = "soulseekqt-${version}";
  inherit version;
  src = srcs."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");

  sourceRoot = ".";
  buildPhase = ":";   # nothing to build

  installPhase = ''
    mkdir -p $out/bin
    cp ${mainbin} $out/bin/soulseekqt
  '';

  fixupPhase = ''
    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
             --set-rpath ${libPath} \
             $out/bin/soulseekqt
  '';

  meta = with stdenv.lib; {
    description = "Official Qt SoulSeek client";
    homepage = http://www.soulseekqt.net;
    license = licenses.unfree;
    maintainers = [ maintainers.genesis ];
    platforms = [ "i686-linux" "x86_64-linux" ];
  };
}