summaryrefslogtreecommitdiff
path: root/pcr/ring/PKGBUILD
blob: 0b6dab1b660920da29f7c61ef4f1a67e844ff939 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>

# TODO: add explicit versioned dependency canary on icu to the
#       appropriate package(s) -- à la iceweasel -- so as to avoid
#       breakage when Arch bumps the soname

pkgbase=ring
pkgname=(ring-daemon ring-lrc ring-client-gnome)
pkgdesc="The GNU Ring VoIP system"
pkgver=20171024.1.eadbdeb
_SOURCE_DATE_EPOCH=1508858419

# To figure out what the above value of _SOURCE_DATE_EPOCH should be,
# run
#
#    git log -n1 --format=%ct ${_pkgver##*.}
#
# from inside of the repository created by
#
#    git clone https://gerrit-ring.savoirfairelinux.com/ring-project

pkgrel=2.1
arch=("i686" "x86_64")
url="https://ring.cx/"
source=("http://dl.ring.cx/ring-release/tarballs/${pkgbase}_${pkgver}.tar.gz"
        'kashmir.tar.gz::https://github.com/Corvusoft/kashmir-dependency/archive/master.tar.gz')
noextract=('kashmir.tar.gz')
license=('GPL3')
sha256sums=('4f58183d7669b2fa06d72828f9fc8ceeec74d598bd656618cdd8cbe6a0ec55c6'
            '4d2040fae7dea3306580ac5b9c3d60e64314305db1b59d2d14c802a12e45e6f9')

# Get this list by looking at `daemon/contrib/src/*/rules.mak`; look
# for packages that add themselves to both PKGS and FOUND_PKGS.
_daemon_contrib=(
        boost           # CONTRIB: TODO: IDK: no PKGS_FOUND logic
        crypto++
        ffmpeg
        #gnutls         # DUP: {ffmpeg,opendht}->gnutls
        #gsm            # CONTRIB: TODO: IDK: no PKGS_FOUND logic
        #jack           # DUP: ffmpeg->jack
        jsoncpp
        msgpack-c
        libnatpmp       # NOTE: force system version; see below
        #libsamplerate  # DUP: ffmpeg->jack->libsamplerate
        #libsndfile     # DUP: ffmpeg->libsamplerate->libsndfile
        libupnp
        #libvorbis      # DUP: ffmpeg->libvorbis
        #libogg         # DUP: ffmpeg->{libvorbis,speex}->libogg
        #nettle         # DUP: {ffmpeg,opendht}->gnutls->nettle
        opendht
        #opus           # DUP: ffmpeg->opus
        #pcre           # DUP: {base,base-devel}->grep->pcre
        #pjproject      # CONTRIB: Added patches for gnutls
        restbed
        #secp256k1      # CONTRIB: extra crypto, AUR package
        #speex          # DUP: ffmpeg->speex
        #speexdsp       # DUP: ffmpeg->speex->speexdsp
        yaml-cpp
        #zlib           # DUP: {pcre,ffmpeg,opendht,gnutls}->zlib
)
# We may pass several `--disable-X` flags to `../bootstrap` below; to
# force the system version of dependencies.
#
# Disable contrib 'natpmp' to force the system version of libnatpmp
# because the detection logic uses pkg-config, but the libnatpmp
# package doesn't include pkg-config files; so the build system thinks
# we don't have it.

_makedepends_daemon=()
_depends_daemon=("${_daemon_contrib[@]}" dbus-c++)

_makedepends_lrc=(qt5-tools)
_depends_lrc=(qt5-base)

_makedepends_client_gnome=()
_depends_client_gnome=(clutter-gtk evolution-data-server libnm-glib qrencode)

makedepends=(
  cmake
  doxygen
  "${_makedepends_daemon[@]}"
  "${_depends_daemon[@]}"
  "${_makedepends_lrc[@]}"
  "${_depends_lrc[@]}"
  "${_makedepends_client_gnome[@]}"
  "${_depends_client_gnome[@]}"
)

#checkdepends=(cppunit swig)

_makedepends_ringpy=(autoconf-archive gnome-icon-theme-symbolic libe-book)

prepare() {
  cp "$srcdir/kashmir.tar.gz" "$srcdir/ring-project/daemon/contrib/tarballs/"
}

build() {
  cd "$srcdir/ring-project/daemon/contrib"
  mkdir native
  cd native
  ../bootstrap --disable-downloads --disable-natpmp --disable-asio
  make BATCH_MODE=1

  cd "$srcdir/ring-project/daemon"
  ./autogen.sh
  ./configure --prefix=/usr
  make RING_DIRTY_REPO= RING_REVISION=$_pkgver

  cd "$srcdir/ring-project/lrc"
  mkdir build
  cd build
  cmake .. \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DRING_BUILD_DIR="$srcdir/ring-project/daemon/src"
  make

  cd "$srcdir/ring-project/client-gnome"
  mkdir build
  cd build
  SOURCE_DATE_EPOCH=$_SOURCE_DATE_EPOCH cmake .. \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DLibRingClient_PROJECT_DIR="$srcdir/ring-project/lrc"
  make
}

package_ring-daemon() {
  pkgdesc="The communication daemon of the GNU Ring VoIP system"
  depends=("${_depends_daemon[@]}")

  cd "$srcdir/ring-project/daemon"
  make DESTDIR="$pkgdir" install
}

package_ring-lrc() {
  pkgdesc="A client library for the GNU Ring VoIP system"
  depends=("${_depends_lrc[@]}" "ring-daemon=$pkgver")
  provides=("libringclient=$pkgver") # AUR name
  replaces=("libringclient") # AUR name

  cd "$srcdir/ring-project/lrc/build"
  make DESTDIR="$pkgdir" install
}

package_ring-client-gnome() {
  pkgdesc="A GTK+3 user interface for the GNU Ring VoIP system"
  depends=("${_depends_client_gnome[@]}" "ring-lrc=$pkgver")
  provides=("ring-gnome=$pkgver") # AUR name
  replaces=("ring-gnome") # AUR name

  cd "$srcdir/ring-project/client-gnome/build"
  make DESTDIR="$pkgdir" install
}