From 2acb7c9187a0a54d697dfbe33ad626aa43c5f3f5 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Fri, 17 Apr 2020 08:14:54 -0400 Subject: [PATCH] net-libs/mbedtls: version bump to 2.22.0 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Anthony G. Basile --- net-libs/mbedtls/Manifest | 1 + net-libs/mbedtls/mbedtls-2.22.0.ebuild | 105 +++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 net-libs/mbedtls/mbedtls-2.22.0.ebuild diff --git a/net-libs/mbedtls/Manifest b/net-libs/mbedtls/Manifest index eb506b96667c..05b416b82299 100644 --- a/net-libs/mbedtls/Manifest +++ b/net-libs/mbedtls/Manifest @@ -4,3 +4,4 @@ DIST mbedtls-2.16.6.tar.gz 2603563 BLAKE2B a4011bb2b7e3eca554cded05c4650fc16b48d DIST mbedtls-2.17.0.tar.gz 2738368 BLAKE2B efcf2a6c84a85afdca0205bd9e8bcf039074c5e6f40e0814f835cf26c2d13dce87bd140aa0b803eea6a683e31b79680a3ea8ba72417e7ec26f206e0b027b014a SHA512 6ab52d116cb9f755871f2fd196ec1b352dbbe59f2ecedeb5551237e4e672da77205ef0c2f80ec746ba1fd94cab1995ab1729c8adb0f29d10f3c74a67f5327493 DIST mbedtls-2.19.1.tar.gz 1165843 BLAKE2B c8e6764b493a6ca011e74d7b297d5ae5140d7bdf17c1cfd5b9d37913d615ad3c5a6dbf71d44cbf14c938646e51bbf04cd63cc1657eb3775addb2dee3ee94c587 SHA512 07ec1cdf98e51ed35bb2940e485d7d8422e9fd440d2077d5cd4c80781d73848228386fe9064773ef8bb1a02c1bc060185b9c8310349d695926bd2c9b7cf6582b DIST mbedtls-2.20.0.tar.gz 1177878 BLAKE2B c6ab398d77d5e3f2549ccf0dd7c6db386adaa12f996729f02022aff68fcfdc6059d5e40cdc2587b8882800cfeb7fe7ebd4959a28639816f016bfb8085d8dbcb7 SHA512 1d9766aade2d4343b0acd8ab3a815990f99a260cdf9a16c3357e64ec7aac18f5f9059aeba266bd9f55aede1de1344dba28632449b39bc75d46767fe882e4a1a0 +DIST mbedtls-2.22.0.tar.gz 3822997 BLAKE2B 0857479e89f9850f611cb8c946c489f715a83edba88673b874cd3e6530a7f72c48671e02435087a48aa9a550d0901a5fd2990f9b3a4d69edceecf1fa01772ab6 SHA512 391b99a59ed4edf9625e71e610ea71c6cefa4ea1210d306eb595d85f7408d5decf5fc995d4a411698f1536651ee1230b305dd354df15dbeef9469aa6a7980e09 diff --git a/net-libs/mbedtls/mbedtls-2.22.0.ebuild b/net-libs/mbedtls/mbedtls-2.22.0.ebuild new file mode 100644 index 000000000000..682e5c5f9612 --- /dev/null +++ b/net-libs/mbedtls/mbedtls-2.22.0.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-utils multilib-minimal + +DESCRIPTION="Cryptographic library for embedded systems" +HOMEPAGE="https://tls.mbed.org/" +CRYPTO_SUBMODULE="mbedcrypto-3.1.0" +SRC_URI="https://github.com/ARMmbed/mbedtls/archive/${P}.tar.gz + https://github.com/ARMmbed/mbed-crypto/archive/${CRYPTO_SUBMODULE}.tar.gz" +S=${WORKDIR}/${PN}-${P} + +LICENSE="Apache-2.0" +SLOT="0/13" # slot for libmbedtls.so +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="cpu_flags_x86_sse2 doc havege libressl programs -static-libs test threads zlib" +RESTRICT="!test? ( test )" + +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 +} + +PATCHES=( + "${FILESDIR}"/${PN}-dont-overwrite-headers.patch + "${FILESDIR}"/${PN}-un-pebcak-705038-wrong-file.patch +) + +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 + + # pretend to be git submodule + rmdir "${S}"/crypto + mv "${WORKDIR}"/mbed-crypto-${CRYPTO_SUBMODULE} "${S}"/crypto + + cmake-utils_src_prepare +} + +multilib_src_configure() { + local mycmakeargs=( + -DENABLE_PROGRAMS=$(multilib_native_usex programs) + -DENABLE_ZLIB_SUPPORT=$(usex zlib) + -DUSE_STATIC_MBEDTLS_LIBRARY=$(usex static-libs) + -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 +} -- 2.26.2