summaryrefslogtreecommitdiff
path: root/repo/mbedtls
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
committerdavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
commitf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (patch)
tree76fe6267f8307e7630fc6f53ff99a9767ad40de0 /repo/mbedtls
parent05d004dfe0c9a9d898fac8a4a0292ca2a74ca391 (diff)
Work
Diffstat (limited to 'repo/mbedtls')
-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
+}