summary refs log tree commit diff
path: root/pkgs/games/scrolls/default.nix
blob: b8bf4efcf0aa778fd175ce726297de924aa25adb (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
{ stdenv, fetchurl, gcc
, libGLU, libX11, libXext, libXcursor, libpulseaudio
}:
stdenv.mkDerivation {
  name = "scrolls-2015-10-13";

  meta = {
    description = "A strategy collectible card game";
    homepage = https://scrolls.com/;
    # http://www.reddit.com/r/Scrolls/comments/2j3pxw/linux_client_experimental/

    platforms = [ "x86_64-linux" ];

    license = stdenv.lib.licenses.unfree;
  };

  src = fetchurl {
    url = "https://download.scrolls.com/client/linux.tar.gz";
    sha256 = "ead1fd14988aa07041fedfa7f845c756cd5077a5a402d85bfb749cb669ececec";
  };

  libPath = stdenv.lib.makeLibraryPath [
    gcc
    libGLU
    libX11
    libXext
    libXcursor
    libpulseaudio
  ];

  phases = [ "unpackPhase" "installPhase" ];
  installPhase = ''
    mkdir -p "$out/opt/Scrolls"
    cp -r ../Scrolls "$out/opt/Scrolls/"
    cp -r ../Scrolls_Data "$out/opt/Scrolls/"
    chmod +x "$out/opt/Scrolls/Scrolls"

    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
      --set-rpath "$libPath" "$out/opt/Scrolls/Scrolls"

    mkdir "$out/bin"
    ln -s "$out/opt/Scrolls/Scrolls" "$out/bin/Scrolls"
  '';

}