diff options
-rw-r--r-- | net-libs/mbedtls/Manifest | 1 | ||||
-rw-r--r-- | net-libs/mbedtls/mbedtls-2.4.1.ebuild | 94 |
2 files changed, 95 insertions, 0 deletions
diff --git a/net-libs/mbedtls/Manifest b/net-libs/mbedtls/Manifest index fb04a5cfdd83..e91f29aaa4a2 100644 --- a/net-libs/mbedtls/Manifest +++ b/net-libs/mbedtls/Manifest @@ -1,3 +1,4 @@ DIST mbedtls-2.2.1.tar.gz 1807209 SHA256 32819c62c20e8740a11b49daa5d09ac6f179edf120a87ac559cd63120b66b699 SHA512 bc97e7ddf2fcbd1c22927f5c01cfd0706a6f1051f5a62f42e97db49dcd98afbee8878b1dd815da830e3fe1b66b04ada8a0a88baf32833b2c13070c2bd29b62d5 WHIRLPOOL 2ae84564a0e35de60539030fac913396acf385e948095c2e9ee2cfe9d814c90a448d596a75cdffbb054a63ffe0a1a87b9161d5d512ec4bc7935e97803c39d139 DIST mbedtls-2.3.0.tar.gz 1834271 SHA256 1614ee70be99a18ca8298148308fb725aad4ad31c569438bb51655a4999b14f9 SHA512 f8ddfa791dbefca4005711e55802a65da74e6e161350929faef37f976804f486a1cad7ac6abc30ac2a21ff847c772048564fc91d0ee1d8823bb4b6dbca9af7eb WHIRLPOOL 56244f55340a4414d1189bbd051326ca79d10eec3df2ad425007dd4709401912b5d3faf8c537213a244629c81942fa586685d37afaa920b78e14829e96b0b1b9 DIST mbedtls-2.4.0-apache.tgz 1917968 SHA256 c1c3559ed39f7a1b1550c4cf4ccb918bf239301a3311d98dda92bed8a25b7f0d SHA512 da6e429a5c5c81238bc11816b68fd832730bf4eb48d1dc5b6eeaed234103fb20bd46052eeea5faf91d4df95d9045b3e43c54caa8f7e600974801280a06af67ae WHIRLPOOL 0b49541e99bbed3a099b5c57cf8648dce932ed8899bb23522f40a424ff933258ae95fedd061b81323e31a19ae2f2067ae427ecc9cf371497900e81844179d226 +DIST mbedtls-2.4.1.tar.gz 1854727 SHA256 0c85fe59e1f0426b1c8f17efdc0c41bd531828b6cff746c392beb53c774af4cb SHA512 c452ec701c90bca236be1fbacb728036a01eca257c9df8b0d738e02f4a3570183e34ae23221ca61933dd34e42ca7659bae9ce5de0a6fdd870e77c4b7154d3688 WHIRLPOOL ccf4229e0504b59dd021ce7e0bf449e58c0c8c26e1f088827b6dc801cdaddc296400bac8afba58b282740a107f2462bccf544cd6f943bf98a0382c66f6875652 diff --git a/net-libs/mbedtls/mbedtls-2.4.1.ebuild b/net-libs/mbedtls/mbedtls-2.4.1.ebuild new file mode 100644 index 000000000000..4767377c8a47 --- /dev/null +++ b/net-libs/mbedtls/mbedtls-2.4.1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit cmake-utils multilib-minimal + +DESCRIPTION="Cryptographic library for embedded systems" +HOMEPAGE="https://tls.mbed.org/" +SRC_URI="https://github.com/ARMmbed/mbedtls/archive/${P}.tar.gz" +S=${WORKDIR}/${PN}-${P} + +LICENSE="Apache-2.0" +SLOT="0/10" # slot for libmbedtls.so +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="cpu_flags_x86_sse2 doc havege libressl programs test threads zlib" + +RDEPEND=" + programs? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen media-gfx/graphviz ) + test? ( dev-lang/perl )" + +enable_mbedtls_option() { + local myopt="$@" + # check that config.h syntax is the same at version bump + sed -i \ + -e "s://#define ${myopt}:#define ${myopt}:" \ + include/mbedtls/config.h || die +} + +src_prepare() { + use cpu_flags_x86_sse2 && enable_mbedtls_option MBEDTLS_HAVE_SSE2 + use zlib && enable_mbedtls_option MBEDTLS_ZLIB_SUPPORT + use havege && enable_mbedtls_option MBEDTLS_HAVEGE_C + use threads && enable_mbedtls_option MBEDTLS_THREADING_C + use threads && enable_mbedtls_option MBEDTLS_THREADING_PTHREAD + + cmake-utils_src_prepare +} + +multilib_src_configure() { + local mycmakeargs=( + -DENABLE_PROGRAMS=$(multilib_native_usex programs) + -DENABLE_ZLIB_SUPPORT=$(usex zlib) + -DUSE_STATIC_MBEDTLS_LIBRARY=OFF + -DENABLE_TESTING=$(usex test) + -DUSE_SHARED_MBEDTLS_LIBRARY=ON + -DINSTALL_MBEDTLS_HEADERS=ON + -DLIB_INSTALL_DIR="/usr/$(get_libdir)" + ) + + cmake-utils_src_configure +} + +multilib_src_compile() { + cmake-utils_src_compile + use doc && multilib_is_native_abi && emake apidoc +} + +multilib_src_test() { + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_DIR}/library" \ + cmake-utils_src_test +} + +multilib_src_install() { + cmake-utils_src_install +} + +multilib_src_install_all() { + use doc && HTML_DOCS=( apidoc ) + + einstalldocs + + if use programs ; then + # avoid file collisions with sys-apps/coreutils + local p e + for p in "${ED%/}"/usr/bin/* ; do + if [[ -x "${p}" && ! -d "${p}" ]] ; then + mv "${p}" "${ED%/}"/usr/bin/mbedtls_${p##*/} || die + fi + done + for e in aes hash pkey ssl test ; do + docinto "${e}" + dodoc programs/"${e}"/*.c + dodoc programs/"${e}"/*.txt + done + fi +} |