summaryrefslogtreecommitdiff
path: root/user/mbedtls/APKBUILD
blob: 2b2751e6fa26a7410ff00df44e392b2d28de2f3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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"

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

prepare() {
	default_prepare

	#1002 -- fails on BE platforms (ppc64, sparc64, ...)
	rm -v \
		tests/suites/test_suite_alignment.data \
		tests/suites/test_suite_alignment.function \
		;
}

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"