summaryrefslogtreecommitdiffstats
path: root/pkgs/development/libraries/qoauth/default.nix
blob: d8f840078aa02bb20f6b860e460565e56031a602 (plain)
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,
  qtbase,
  qmake,
  qca-qt5,
}:

stdenv.mkDerivation rec {
  pname = "qoauth";
  version = "2.0.0";

  src = fetchFromGitHub {
    owner = "ayoy";
    repo = "qoauth";
    rev = "v${version}";
    name = "qoauth-${version}.tar.gz";
    sha256 = "1b2jdqs526ac635yb2whm049spcsk7almnnr6r5b4yqhq922anw3";
  };

  postPatch = ''
    sed -i src/src.pro \
        -e 's/lib64/lib/g' \
        -e '/features.path =/ s|$$\[QMAKE_MKSPECS\]|$$NIX_OUTPUT_DEV/mkspecs|'
  '';

  buildInputs = [
    qtbase
    qca-qt5
  ];
  nativeBuildInputs = [ qmake ];

  env = {
    NIX_CFLAGS_COMPILE = "-I${qca-qt5}/include/Qca-qt5/QtCrypto";
    NIX_LDFLAGS = "-lqca-qt5";
  };

  dontWrapQtApps = true;

  meta = {
    description = "Qt library for OAuth authentication";
    homepage = "https://github.com/ayoy/qoauth";
    inherit (qtbase.meta) platforms;
    license = lib.licenses.lgpl21;
  };
}