2019-03-22 00:08:30 +01:00
|
|
|
# Copyright 1999-2019 Gentoo Authors
|
2012-08-08 09:19:20 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-03-22 00:08:30 +01:00
|
|
|
EAPI="7"
|
2012-08-08 09:19:20 +02:00
|
|
|
|
2019-03-22 00:08:30 +01:00
|
|
|
inherit autotools multilib-minimal toolchain-funcs
|
2012-08-08 09:19:20 +02:00
|
|
|
|
|
|
|
DESCRIPTION="modular and portable cryptographic toolkit"
|
2017-02-01 17:23:29 +01:00
|
|
|
HOMEPAGE="http://www.libtom.org/"
|
|
|
|
SRC_URI="https://github.com/libtom/libtomcrypt/releases/download/${PV}/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
|
2019-03-22 00:08:30 +01:00
|
|
|
export LIBTOOL="${S}"/libtool
|
2013-11-11 19:34:13 +01:00
|
|
|
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() {
|
2019-03-22 00:08:30 +01:00
|
|
|
multilib_foreach_abi _emake DESTDIR="${D}" install
|
2013-11-11 19:34:13 +01:00
|
|
|
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
|
|
|
|
}
|