summaryrefslogtreecommitdiff
path: root/repo/mbedtls/mbedtls.xibuild
diff options
context:
space:
mode:
Diffstat (limited to 'repo/mbedtls/mbedtls.xibuild')
-rw-r--r--repo/mbedtls/mbedtls.xibuild36
1 files changed, 36 insertions, 0 deletions
diff --git a/repo/mbedtls/mbedtls.xibuild b/repo/mbedtls/mbedtls.xibuild
new file mode 100644
index 0000000..4bcda20
--- /dev/null
+++ b/repo/mbedtls/mbedtls.xibuild
@@ -0,0 +1,36 @@
+#!/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
+}