summaryrefslogtreecommitdiff
path: root/mbedtls/Pkgfile
blob: 3b02283c572fc3c359ae6f62bc3960e9a3b27c13 (plain)
    1 # Description: Cryptographic library for embedded systems
    2 # URL: https://tls.mbed.org/
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: cmake python3
    5 
    6 name=mbedtls
    7 version=2.24.0
    8 release=1
    9 source=(https://github.com/ARMmbed/mbedtls/archive/$name-$version.tar.gz)
   10 
   11 build() {
   12 	# enable flags for non-embedded systems
   13 	sed -i 's|//\(#define MBEDTLS_HAVE_SSE2\)|\1|' $name-$name-$version/include/mbedtls/config.h
   14 	sed -i 's|//\(#define MBEDTLS_ZLIB_SUPPORT\)|\1|' $name-$name-$version/include/mbedtls/config.h
   15 	sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' $name-$name-$version/include/mbedtls/config.h
   16 	sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' $name-$name-$version/include/mbedtls/config.h
   17 
   18 	[[ -e '/usr/bin/ninja' ]] && PKGMK_MBEDTLS+=' -G Ninja'
   19 
   20 	cmake -S $name-$name-$version -B build $PKGMK_MBEDTLS \
   21 		-D CMAKE_INSTALL_PREFIX=/usr \
   22 		-D CMAKE_BUILD_TYPE=Release \
   23 		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
   24 		-D ENABLE_ZLIB_SUPPORT=ON \
   25 		-D USE_SHARED_MBEDTLS_LIBRARY=ON \
   26 		-D INSTALL_MBEDTLS_HEADERS=ON \
   27 		-D MBEDTLS_FATAL_WARNINGS=OFF \
   28 		-Wno-dev
   29 
   30 	cmake --build build
   31 	DESTDIR=$PKG cmake --install build
   32 }

Generated by cgit