summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/qca/default.nix
blob: 6c70f1858c9c004b8c15918ce38ccc78067a8883 (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
48
49
50
51
52
{
  lib,
  stdenv,
  fetchurl,
  cmake,
  openssl,
  pkg-config,
  qtbase,
  qt5compat ? null,
}:

let
  isQt6 = lib.versions.major qtbase.version == "6";
in
stdenv.mkDerivation rec {
  pname = "qca";
  version = "2.3.10";

  src = fetchurl {
    url = "mirror://kde/stable/qca/${version}/qca-${version}.tar.xz";
    sha256 = "sha256-HFtyLak9VZNlcZImuxIccm7DwNxMZ96jTx5Q5ODRSgI=";
  };

  buildInputs = [
    openssl
    qtbase
    qt5compat
  ];
  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  dontWrapQtApps = true;

  # tells CMake to use this CA bundle file if it is accessible
  preConfigure = "export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt";

  cmakeFlags = [
    (lib.cmakeBool "QT6" isQt6)
    # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
    "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt"
  ];

  meta = {
    description = "Qt Cryptographic Architecture";
    homepage = "https://invent.kde.org/libraries/qca";
    maintainers = with lib.maintainers; [ ttuegel ];
    license = lib.licenses.lgpl21Plus;
    platforms = with lib.platforms; unix;
  };
}