summaryrefslogblamecommitdiff
path: root/user/mbedtls/APKBUILD
blob: 362e112e95700ed218c739c6c16eb4f6a3a5733f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13


                                                           
            








                                 


                                                                                                    
 






                      



                                                                                          




                                                                                                 



















                                                     

                                                                                                                                                                       
# Contributor: Síle Ekaterin Liszka <sheila@vulpine.house>
# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house>
pkgname=mbedtls
pkgver=3.4.0
pkgrel=0
pkgdesc="Lightweight TLS library"
url="https://tls.mbed.org"
arch="all"
license="Apache-2.0"
depends=""
checkdepends="python3"
makedepends="cmake"
subpackages="$pkgname-dev"
source="mbedtls-$pkgver.tar.gz::https://github.com/ARMmbed/mbedtls/archive/refs/tags/v$pkgver.tar.gz
	fix-big-endian-alignment-tests.patch
	"

# secfixes:
#   3.3.0-r0:
#     - CVE-2021-45451
#     - CVE-2022-35409
#     - CVE-2022-46392
#     - CVE-2022-46393

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi

	sed -i include/mbedtls/mbedtls_config.h \
		-e 's@^//#define MBEDTLS_SSL_DTLS_SRTP$@#define MBEDTLS_SSL_DTLS_SRTP@g' `#991` \
		;

	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -fPIC" \
		-DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
		${CMAKE_CROSSOPTS} \
		.
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="be24d2c926f94a7958c4340574e2c74a745120ccf20bcaeeda18b9c0e732fd1913f37c1f883b74ff772c24fbe8763c25c34e99a20a69e023c3d0d49aedd5f6b5  mbedtls-3.4.0.tar.gz
40a4aefd39b63babf1f54bb2ab655278aaca1482da6e0b8943751a55c067307f8a591217b0c3b546a8ae02f7eca72c22da9d74378a5c28e00f8ca97dbcf1b7f8  fix-big-endian-alignment-tests.patch"