2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, qt4 ? null
|
2016-09-07 11:36:24 +02:00
|
|
|
, withQt5 ? false, qtbase ? null, qttools ? null
|
2018-03-12 00:44:55 +01:00
|
|
|
, darwin ? null
|
2019-04-27 17:15:05 +02:00
|
|
|
, libsecret
|
2016-09-07 11:36:24 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert withQt5 -> qtbase != null;
|
|
|
|
assert withQt5 -> qttools != null;
|
2018-03-12 00:44:55 +01:00
|
|
|
assert stdenv.isDarwin -> darwin != null;
|
2014-11-17 01:21:09 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-07 11:36:24 +02:00
|
|
|
name = "qtkeychain-${if withQt5 then "qt5" else "qt4"}-${version}";
|
2018-08-24 06:15:33 +02:00
|
|
|
version = "0.9.1"; # verify after nix-build with `grep -R "set(PACKAGE_VERSION " result/`
|
2014-11-17 01:21:09 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "frankosterfeld";
|
|
|
|
repo = "qtkeychain";
|
|
|
|
rev = "v${version}";
|
2018-08-24 06:15:33 +02:00
|
|
|
sha256 = "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"; # v0.9.1
|
2014-11-17 01:21:09 +01:00
|
|
|
};
|
|
|
|
|
2021-01-12 12:50:23 +01:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2019-10-20 14:33:57 +02:00
|
|
|
patches = (if withQt5 then [] else [ ./0001-Fixes-build-with-Qt4.patch ]) ++ (if stdenv.isDarwin then [ ./0002-Fix-install-name-Darwin.patch ] else []);
|
2018-09-05 09:28:50 +02:00
|
|
|
|
2019-01-26 05:32:44 +01:00
|
|
|
cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ];
|
2014-11-17 01:21:09 +01:00
|
|
|
|
2019-04-27 17:15:05 +02:00
|
|
|
nativeBuildInputs = [ cmake ]
|
2021-01-21 18:00:13 +01:00
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ pkg-config ] # for finding libsecret
|
2019-04-27 17:15:05 +02:00
|
|
|
;
|
2016-09-07 11:36:24 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
2019-04-27 17:15:05 +02:00
|
|
|
++ (if withQt5 then [ qtbase qttools ] else [ qt4 ])
|
2021-01-21 18:00:13 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
2019-04-27 17:15:05 +02:00
|
|
|
CoreFoundation Security
|
2018-03-12 00:44:55 +01:00
|
|
|
])
|
|
|
|
;
|
2014-11-17 01:21:09 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Platform-independent Qt API for storing passwords securely";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/frankosterfeld/qtkeychain";
|
2021-01-21 18:00:13 +01:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.unix;
|
2014-11-17 01:21:09 +01:00
|
|
|
};
|
|
|
|
}
|