about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qca/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qca/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/qca/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qca/default.nix b/nixpkgs/pkgs/development/libraries/qca/default.nix
new file mode 100644
index 000000000000..6e2afe6f0deb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qca/default.nix
@@ -0,0 +1,35 @@
+{ 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.7";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/qca/${version}/qca-${version}.tar.xz";
+    sha256 = "sha256-/uI0O1RofVvj4w+zPOKW7lCseuXiPXq3JfY//fevP0M=";
+  };
+
+  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 = with lib; {
+    description = "Qt Cryptographic Architecture";
+    homepage = "https://invent.kde.org/libraries/qca";
+    maintainers = with maintainers; [ ttuegel ];
+    license = licenses.lgpl21Plus;
+    platforms = with platforms; unix;
+  };
+}