1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 qtbase,
8 qttools,
9 libsecret,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "qtkeychain";
14 version = "0.15.0";
15
16 src = fetchFromGitHub {
17 owner = "frankosterfeld";
18 repo = "qtkeychain";
19 rev = version;
20 sha256 = "sha256-/gdozAJbjaaCcttQED2PixaFNRDZOXbBIoV9QLexNUg=";
21 };
22
23 dontWrapQtApps = true;
24
25 cmakeFlags = [
26 "-DBUILD_WITH_QT6=${if lib.versions.major qtbase.version == "6" then "ON" else "OFF"}"
27 "-DQT_TRANSLATIONS_DIR=share/qt/translations"
28 ];
29
30 nativeBuildInputs = [ cmake ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ] # for finding libsecret
31 ;
32
33 buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ libsecret ] ++ [
34 qtbase
35 qttools
36 ];
37
38 doInstallCheck = true;
39
40 # we previously had a note in here saying to run this check manually, so we might as
41 # well do it automatically. It seems like a perfectly valid sanity check, but I
42 # have no idea *why* we might need it
43 installCheckPhase = ''
44 runHook preInstallCheck
45
46 grep --quiet -R 'set(PACKAGE_VERSION "${version}"' .
47
48 runHook postInstallCheck
49 '';
50
51 meta = {
52 description = "Platform-independent Qt API for storing passwords securely";
53 homepage = "https://github.com/frankosterfeld/qtkeychain";
54 license = lib.licenses.bsd3;
55 platforms = lib.platforms.unix;
56 };
57}