2015-05-26 16:03:36 +02:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2012-08-08 09:19:20 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-21 14:38:36 +02:00
|
|
|
# $Id$
|
2012-08-08 09:19:20 +02:00
|
|
|
|
2013-11-11 19:34:13 +01:00
|
|
|
EAPI="5"
|
2012-08-08 09:19:20 +02:00
|
|
|
|
2013-11-11 19:34:13 +01:00
|
|
|
inherit autotools-multilib eutils flag-o-matic multilib toolchain-funcs
|
2012-08-08 09:19:20 +02:00
|
|
|
|
|
|
|
DESCRIPTION="modular and portable cryptographic toolkit"
|
2015-05-26 16:03:36 +02:00
|
|
|
HOMEPAGE="http://libtom.net/?page=features&whatfile=crypt"
|
|
|
|
SRC_URI="http://libtom.net/files/crypt-${PV}.tar.bz2"
|
2012-08-08 09:19:20 +02:00
|
|
|
|
|
|
|
LICENSE="WTFPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~ppc ~x86"
|
2013-11-11 19:34:13 +01:00
|
|
|
IUSE="doc static-libs"
|
2012-08-08 09:19:20 +02:00
|
|
|
|
2013-11-11 19:34:13 +01:00
|
|
|
RDEPEND="dev-libs/libtommath[static-libs?,${MULTILIB_USEDEP}]"
|
2012-08-08 09:19:20 +02:00
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
doc? ( virtual/latex-base app-text/ghostscript-gpl )"
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
use doc || sed -i '/^install:/s:docs::' makefile
|
2013-11-13 17:03:53 +01:00
|
|
|
epatch "${FILESDIR}"/libtomcrypt-1.17-r7-libtool-tag-and-make-fix.patch
|
2012-08-08 09:19:20 +02:00
|
|
|
sed -i \
|
|
|
|
-e "s:--mode=link gcc:--mode=link $(tc-getCC) ${LDFLAGS} --tag CC $(tc-getCC):g" \
|
|
|
|
-e "s: gcc: $(tc-getCC):g" \
|
|
|
|
{,testprof/}makefile.shared || die
|
2013-11-11 19:34:13 +01:00
|
|
|
|
|
|
|
# need libtool for cross compilation. Bug #376643
|
|
|
|
cat <<-EOF > configure.ac
|
|
|
|
AC_INIT(libtomcrypt, 0)
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
LT_INIT
|
|
|
|
AC_CONFIG_FILES(Makefile)
|
|
|
|
AC_OUTPUT
|
|
|
|
EOF
|
|
|
|
touch NEWS README AUTHORS ChangeLog Makefile.am
|
|
|
|
eautoreconf
|
|
|
|
# export LT="${S}"/libtool
|
|
|
|
multilib_copy_sources
|
2012-08-08 09:19:20 +02:00
|
|
|
}
|
|
|
|
|
2013-11-11 19:34:13 +01:00
|
|
|
_emake() {
|
|
|
|
cd ${BUILD_DIR}
|
|
|
|
emake CC="$(tc-getCC)" -f makefile.shared \
|
|
|
|
EXTRALIBS="-ltommath" \
|
2012-08-08 09:19:20 +02:00
|
|
|
IGNORE_SPEED=1 \
|
2013-11-11 19:34:13 +01:00
|
|
|
LIBPATH="${EPREFIX}/usr/$(get_libdir)" \
|
|
|
|
INCPATH="${EPREFIX}/usr/include" \
|
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
append-cflags -DLTM_DESC
|
|
|
|
multilib_foreach_abi _emake
|
2012-08-08 09:19:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
|
|
|
# Tests don't compile
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2013-11-11 19:34:13 +01:00
|
|
|
multilib_foreach_abi _emake DESTDIR="${ED}" install
|
|
|
|
dodoc TODO changes
|
2012-08-08 09:19:20 +02:00
|
|
|
if use doc ; then
|
2013-11-11 19:34:13 +01:00
|
|
|
dodoc doc/*
|
|
|
|
docinto notes ; dodoc notes/*
|
|
|
|
docinto demos ; dodoc demos/*
|
2012-08-08 09:19:20 +02:00
|
|
|
fi
|
|
|
|
}
|