2016-09-07 11:36:24 +02:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, qt4 ? null
|
|
|
|
, withQt5 ? false, qtbase ? null, qttools ? null
|
2018-03-12 00:44:55 +01:00
|
|
|
, darwin ? null
|
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-03-18 18:35:55 +01:00
|
|
|
version = "0.8.0"; # 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-03-18 18:35:55 +01:00
|
|
|
sha256 = "1r6qp9l2lp5jpc6ciklbg1swvvzcpc37rg9py46hk0wxy6klnm0b"; # v0.8.0
|
2014-11-17 01:21:09 +01:00
|
|
|
};
|
|
|
|
|
2018-03-12 00:44:55 +01:00
|
|
|
cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin [
|
|
|
|
# correctly detect the compiler
|
|
|
|
# for details see cmake --help-policy CMP0025
|
|
|
|
"-DCMAKE_POLICY_DEFAULT_CMP0025=NEW"
|
|
|
|
]
|
|
|
|
;
|
2014-11-17 01:21:09 +01:00
|
|
|
|
2016-09-07 11:36:24 +02:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2018-03-12 00:44:55 +01:00
|
|
|
buildInputs = if withQt5 then [ qtbase qttools ] else [ qt4 ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
|
|
CoreFoundation Security
|
|
|
|
])
|
|
|
|
;
|
2014-11-17 01:21:09 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Platform-independent Qt API for storing passwords securely";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://github.com/frankosterfeld/qtkeychain;
|
2014-11-18 20:33:18 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2018-03-12 00:44:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2014-11-17 01:21:09 +01:00
|
|
|
};
|
|
|
|
}
|