about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qtkeychain
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/qtkeychain
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qtkeychain')
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/0001-Fixes-build-with-Qt4.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/default.nix45
2 files changed, 70 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qtkeychain/0001-Fixes-build-with-Qt4.patch b/nixpkgs/pkgs/development/libraries/qtkeychain/0001-Fixes-build-with-Qt4.patch
new file mode 100644
index 000000000000..4cd7214e61e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtkeychain/0001-Fixes-build-with-Qt4.patch
@@ -0,0 +1,25 @@
+From f72e5b67ee1137a0ccd57db5d077a197b01b3cdc Mon Sep 17 00:00:00 2001
+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
+Date: Tue, 4 Sep 2018 23:19:29 -0400
+Subject: [PATCH] Fixes build with Qt4.
+
+---
+ keychain_unix.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/keychain_unix.cpp b/keychain_unix.cpp
+index 30b26c3..b27ebef 100644
+--- a/keychain_unix.cpp
++++ b/keychain_unix.cpp
+@@ -91,7 +91,7 @@ static bool isKwallet5Available()
+     // a wallet can be opened.
+ 
+     iface.setTimeout(500);
+-    QDBusMessage reply = iface.call(QStringLiteral("networkWallet"));
++    QDBusMessage reply = iface.call("networkWallet");
+     return reply.type() == QDBusMessage::ReplyMessage;
+ }
+ 
+-- 
+2.16.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
new file mode 100644
index 000000000000..2b3c88d58860
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub, cmake, qt4 ? null
+, withQt5 ? false, qtbase ? null, qttools ? null
+, darwin ? null
+}:
+
+assert withQt5 -> qtbase != null;
+assert withQt5 -> qttools != null;
+assert stdenv.isDarwin -> darwin != null;
+
+stdenv.mkDerivation rec {
+  name = "qtkeychain-${if withQt5 then "qt5" else "qt4"}-${version}";
+  version = "0.9.1";            # verify after nix-build with `grep -R "set(PACKAGE_VERSION " result/`
+
+  src = fetchFromGitHub {
+    owner = "frankosterfeld";
+    repo = "qtkeychain";
+    rev = "v${version}";
+    sha256 = "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"; # v0.9.1
+  };
+
+  patches = if withQt5 then null else [ ./0001-Fixes-build-with-Qt4.patch ];
+
+  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"
+       ]
+   ;
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = if withQt5 then [ qtbase qttools ] else [ qt4 ]
+    ++ stdenv.lib.optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+         CoreFoundation Security
+    ])
+  ;
+
+  meta = {
+    description = "Platform-independent Qt API for storing passwords securely";
+    homepage = https://github.com/frankosterfeld/qtkeychain;
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}