summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c7ec0a009573a879a33565be08282f639c14229d (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
70
71
72
73
74
75
76
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Xavier Devlamynck <magicrhesus@ouranos.be>
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: Travis Hegner <travis.hegner@gmail.com>

pkgbase=pjproject-git
pkgname=("$pkgbase" "python-$pkgbase")
pkgver=2.10.r38.g98f70c2
pkgrel=2
pkgdesc='Open source SIP stack and media stack'
arch=('x86_64' 'armv7h' 'i686')
url='https://www.pjsip.org/'
license=('GPL')
makedepends=('alsa-lib' 'e2fsprogs' 'ffmpeg' 'libsamplerate' 'libsrtp'
             'openssl' 'opus' 'portaudio' 'speex' 'swig' 'util-linux'
             'python' 'python-setuptools')
source=("$pkgbase::git+https://github.com/pjsip/${pkgbase/-/.}"
        'config_site.h')
sha256sums=('SKIP'
            '61fa2a76d069aa5c95b6e2c539f7b20e2ccf0b126fc60c18117762541d0a7472')

pkgver() {
  cd "$pkgbase"
  git describe --tags --abbrev=7 HEAD | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$pkgbase"
  install -Dm644 -t pjlib/include/pj/ ../config_site.h
}

build() {
  cd "$pkgbase"
  export CXXFLAGS="$CXXFLAGS -fPIC"
  if [ "$CARCH" = "i686" ]; then
    export CXXFLAGS="$CXXFLAGS -march=i686"
    arch_opts=(--disable-libwebrtc)
  fi
  export CFLAGS="$CFLAGS -fPIC -DNDEBUG"
  ./configure \
    --prefix=/usr \
    --with-external-speex \
    --with-external-srtp \
    --with-external-pa \
    --with-external-gsm \
    --enable-shared \
    --disable-opencore-amr \
    "${arch_opts[@]}"

  make dep
  make

  pushd pjsip-apps/src/swig
  make python
  pushd python
  python setup.py build
}

package_pjproject-git() {
  depends=('openssl' 'portaudio' 'speex' 'alsa-lib' 'libsamplerate' 'util-linux'
           'ffmpeg' 'libsrtp' 'opus')
  optdepends=('e2fsprogs' 'python-pjproject: Python bindings')
  provides=("${pkgname%-git}")
  conflicts=("${pkgname%-git}")
  cd "$pkgbase"
  make DESTDIR="$pkgdir" install
  install -Dm755 pjsip-apps/bin/pjsua-*gnu* "$pkgdir/usr/bin/pjsua"
}

package_python-pjproject-git() {
  depends=('pjproject' 'python')
  provides=("${pkgname%-git}")
  conflicts=("${pkgname%-git}")
  cd "$pkgbase/pjsip-apps/src/swig/python"
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}