summary refs log tree commit diff
path: root/pkgs/applications/misc/pbpst/default.nix
blob: fcf88200133c4282148a2dea294e601a0cd56bd1 (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
{ llvmPackages, stdenv, fetchFromGitHub
, python36Packages, which, pkgconfig, curl, git, gettext, jansson

# Optional overrides
, maxFileSize ? 64 # in MB
, provider ? "https://ptpb.pw/"
}:

llvmPackages.stdenv.mkDerivation rec {
  version = "unstable-2018-01-11";
  name = "pbpst-${version}";

  src = fetchFromGitHub {
    owner = "HalosGhost";
    repo = "pbpst";
    rev = "ecbe08a0b72a6e4212f09fc6cf52a73506992346";
    sha256 = "0dwhmw1dg4hg75nlvk5kmvv3slz2n3b9x65q4ig16agwqfsp4mdm";
  };

  nativeBuildInputs = [
    python36Packages.sphinx
    which
    pkgconfig
    curl
    git
    gettext
  ];
  buildInputs = [ curl jansson ];

  patchPhase = ''
    patchShebangs ./configure

    # Remove hardcoded check for libs in /usr/lib/
    sed -e '64,67d' -i ./configure
  '';

  configureFlags = [
    "--file-max=${toString (maxFileSize * 1024 * 1024)}" # convert to bytes
    "--provider=${provider}"
  ];

  meta = with stdenv.lib; {
    description = "A command-line libcurl C client for pb deployments";
    inherit (src.meta) homepage;
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = with maintainers; [ tmplt ];
  };
}