pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/pinentry-fltk security/pinentry-fltk: import ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d28fea3c9ff9
branches:  trunk
changeset: 329675:d28fea3c9ff9
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Wed Feb 13 17:39:36 2019 +0000

description:
security/pinentry-fltk: import pinentry-fltk-1.1.0

Packaged for wip by Michael B?uerle.

This is a collection of simple PIN or passphrase entry dialogs which
utilize the Assuan protocol as described by the aegypten project.
It provides programs for several graphical toolkits, such as FLTK,
GTK+ and QT, as well as for the console, using curses.

This package contains the FLTK frontend.

diffstat:

 security/pinentry-fltk/DESCR                       |   6 +
 security/pinentry-fltk/Makefile                    |  22 +++++
 security/pinentry-fltk/PLIST                       |   2 +
 security/pinentry-fltk/patches/patch-fltk_main.cxx |  87 ++++++++++++++++++++++
 4 files changed, 117 insertions(+), 0 deletions(-)

diffs (133 lines):

diff -r 62588b9853c2 -r d28fea3c9ff9 security/pinentry-fltk/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/pinentry-fltk/DESCR      Wed Feb 13 17:39:36 2019 +0000
@@ -0,0 +1,6 @@
+This is a collection of simple PIN or passphrase entry dialogs which
+utilize the Assuan protocol as described by the aegypten project.
+It provides programs for several graphical toolkits, such as FLTK,
+GTK+ and QT, as well as for the console, using curses.
+
+This package contains the FLTK frontend.
diff -r 62588b9853c2 -r d28fea3c9ff9 security/pinentry-fltk/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/pinentry-fltk/Makefile   Wed Feb 13 17:39:36 2019 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile,v 1.1 2019/02/13 17:39:36 wiz Exp $
+
+PKGNAME=               ${DISTNAME:S/pinentry-/pinentry-fltk-/}
+COMMENT=               Applications for entering PINs or Passphrases, FLTK enabled
+
+.include               "../../security/pinentry/Makefile.common"
+
+USE_LANGUAGES+=                c c++
+USE_TOOLS+=            pkg-config
+
+CONFIGURE_ARGS+=       --disable-pinentry-gtk2
+CONFIGURE_ARGS+=        --disable-pinentry-qt
+CONFIGURE_ARGS+=        --disable-pinentry-curses
+CONFIGURE_ARGS+=        --disable-pinentry-emacs
+#CONFIGURE_ARGS+=       --disable-fallback-curses
+CONFIGURE_ARGS+=        --disable-pinentry-gnome3
+CONFIGURE_ARGS+=        --disable-libsecret
+
+INSTALL_DIRS=          fltk
+
+.include "../../x11/fltk13/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 62588b9853c2 -r d28fea3c9ff9 security/pinentry-fltk/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/pinentry-fltk/PLIST      Wed Feb 13 17:39:36 2019 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2019/02/13 17:39:36 wiz Exp $
+bin/pinentry-fltk
diff -r 62588b9853c2 -r d28fea3c9ff9 security/pinentry-fltk/patches/patch-fltk_main.cxx
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/pinentry-fltk/patches/patch-fltk_main.cxx        Wed Feb 13 17:39:36 2019 +0000
@@ -0,0 +1,87 @@
+$NetBSD: patch-fltk_main.cxx,v 1.1 2019/02/13 17:39:36 wiz Exp $
+
+Handle '_' in labels as keyboard shortcuts (used by GPG2).
+Fix format string handling (Patch from Debian).
+
+--- fltk/main.cxx.orig 2017-12-03 16:13:05.000000000 +0000
++++ fltk/main.cxx
+@@ -78,6 +78,44 @@ static std::string escape_accel_utf8(con
+       return result;
+ }
+ 
++// For button labels
++// Accelerator '_' (used e.g. by GPG2) is converted to '&' (for FLTK)
++// '&' is escaped as in escape_accel_utf8()
++static std::string convert_accel_utf8(const char *s)
++{
++      static bool last_was_underscore = false;
++      std::string result;
++      if (NULL != s)
++      {
++              result.reserve(strlen(s));
++              for (const char *p = s; *p; ++p)
++              {
++                      // & => &&
++                      if ('&' == *p)
++                              result.push_back(*p);
++                      // _ => & (handle '__' as escaped underscore)
++                      if ('_' == *p)
++                      {
++                              if (last_was_underscore)
++                              {
++                                      result.push_back(*p);
++                                      last_was_underscore = false;
++                              }
++                              else
++                                      last_was_underscore = true;
++                      }
++                      else
++                      {
++                              if (last_was_underscore)
++                                      result.push_back('&');
++                              result.push_back(*p);
++                              last_was_underscore = false;
++                      }
++              }
++      }
++      return result;
++}
++
+ class cancel_exception
+ {
+ 
+@@ -111,8 +149,8 @@ static int fltk_cmd_handler(pinentry_t p
+               // TODO: Add parent window to pinentry-fltk window
+               //if (pe->parent_wid){}
+               std::string title  = !is_empty(pe->title)?pe->title:PGMNAME;
+-              std::string ok     = escape_accel_utf8(pe->ok?pe->ok:(pe->default_ok?pe->default_ok:OK_STRING));
+-              std::string cancel = escape_accel_utf8(pe->cancel?pe->cancel:(pe->default_cancel?pe->default_cancel:CANCEL_STRING));
++              std::string ok     = convert_accel_utf8(pe->ok?pe->ok:(pe->default_ok?pe->default_ok:OK_STRING));
++              std::string cancel = convert_accel_utf8(pe->cancel?pe->cancel:(pe->default_cancel?pe->default_cancel:CANCEL_STRING));
+ 
+               if (!!pe->pin) // password (or confirmation)
+               {
+@@ -241,12 +279,12 @@ static int fltk_cmd_handler(pinentry_t p
+                               if (pe->one_button)
+                               {
+                                       fl_ok = ok.c_str();
+-                                      fl_message(message);
++                                      fl_message("%s", message);
+                                       result = 1; // OK
+                               }
+                               else if (pe->notok)
+                               {
+-                                      switch (fl_choice(message, ok.c_str(), cancel.c_str(), pe->notok))
++                                      switch (fl_choice("%s", ok.c_str(), cancel.c_str(), pe->notok, message))
+                                       {
+                                       case 0: result = 1; break;
+                                       case 2: result = 0; break;
+@@ -256,7 +294,7 @@ static int fltk_cmd_handler(pinentry_t p
+                               }
+                               else
+                               {
+-                                      switch (fl_choice(message, ok.c_str(), cancel.c_str(), NULL))
++                                      switch (fl_choice("%s", ok.c_str(), cancel.c_str(), NULL, message))
+                                       {
+                                       case 0: result = 1; break;
+                                       default:



Home | Main Index | Thread Index | Old Index