about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/pinentry/mac.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/pinentry/mac.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/pinentry/mac.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/pinentry/mac.nix b/nixpkgs/pkgs/tools/security/pinentry/mac.nix
new file mode 100644
index 000000000000..8168aa94b3d2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/pinentry/mac.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, xcbuildHook, libiconv, Cocoa, ncurses, cf-private }:
+
+stdenv.mkDerivation rec {
+  name = "pinentry-mac-0.9.4";
+
+  src = fetchFromGitHub {
+    owner = "matthewbauer";
+    repo = "pinentry-mac";
+    rev = "6dfef256c8ea32d642fea847f27d800f024cf51e";
+    sha256 = "0g75302697gqcxyf2hyqzvcbd5pyss1bl2xvfd40wqav7dlyvj83";
+  };
+
+  nativeBuildInputs = [ xcbuildHook ];
+
+  buildInputs = [
+    libiconv Cocoa ncurses
+    # Needed for OBJC_CLASS_$_NSArray symbols.
+    cf-private
+  ];
+
+  installPhase = ''
+    mkdir -p $out/Applications
+    mv Products/Release/pinentry-mac.app $out/Applications
+  '';
+
+  passthru = {
+    binaryPath = "Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac";
+  };
+
+  meta = {
+    description = "Pinentry for GPG on Mac";
+    license = stdenv.lib.licenses.gpl2Plus;
+    homepage = https://github.com/GPGTools/pinentry-mac;
+    platforms = stdenv.lib.platforms.darwin;
+  };
+}