archrelease: copy trunk to community-any
[ArchLinux/community.git] / mbedtls / repos / community-testing-x86_64 / PKGBUILD
blob72049fb7288944610ecd5466244d979f80d0a920
1 # Maintainer: Maxime Gauduin <alucryd@archlinux.org>
2 # Contributor: Kyle Keen <keenerd@gmail.com>
3 # Contributor: Mihai Militaru <mihai militaru at xmpp dot ro>
4 # Contributor: carstene1ns <arch carsten-teibes.de>
6 pkgname=mbedtls
7 pkgver=3.4.0
8 pkgrel=1
9 pkgdesc='An open source, portable, easy to use, readable and flexible TLS library'
10 arch=(x86_64)
11 url=https://tls.mbed.org
12 license=(Apache)
13 depends=(
14   glibc
15   sh
17 checkdepends=(python)
18 makedepends=(
19   cmake
20   git
21   ninja
23 provides=(
24   libmbedcrypto.so
25   libmbedtls.so
26   libmbedx509.so
27   polarssl
29 replaces=(polarssl)
30 conflicts=(polarssl)
31 options=(staticlibs)
32 _tag=1873d3bfc2da771672bd8e7e8f41f57e0af77f33
33 source=(git+https://github.com/ARMmbed/mbedtls.git#tag=${_tag})
34 b2sums=(SKIP)
36 pkgver() {
37   cd mbedtls
38   git describe --tags | sed 's/^v//; s/^mbedtls-//'
41 build() {
42   export CFLAGS+=' -ffat-lto-objects'
43   cmake -S mbedtls -B build -G Ninja \
44     -DCMAKE_BUILD_TYPE=None \
45     -DCMAKE_INSTALL_PREFIX=/usr \
46     -DCMAKE_SKIP_RPATH=ON \
47     -DUSE_SHARED_MBEDTLS_LIBRARY=ON \
48     -DUSE_STATIC_MBEDTLS_LIBRARY=ON \
49     -Wno-dev
50   cmake --build build
53 check() {
54   LD_LIBRARY_PATH="${srcdir}"/build/library ctest --test-dir build
57 package() {
58   DESTDIR="${pkgdir}" cmake --install build
60   # rename generic utils
61   local _prog _baseprog
62   for _prog in "${pkgdir}"/usr/bin/*; do
63   _baseprog=$(basename "$_prog")
64     mv -v "$_prog" "${_prog//$_baseprog/mbedtls_$_baseprog}"
65   done
67   # fixup static lib permissions
68   chmod 644 "$pkgdir"/usr/lib/*.a
71 # vim: ts=2 sw=2 et: