hasufell-repository/packages/dev-libs/mbedtls/mbedtls-2.5.1.exheres-0

94 lines
2.3 KiB
Bash
Raw Normal View History

# Copyright 2016 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
2016-04-23 02:22:08 +00:00
2016-04-22 15:42:34 +00:00
require github [ user=ARMmbed tag=mbedtls-${PV} ]
2016-10-18 19:07:28 +00:00
WORK="${WORKBASE}/${PNV}" # because github.exlib is broken
2016-04-23 02:22:08 +00:00
require cmake [ api=2 ]
2016-10-18 19:07:28 +00:00
SUMMARY="Cryptographic library for embedded systems"
HOMEPAGE="https://tls.mbed.org/"
2016-10-18 19:07:28 +00:00
DOWNLOADS="https://tls.mbed.org/download/${PNV}-gpl.tgz"
2016-10-18 19:07:28 +00:00
LICENCES="|| ( Apache-2.0 GPL-2 )"
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS="
2016-06-29 11:58:37 +00:00
doc
havege [[ description = [ Enable the HAVEGE random generator,
not suitable for virtualized environments! ] ]]
threads [[ description = [ Enables the threading abstraction layer
via pthread. This is used if you do intend
to use contexts between threads. ] ]]
x86_cpu_features:
sse2
"
DEPENDENCIES="
2016-06-29 11:58:37 +00:00
build:
doc? (
app-doc/doxygen[>=1.8.4]
media-gfx/graphviz
)
build+run:
sys-libs/zlib
test:
dev-lang/perl:*
"
CMAKE_SRC_CONFIGURE_PARAMS=(
-DENABLE_PROGRAMS=OFF
-DUSE_SHARED_MBEDTLS_LIBRARY=ON
-DINSTALL_MBEDTLS_HEADERS=ON
-DLIB_INSTALL_DIR="/usr/$(exhost --target)/lib"
-DUSE_STATIC_MBEDTLS_LIBRARY=OFF
-DENABLE_ZLIB_SUPPORT=ON
)
CMAKE_SRC_CONFIGURE_TESTS=(
'-DENABLE_TESTING=ON'
)
enable_mbedtls_option() {
local myopt="$@"
# check that config.h syntax is the same at version bump
2016-02-28 23:05:15 +00:00
edo sed -i \
-e "s://#define ${myopt}:#define ${myopt}:" \
2016-04-23 02:22:08 +00:00
"${CMAKE_SOURCE}"/include/mbedtls/config.h
}
src_prepare() {
option x86_cpu_features:sse2 && enable_mbedtls_option MBEDTLS_HAVE_SSE2
enable_mbedtls_option MBEDTLS_ZLIB_SUPPORT
option havege && enable_mbedtls_option MBEDTLS_HAVEGE_C
option threads && enable_mbedtls_option MBEDTLS_THREADING_C
option threads && enable_mbedtls_option MBEDTLS_THREADING_PTHREAD
2016-09-07 18:23:31 +00:00
enable_mbedtls_option MBEDTLS_MD4_C
2016-04-23 02:22:08 +00:00
cmake_src_prepare
}
2016-06-29 11:58:37 +00:00
src_compile() {
default
if option doc ; then
emake apidoc
fi
}
src_test() {
2016-02-17 10:42:35 +00:00
LD_LIBRARY_PATH="${ECMAKE_BUILD_DIR}/library" \
2016-06-29 11:58:37 +00:00
emake test
}
src_install() {
cmake_src_install
if option doc ; then
docinto html
dodoc -r "${CMAKE_SOURCE}"/apidoc/*
fi
}