dev-libs/libgcrypt: attempt to fix x32 issue
[portage-overlay.git] / dev-libs / libgcrypt / libgcrypt-1.6.1-r2.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/libgcrypt/libgcrypt-1.6.1-r1.ebuild,v 1.4 2014/06/18 19:14:04 mgorny Exp $
4
5 EAPI=5
6 AUTOTOOLS_AUTORECONF=1
7
8 inherit autotools-multilib flag-o-matic
9
10 DESCRIPTION="General purpose crypto library based on the code used in GnuPG"
11 HOMEPAGE="http://www.gnupg.org/"
12 SRC_URI="mirror://gnupg/libgcrypt/${P}.tar.bz2
13         ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
14
15 LICENSE="LGPL-2.1 MIT"
16 SLOT="0/20" # subslot = soname major version
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
18 IUSE="static-libs"
19
20 RDEPEND=">=dev-libs/libgpg-error-1.12[${MULTILIB_USEDEP}]
21         abi_x86_32? (
22                 !<=app-emulation/emul-linux-x86-baselibs-20131008-r19
23                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
24         )"
25 DEPEND="${RDEPEND}"
26
27 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
28
29 PATCHES=(
30         "${FILESDIR}"/${P}-uscore.patch
31         "${FILESDIR}"/${PN}-multilib-syspath.patch
32         "${FILESDIR}"/${PN}-1.6.0-serial-tests.patch
33         "${FILESDIR}"/${PN}-1.6.1-x32-compat.patch
34 )
35
36 MULTILIB_CHOST_TOOLS=(
37         /usr/bin/libgcrypt-config
38 )
39
40 multilib_src_configure() {
41         if [[ ${CHOST} == *86*-solaris* ]] ; then
42                 # ASM code uses GNU ELF syntax, divide in particular, we need to
43                 # allow this via ASFLAGS, since we don't have a flag-o-matic
44                 # function for that, we'll have to abuse cflags for this
45                 append-cflags -Wa,--divide
46         fi
47         local myeconfargs=(
48                 --disable-padlock-support # bug 201917
49                 --disable-dependency-tracking
50                 --enable-noexecstack
51                 --disable-O-flag-munging
52                 $(use_enable static-libs static)
53
54                 # disabled due to various applications requiring privileges
55                 # after libgcrypt drops them (bug #468616)
56                 --without-capabilities
57
58                 # http://trac.videolan.org/vlc/ticket/620
59                 # causes bus-errors on sparc64-solaris
60                 $([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
61                 $([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
62         )
63         autotools-utils_src_configure
64 }