--- /dev/null
+The version taken from GnuPG 1.4 assumes any cross-compiled package have
+prefixed underscores, which is not the case; by using libtool's own macro,
+we can avoid the whole issue.
+
+--- libgcrypt-1.6.1/configure.ac
++++ libgcrypt-1.6.1/configure.ac
+@@ -1022,7 +1022,7 @@
+ # Check whether underscores in symbols are required. This needs to be
+ # done before setting up the assembler stuff.
+ #
+-GNUPG_SYS_SYMBOL_UNDERSCORE()
++LT_SYS_SYMBOL_USCORE
+
+
+ #################################
+--- libgcrypt-1.6.1/mpi/config.links
++++ libgcrypt-1.6.1/mpi/config.links
+@@ -362,7 +362,7 @@
+
+ # Make sysdep.h
+ echo '/* created by config.links - do not edit */' >./mpi/sysdep.h
+-if test x$ac_cv_sys_symbol_underscore = xyes; then
++if test x$sys_symbol_underscore = xyes; then
+ cat <<EOF >>./mpi/sysdep.h
+ #if __STDC__
+ #define C_SYMBOL_NAME(name) _##name
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: Exp $
+# $Id$
EAPI=5
+AUTOTOOLS_AUTORECONF=1
+WANT_AUTOMAKE=1.14
-inherit autotools flag-o-matic user git-2
+inherit autotools-multilib flag-o-matic git-2
DESCRIPTION="General purpose crypto library based on the code used in GnuPG"
-HOMEPAGE="http://gnupg.org/"
-
-WANT_AUTOMAKE=1.14
+HOMEPAGE="http://www.gnupg.org/"
EGIT_REPO_URI="git://git.gnupg.org/${PN}.git"
-LICENSE="GPL-2"
-SLOT="0/20"
+LICENSE="LGPL-2.1 MIT"
+SLOT="0/20" # subslot = soname major version
KEYWORDS=""
+IUSE="doc static-libs +threads"
+
+CDEPEND=">=dev-libs/libgpg-error-1.13[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r19
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+
+DEPEND="${CDEPEND}
+ doc? ( virtual/texi2dvi
+ >=sys-apps/texinfo-5.2:0
+ app-text/ghostscript-gpl )"
-IUSE=""
-
-REQUIRED_USE=""
-#Texinfo version 4.8 segfaults, force higher version.
-CDEPEND=">=dev-libs/libgpg-error-1.13"
-DEPEND="
- >=sys-apps/texinfo-5.2:0
- media-gfx/transfig
- app-text/ghostscript-gpl
- ${CDEPEND}
-"
RDEPEND="${CDEPEND}"
-src_prepare() {
- ./autogen.sh || die "Autogen failed"
-}
+DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.1-uscore.patch
+ "${FILESDIR}"/${PN}-multilib-syspath.patch
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/libgcrypt-config
+)
-src_configure() {
- econf \
+multilib_src_configure() {
+ if [[ ${CHOST} == *86*-solaris* ]] ; then
+ # ASM code uses GNU ELF syntax, divide in particular, we need to
+ # allow this via ASFLAGS, since we don't have a flag-o-matic
+ # function for that, we'll have to abuse cflags for this
+ append-cflags -Wa,--divide
+ fi
+ local myeconfargs=(
--enable-maintainer-mode
+ --disable-dependency-tracking
+ --enable-noexecstack
+ --disable-O-flag-munging
+ $(use_enable static-libs static)
+
+ # disabled due to various applications requiring privileges
+ # after libgcrypt drops them (bug #468616)
+ --without-capabilities
+
+ # http://trac.videolan.org/vlc/ticket/620
+ # causes bus-errors on sparc64-solaris
+ $([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
+ $([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
+ )
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ emake
+ multilib_is_native_abi && use doc && VARTEXFONTS="${T}/fonts" emake -C doc gcrypt.pdf
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+ multilib_is_native_abi && use doc && dodoc doc/gcrypt.pdf
+}
+
+multilib_src_prepare() {
+ ./autogen.sh || die "Autogen failed"
}