Gentoo Archives: gentoo-commits

From: Kristian Fiskerstrand <k_f@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/pinentry/, app-crypt/pinentry/files/
Date: Tue, 29 Sep 2015 19:31:16
Message-Id: 1443554880.e1b3fca42c9882378320d3eb8538eb05f283ef05.k_f@gentoo
1 commit: e1b3fca42c9882378320d3eb8538eb05f283ef05
2 Author: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 29 19:25:20 2015 +0000
4 Commit: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 29 19:28:00 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b3fca4
7
8 app-crypt/pinentry-0.9.6-r5: Add Qt5 support
9
10 Package-Manager: portage-2.2.20.1
11
12 ...try-0.9.6-add-disable-pinentry-qt5-option.patch | 55 +++++++++
13 app-crypt/pinentry/pinentry-0.9.6-r5.ebuild | 123 +++++++++++++++++++++
14 2 files changed, 178 insertions(+)
15
16 diff --git a/app-crypt/pinentry/files/pinentry-0.9.6-add-disable-pinentry-qt5-option.patch b/app-crypt/pinentry/files/pinentry-0.9.6-add-disable-pinentry-qt5-option.patch
17 new file mode 100644
18 index 0000000..9522c2f
19 --- /dev/null
20 +++ b/app-crypt/pinentry/files/pinentry-0.9.6-add-disable-pinentry-qt5-option.patch
21 @@ -0,0 +1,55 @@
22 +From 08ec9556c8a384ea7bb5d42d3f6aab6c2f6a8786 Mon Sep 17 00:00:00 2001
23 +From: Andre Heinecke <aheinecke@××××××××××.de>
24 +Date: Fri, 25 Sep 2015 15:56:55 +0200
25 +Subject: [PATCH] Add option to disable looking for qt5
26 +
27 +* m4/qt.m4 (FIND_QT): Add --disable-pinentry-qt5 option to
28 +disable qt5 support even if it is available.
29 +
30 +--
31 +As requested by Kristan F.
32 +
33 +GnuPG-bug-id: 2105
34 +---
35 + m4/qt.m4 | 23 ++++++++++++++++-------
36 + 1 file changed, 16 insertions(+), 7 deletions(-)
37 +
38 +diff --git a/m4/qt.m4 b/m4/qt.m4
39 +index 0a7ea99..0e47ec6 100644
40 +--- a/m4/qt.m4
41 ++++ b/m4/qt.m4
42 +@@ -28,15 +28,24 @@ dnl The moc lookup code is based on libpoppler (rev. d821207)
43 +
44 + AC_DEFUN([FIND_QT],
45 + [
46 +- PKG_CHECK_MODULES(PINENTRY_QT,
47 +- Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0,
48 +- [have_qt5_libs="yes"],
49 +- [have_qt5_libs="no"])
50 ++ AC_ARG_ENABLE(pinentry-qt5,
51 ++ AC_HELP_STRING([--disable-pinentry-qt5],
52 ++ [Don't use qt5 even if it is available.]),
53 ++ enable_pinentry_qt5=$enableval,
54 ++ enable_pinentry_qt5="try")
55 +
56 +- if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then
57 +- PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic"
58 +- fi
59 ++ have_qt5_libs="no";
60 ++
61 ++ if test "$enable_pinentry_qt5" != "no"; then
62 ++ PKG_CHECK_MODULES(PINENTRY_QT,
63 ++ Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0,
64 ++ [have_qt5_libs="yes"],
65 ++ [have_qt5_libs="no"])
66 +
67 ++ if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then
68 ++ PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic"
69 ++ fi
70 ++ fi
71 + if test "$have_qt5_libs" = "yes"; then
72 + AC_CHECK_TOOL(MOC, moc)
73 + AC_MSG_CHECKING([moc version])
74 +--
75 +2.1.4
76 +
77
78 diff --git a/app-crypt/pinentry/pinentry-0.9.6-r5.ebuild b/app-crypt/pinentry/pinentry-0.9.6-r5.ebuild
79 new file mode 100644
80 index 0000000..6e10cf8
81 --- /dev/null
82 +++ b/app-crypt/pinentry/pinentry-0.9.6-r5.ebuild
83 @@ -0,0 +1,123 @@
84 +# Copyright 1999-2015 Gentoo Foundation
85 +# Distributed under the terms of the GNU General Public License v2
86 +# $Id$
87 +
88 +EAPI=5
89 +
90 +inherit autotools qmake-utils multilib eutils flag-o-matic toolchain-funcs
91 +
92 +DESCRIPTION="Collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol"
93 +HOMEPAGE="http://gnupg.org/aegypten2/index.html"
94 +SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2"
95 +
96 +LICENSE="GPL-2"
97 +SLOT="0"
98 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
99 +IUSE="emacs gtk ncurses qt4 qt5 caps gnome-keyring static"
100 +
101 +CDEPEND="
102 + >=dev-libs/libgpg-error-1.17
103 + >=dev-libs/libassuan-2
104 + >=dev-libs/libgcrypt-1.6.3
105 + ncurses? ( sys-libs/ncurses:0= )
106 + gtk? ( x11-libs/gtk+:2 )
107 + qt4? (
108 + >=dev-qt/qtgui-4.4.1:4
109 + )
110 + qt5? (
111 + dev-qt/qtgui:5
112 + dev-qt/qtwidgets:5
113 + )
114 + caps? ( sys-libs/libcap )
115 + static? ( >=sys-libs/ncurses-5.7-r5:0=[static-libs,-gpm] )
116 + app-eselect/eselect-pinentry
117 + gnome-keyring? ( app-crypt/libsecret )
118 +"
119 +
120 +DEPEND="${CDEPEND}
121 + sys-devel/gettext
122 + virtual/pkgconfig
123 +"
124 +
125 +RDEPEND="
126 + ${CDEPEND}
127 + gnome-keyring? ( app-crypt/gcr )
128 +"
129 +
130 +REQUIRED_USE="
131 + || ( ncurses gtk qt4 )
132 + gtk? ( !static )
133 + qt4? ( !static )
134 + qt5? ( !static )
135 + static? ( ncurses )
136 + ?? ( qt4 qt5 )
137 +"
138 +
139 +DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
140 +
141 +src_prepare() {
142 + epatch "${FILESDIR}/${PN}-0.8.2-ncurses.patch"
143 + epatch "${FILESDIR}/${P}-add-disable-pinentry-qt5-option.patch"
144 + eautoreconf
145 +}
146 +
147 +src_configure() {
148 + local myconf=()
149 + use static && append-ldflags -static
150 + [[ "$(gcc-major-version)" -ge 5 ]] && append-cxxflags -std=gnu++11
151 +
152 + QT_MOC=""
153 + if use qt4; then
154 + myconf+=( --enable-pinentry-qt
155 + --disable-pinentry-qt5
156 + )
157 + QT_MOC="$(qt4_get_bindir)"/moc
158 + # Issues finding qt on multilib systems
159 + export QTLIB="$(qt4_get_libdir)"
160 + elif use qt5; then
161 + myconf+=( --enable-pinentry-qt )
162 + QT_MOC="$(qt5_get_bindir)"/moc
163 + export QTLIB="$(qt5_get_libdir)"
164 + else
165 + myconf+=( --disable-pinentry-qt )
166 + fi
167 +
168 + econf \
169 + --enable-pinentry-tty \
170 + $(use_enable emacs pinentry-emacs) \
171 + $(use_enable gtk pinentry-gtk2) \
172 + $(use_enable ncurses pinentry-curses) \
173 + $(use_enable ncurses fallback-curses) \
174 + $(use_with caps libcap) \
175 + $(use_enable gnome-keyring libsecret) \
176 + $(use_enable gnome-keyring pinentry-gnome3) \
177 + "${myconf[@]}" \
178 + MOC="${QT_MOC}"
179 +}
180 +
181 +src_install() {
182 + default
183 + rm -f "${ED}"/usr/bin/pinentry || die
184 +
185 + if use_enable qt4 || use_enable qt5; then
186 + dosym pinentry-qt /usr/bin/pinentry-qt4
187 + fi
188 +}
189 +
190 +pkg_postinst() {
191 + if ! has_version 'app-crypt/pinentry' || has_version '<app-crypt/pinentry-0.7.3'; then
192 + elog "We no longer install pinentry-curses and pinentry-qt SUID root by default."
193 + elog "Linux kernels >=2.6.9 support memory locking for unprivileged processes."
194 + elog "The soft resource limit for memory locking specifies the limit an"
195 + elog "unprivileged process may lock into memory. You can also use POSIX"
196 + elog "capabilities to allow pinentry to lock memory. To do so activate the caps"
197 + elog "USE flag and add the CAP_IPC_LOCK capability to the permitted set of"
198 + elog "your users."
199 + fi
200 +
201 + eselect pinentry update ifunset
202 +}
203 +
204 +pkg_postrm() {
205 + eselect pinentry update ifunset
206 +}