dev-libs/libgcrypt: amd64 stable wrt bug #693108
[gentoo.git] / dev-libs / libgcrypt / libgcrypt-1.8.5.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools flag-o-matic multilib-minimal
7
8 DESCRIPTION="General purpose crypto library based on the code used in GnuPG"
9 HOMEPAGE="http://www.gnupg.org/"
10 SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2"
11
12 LICENSE="LGPL-2.1 MIT"
13 SLOT="0/20" # subslot = soname major version
14 KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="doc o-flag-munging static-libs"
16
17 RDEPEND=">=dev-libs/libgpg-error-1.25[${MULTILIB_USEDEP}]"
18 DEPEND="${RDEPEND}"
19 BDEPEND="doc? ( virtual/texi2dvi )"
20
21 PATCHES=(
22         "${FILESDIR}"/${PN}-1.6.1-uscore.patch
23         "${FILESDIR}"/${PN}-multilib-syspath.patch
24 )
25
26 MULTILIB_CHOST_TOOLS=(
27         /usr/bin/libgcrypt-config
28 )
29
30 src_prepare() {
31         default
32         eautoreconf
33 }
34
35 multilib_src_configure() {
36         if [[ ${CHOST} == *86*-solaris* ]] ; then
37                 # ASM code uses GNU ELF syntax, divide in particular, we need to
38                 # allow this via ASFLAGS, since we don't have a flag-o-matic
39                 # function for that, we'll have to abuse cflags for this
40                 append-cflags -Wa,--divide
41         fi
42         local myeconfargs=(
43                 --disable-dependency-tracking
44                 --enable-noexecstack
45                 $(use_enable o-flag-munging O-flag-munging)
46                 $(use_enable static-libs static)
47
48                 # disabled due to various applications requiring privileges
49                 # after libgcrypt drops them (bug #468616)
50                 --without-capabilities
51
52                 # http://trac.videolan.org/vlc/ticket/620
53                 # causes bus-errors on sparc64-solaris
54                 $([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
55                 $([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
56
57                 GPG_ERROR_CONFIG="${EROOT}/usr/bin/${CHOST}-gpg-error-config"
58         )
59         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" \
60                 $("${S}/configure" --help | grep -- '--without-.*-prefix' | sed -e 's/^ *\([^ ]*\) .*/\1/g')
61 }
62
63 multilib_src_compile() {
64         default
65         multilib_is_native_abi && use doc && VARTEXFONTS="${T}/fonts" emake -C doc gcrypt.pdf
66 }
67
68 multilib_src_install() {
69         emake DESTDIR="${D}" install
70         multilib_is_native_abi && use doc && dodoc doc/gcrypt.pdf
71 }
72
73 multilib_src_install_all() {
74         default
75         find "${D}" -name '*.la' -delete || die
76 }