summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c3ec556247200d04017f1f1a50363b21947d3d70 (plain)
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
63
64
65
66
67
68
69
# Maintainer: Rodrigo Bezerra <rodrigobezerra21 at gmail dot com>
# Contributor: orumin <dev@orum.in>

_basename=libsrtp
pkgname="lib32-$_basename"
pkgver=2.3.0
pkgrel=2
epoch=1
pkgdesc="Library for SRTP (Secure Realtime Transport Protocol) (32-bit)"
url="https://github.com/cisco/libsrtp"
arch=('x86_64')
license=(BSD)
depends=('lib32-glibc' 'libsrtp')
makedepends=('git')
checkdepends=('procps-ng')
options=('staticlibs')
_commit=d02d21111e379c297e93a9033d7b653135f732ee  # tags/v2.3.0
source=("git+https://github.com/cisco/libsrtp#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
    cd $_basename
    git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
    cd $_basename

    # Fixup pkgver: There are tags like v1.5.4 but also "moving" tags like v1 and v1.5
    git tag | grep -Pv '^v\d+.\d+.\d+$' | xargs git tag -d

    # Fix building with GCC 10
    git cherry-pick -n 716a73862b387a2107f37398c0fb7d9a754c0ccd

    autoreconf -fvi
}

build() {
    cd $_basename

    export CC='gcc -m32'
    export CXX='g++ -m32'
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

    ./configure --prefix=/usr \
        --build=i686-pc-linux-gnu \
        --libdir=/usr/lib32

    make all
    make shared_library
}

check() {
    cd $_basename

    make runtest
}

package() {
    cd $_basename

    make DESTDIR="$pkgdir" install

    install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE

    cd "$pkgdir"/usr

    rm -r include
}