dev-python/csv23: arm64 keyworded (bug #719700)
[gentoo.git] / app-crypt / gpgme / gpgme-1.13.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 DISTUTILS_OPTIONAL=1
8
9 inherit distutils-r1 flag-o-matic libtool qmake-utils toolchain-funcs
10
11 DESCRIPTION="GnuPG Made Easy is a library for making GnuPG easier to use"
12 HOMEPAGE="http://www.gnupg.org/related_software/gpgme"
13 SRC_URI="mirror://gnupg/gpgme/${P}.tar.bz2"
14
15 LICENSE="GPL-2 LGPL-2.1"
16 SLOT="1/11" # subslot = soname major version
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
18 IUSE="common-lisp static-libs +cxx python qt5"
19
20 RDEPEND=">=app-crypt/gnupg-2
21         >=dev-libs/libassuan-2.5.3:=
22         >=dev-libs/libgpg-error-1.29:=
23         python? ( ${PYTHON_DEPS} )
24         qt5? ( dev-qt/qtcore:5 )"
25         #doc? ( app-doc/doxygen[dot] )
26 DEPEND="${RDEPEND}
27         qt5? ( dev-qt/qttest:5 )"
28 BDEPEND="python? ( dev-lang/swig )"
29
30 REQUIRED_USE="qt5? ( cxx ) python? ( ${PYTHON_REQUIRED_USE} )"
31
32 do_python() {
33         if use python; then
34                 pushd "lang/python" > /dev/null || die
35                 top_builddir="../.." srcdir="." CPP=$(tc-getCPP) distutils-r1_src_${EBUILD_PHASE}
36                 popd > /dev/null
37         fi
38 }
39
40 pkg_setup() {
41         addpredict /run/user/$(id -u)/gnupg
42
43         local MAX_WORKDIR=66
44         if [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then
45                 ewarn "Disabling tests as WORKDIR '${WORKDIR}' is longer than ${MAX_WORKDIR} which will fail tests"
46                 SKIP_TESTS=1
47         fi
48 }
49
50 src_prepare() {
51         default
52         elibtoolize
53
54         # Make best effort to allow longer PORTAGE_TMPDIR
55         # as usock limitation fails build/tests
56         ln -s "${P}" "${WORKDIR}/b"
57         S="${WORKDIR}/b"
58 }
59
60 src_configure() {
61         local languages=()
62         use common-lisp && languages+=( "cl" )
63         use cxx && languages+=( "cpp" )
64         if use qt5; then
65                 languages+=( "qt" )
66                 #use doc ||
67                 export DOXYGEN=true
68                 export MOC="$(qt5_get_bindir)/moc"
69         fi
70
71         econf \
72                 $([[ -n "${SKIP_TESTS}" ]] && echo "--disable-gpg-test --disable-gpgsm-test") \
73                 --enable-languages="${languages[*]}" \
74                 $(use_enable static-libs static)
75
76         use python && make -C lang/python prepare
77
78         do_python
79 }
80
81 src_compile() {
82         default
83         do_python
84 }
85
86 src_test() {
87         [[ -z "${SKIP_TESTS}" ]] || return
88
89         default
90         if use python; then
91                 test_python() {
92                         emake -C lang/python/tests check \
93                                 PYTHON=${EPYTHON} \
94                                 PYTHONS=${EPYTHON} \
95                                 TESTFLAGS="--python-libdir=${BUILD_DIR}/lib"
96                 }
97                 python_foreach_impl test_python
98         fi
99 }
100
101 src_install() {
102         default
103         do_python
104         find "${D}" -name '*.la' -delete || die
105
106         # backward compatibility for gentoo
107         # in the past we had slots
108         dodir /usr/include/gpgme
109         dosym ../gpgme.h /usr/include/gpgme/gpgme.h
110 }