dev-libs/libgcrypt: Clean up 1.7.5-r1
[gentoo.git] / dev-libs / libgcrypt / libgcrypt-1.7.5-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
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 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="doc static-libs"
16
17 RDEPEND=">=dev-libs/libgpg-error-1.12[${MULTILIB_USEDEP}]
18         abi_x86_32? (
19                 !<=app-emulation/emul-linux-x86-baselibs-20131008-r19
20                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
21         )"
22 DEPEND="${RDEPEND}
23         doc? ( virtual/texi2dvi )"
24
25 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
26
27 PATCHES=(
28         "${FILESDIR}"/${PN}-1.6.1-uscore.patch
29         "${FILESDIR}"/${PN}-multilib-syspath.patch
30         "${FILESDIR}"/${P}-fix-nehalem.patch
31 )
32
33 MULTILIB_CHOST_TOOLS=(
34         /usr/bin/libgcrypt-config
35 )
36
37 src_prepare() {
38         default
39         eautoreconf
40 }
41
42 multilib_src_configure() {
43         if [[ ${CHOST} == *86*-solaris* ]] ; then
44                 # ASM code uses GNU ELF syntax, divide in particular, we need to
45                 # allow this via ASFLAGS, since we don't have a flag-o-matic
46                 # function for that, we'll have to abuse cflags for this
47                 append-cflags -Wa,--divide
48         fi
49         local myeconfargs=(
50                 --disable-dependency-tracking
51                 --enable-noexecstack
52                 --disable-O-flag-munging
53                 $(use_enable static-libs static)
54
55                 # disabled due to various applications requiring privileges
56                 # after libgcrypt drops them (bug #468616)
57                 --without-capabilities
58
59                 # http://trac.videolan.org/vlc/ticket/620
60                 # causes bus-errors on sparc64-solaris
61                 $([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
62                 $([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
63         )
64         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
65 }
66
67 multilib_src_compile() {
68         default
69         multilib_is_native_abi && use doc && VARTEXFONTS="${T}/fonts" emake -C doc gcrypt.pdf
70 }
71
72 multilib_src_install() {
73         emake DESTDIR="${D}" install
74         multilib_is_native_abi && use doc && dodoc doc/gcrypt.pdf
75 }