#!/bin/sh NAME="mbedtls" DESC="Light-weight cryptographic and SSL/TLS library" MAKEDEPS=" cmake perl python ninja" PKG_VER=2.28.1 SOURCE="https://github.com/ARMmbed/mbedtls/archive/v$PKG_VER.tar.gz" prepare() { # Enable flags for non-embedded systems. sed -i \ -e 's|//\(#define MBEDTLS_THREADING_C\)|\1|' \ -e 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' \ "$BUILD_ROOT"/include/mbedtls/config.h } build() { cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE="MinSizeRel" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DUSE_SHARED_MBEDTLS_LIBRARY=ON cmake --build build } check() { cd build CTEST_OUTPUT_ON_FAILURE=TRUE ctest cd .. } package() { DESTDIR="$PKG_DEST" cmake --install build }