1{ lib, stdenv, fetchurl, cmake, openssl, pkg-config, qtbase, qt5compat ? null }:
2
3let
4 isQt6 = lib.versions.major qtbase.version == "6";
5in stdenv.mkDerivation rec {
6 pname = "qca";
7 version = "2.3.9";
8
9 src = fetchurl {
10 url = "mirror://kde/stable/qca/${version}/qca-${version}.tar.xz";
11 sha256 = "sha256-xVXVKYzde2uv4rH5YQbzDPpUOiPUWdUMipHqwzxHbk4=";
12 };
13
14 buildInputs = [ openssl qtbase qt5compat ];
15 nativeBuildInputs = [ cmake pkg-config ];
16
17 dontWrapQtApps = true;
18
19 # tells CMake to use this CA bundle file if it is accessible
20 preConfigure = "export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt";
21
22 cmakeFlags = [
23 (lib.cmakeBool "QT6" isQt6)
24 # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
25 "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt"
26 ];
27
28 meta = with lib; {
29 description = "Qt Cryptographic Architecture";
30 homepage = "https://invent.kde.org/libraries/qca";
31 maintainers = with maintainers; [ ttuegel ];
32 license = licenses.lgpl21Plus;
33 platforms = with platforms; unix;
34 };
35}