summary refs log tree commit diff
path: root/pkgs/games/lgogdownloader/default.nix
blob: 446d2ac864806ca9283ab7db5be72a6cc6356b40 (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
{ lib, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, curl
, boost
, liboauth
, jsoncpp
, htmlcxx
, rhash
, tinyxml-2
, help2man
}:

stdenv.mkDerivation rec {
  pname = "lgogdownloader";
  version = "3.8";

  src = fetchFromGitHub {
    owner = "Sude-";
    repo = "lgogdownloader";
    rev = "v${version}";
    sha256 = "sha256-LywFJCZevlhthOkAZo7JkXcPT9V6Zh28VD/MVQnMQjo=";
  };

  nativeBuildInputs = [ cmake pkg-config help2man ];

  buildInputs = [ boost curl htmlcxx jsoncpp liboauth rhash tinyxml-2 ];

  doInstallCheck = true;
  installCheckPhase = ''
    if [[ "$("$out/bin/${pname}" --version)" == "LGOGDownloader ${version}" ]]; then
       echo '${pname} smoke check passed'
     else
       echo '${pname} smoke check failed'
       return 1
     fi
  '';

  meta = with lib; {
    description = "Unofficial downloader to GOG.com for Linux users. It uses the same API as the official GOGDownloader";
    homepage = "https://github.com/Sude-/lgogdownloader";
    license = licenses.wtfpl;
    maintainers = with maintainers; [ _0x4A6F ];
    platforms = platforms.linux;
  };
}