forked from ports/contrib
27 lines
972 B
Plaintext
27 lines
972 B
Plaintext
# Description: Cryptographic library for embedded systems
|
|
# URL: https://tls.mbed.org/
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
|
# Depends on: cmake ninja
|
|
|
|
name=mbedtls
|
|
version=2.22.0
|
|
release=1
|
|
source=(https://github.com/ARMmbed/mbedtls/archive/$name-$version.tar.gz)
|
|
|
|
build() {
|
|
# enable flags for non-embedded systems
|
|
sed -i 's|//\(#define MBEDTLS_HAVE_SSE2\)|\1|' $name-$name-$version/include/mbedtls/config.h
|
|
sed -i 's|//\(#define MBEDTLS_ZLIB_SUPPORT\)|\1|' $name-$name-$version/include/mbedtls/config.h
|
|
sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' $name-$name-$version/include/mbedtls/config.h
|
|
sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' $name-$name-$version/include/mbedtls/config.h
|
|
|
|
cmake -S$name-$name-$version -Bbuild -G Ninja \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DENABLE_ZLIB_SUPPORT=ON \
|
|
-DUSE_SHARED_MBEDTLS_LIBRARY=ON \
|
|
-DINSTALL_MBEDTLS_HEADERS=ON
|
|
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --build build --target install
|
|
}
|