summaryrefslogtreecommitdiff
path: root/pcr/ring/PKGBUILD
blob: 43422a337a5bf1cd7fcb6b4d276c828aed90ca8d (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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>

_pkgver=20171129.2.cf5bbff
_SOURCE_DATE_EPOCH=1511972974
# The above are thing things that you must set each new version.
#
# The _SOURCE_DATE_EPOCH should be
#     git log -n1 --format=%ct "${_pkgver##*.}"
# from the git repo
#     git clone https://gerrit-ring.savoirfairelinux.com/ring-project
#
# But I automated that for you!
#     ./upd-helper set-pkgver YYYYMMDD.N.GITVER
#
# It will update _pkgver, _SOURCE_DATE_EPOCH, and sha256sums, and give
# you a summary of files that have changed that I think you (future
# me?), as the packager, should care about.

pkgbase=ring
pkgname=(ring-daemon ring-lrc ring-client-gnome)
# stick a bunch of keywords in the pkgdesc because "ring" is a
# terrible search term.
pkgdesc="The GNU Ring (formerly ring.cx and SFLphone) VoIP system"
epoch=1
pkgver=1.0_${_pkgver}
pkgrel=1
arch=("i686" "x86_64")
url="https://gnu.org/software/ring/"
source=("http://dl.ring.cx/ring-release/tarballs/${pkgbase}_${_pkgver}.tar.gz"
       0001-contrib-recursive-dependency-tracking.patch)
license=('GPL3')
sha256sums=('0a23f8052a4df2a7aee40434cd59f17d0d5e97c73306ba35f99f2721b305ed48'
            'a9b308e524ea5b0b5db09fd55e6c0d96edbea6594f987e10e7b77251217f8e0c')


# Get this list by looking at `daemon/contrib/src/*/rules.mak`.
#
# This is the complete list (with "lib" prepended or similar as
# necessary).
#
# Entries are commented out if
#  - it's something we don't need to name because it's already in the
#    deps list ("DUP").  Actually, don't comment out any .so files
#    that we name for DUPs.
#  - we won't be using it ("IGNORE"); these are things that don't add
#    themselves to PKGS, and aren't in DEPS_* for another package that
#    we don't IGNORE
#  - or we (*gasp*) want to use the contrib version instead of the
#    system version ("CONTRIB")
#
# Also note when we forcefully override the build-system's automatic
# logic on when to use the system version vs the contrib version
# ("FORCE").  For system packages, these are things we don't IGNORE,
# but don't add themselves PKGS_FOUND.  For contrib packages, these
# are things that might get added to PKG_FOUND that we don't want to.
# We'll be adding `--disable-PKG` or `--enable-PKG` flags to
# `../bootstrap` below for these.
_daemon_contrib=(
  #argon2        # DUP: opendht->argon2 (DEPS_opendht)
  #asio          # CONTRIB: want commit f5c57, which isn't in a stable release yet
  dbus-c++       # FORCE: no PKGS_FOUND logic because alleged gcc7 bug?
  ffmpeg libavutil.so libavcodec.so libavformat.so libavdevice.so libswscale.so
  #flac          # DUP: libsndfile->flac
  #libgcrypt     # IGNORE: not in PKGS (?)
  #gmp           # IGNORE: not in PKGS (DEPS_nettle DEPS_secp256k1)
  #gnutls        # CONTRIB: ring is not yet compatible with gnutls>=3.5.11
  #libgpg-error  # IGNORE: not in PKGS (DEPS_gcrypt)
  #gsm           # FORCE+DUP: IDK why no PKGS_FOUND; ffmpeg->gsm
  #glibc         # DUP: base->glibc (contribname=iconv)
  #jack          # IGNORE: not in PKGS: ("disabled by default for now")
  jsoncpp        #
  msgpack-c      #
  libnatpmp      # FORCE: package doesn't include a pkg-config file
  #nettle        # DUP: {gnutls,opendht}->nettle
  #libogg        # DUP: ffmpeg->{libvorbis,speex,flac}->libogg
  opendht        #
  #opus          # DUP: ffmpeg->opus
  #pcre          # DUP: {base,base-devel}->grep->pcre
  #pjproject     # CONTRIB+FORCE: Added patches for gnutls
  portaudio      #
  restbed        # FORCE: package doesn't include a pkg-config file
  #libsamplerate # DUP: {ffmpeg,portaudio}->jack->libsamplerate
  secp256k1-git libsecp256k1.so
  #libsndfile    # DUP: libsamplerate->libsndfile
  #speex         # DUP: ffmpeg->speex
  #speexdsp      # DUP: speex>-speexdsp
  libupnp        #
  #util-linux    # DUP: {base,base-devel}->util-linux (DEPS_prproject=uuid)
  libvorbisenc.so # DUP: ffmpeg->libvorbis
  #libvpx        # IGNORE: not in PKGS (DEPS_ffmpeg)
  #x264          # IGNORE: not in PKGS (DEPS_ffmpeg)
  yaml-cpp       #
  #zlib          # DUP: {pcre,ffmpeg,gnutls}->zlib
)

_makedepends_daemon=(
  boost # a compile-time dep for some features in yaml-cpp
)
_depends_daemon=(
  "${_daemon_contrib[@]}"
  libidn2
)

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

_makedepends_client_gnome=()
_depends_client_gnome=(
  clutter-gtk
  evolution-data-server
  gnome-icon-theme-symbolic
  libnm-glib
  qrencode
)

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

# The above list of dependencies can be unwieldy!  Running
# `./upd-helper find-dups` will suggest things that can be removed.

# make-ring.py says we also need the following, but I don't agree
# (`./upd-helper diff-depends` will help you update this list):
#
#  - autoconf-archive: for building from git, not release tarballs
#  - cppunit: for testing
#  - libe-book: They are confusing 'libebook' (which Arch & Parabola don't have) with the different 'libe-book' (which we do have)
#  - swig: for ring-daemon NodeJS module
#  - yasm: for building contrib vpx

prepare() {
  cd "$srcdir/ring-project/daemon"
  patch -p1 -i "$srcdir/0001-contrib-recursive-dependency-tracking.patch"

  # Remove unused contrib tarballs, to ensure that we didn't make a mistake
  local file
  for file in "$srcdir/ring-project/daemon/contrib/tarballs/"*; do
    case "${file##*/}" in
      asio-*) : skip "$file" ;;
      gnutls-*) : skip "$file" ;;
      pjproject-*) : skip "$file" ;;
      *) rm -f -- "$file" ;;
    esac
  done
}

build() (
  set -x

  cd "$srcdir/ring-project/daemon/contrib"
  mkdir native
  cd native
  ../bootstrap \
      --disable-downloads \
      --disable-dbus-cpp \
      --disable-gsm \
      --disable-natpmp \
      --enable-pjproject \
      --disable-restbed
  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 ${pkgdesc,}"
  depends=("${_depends_daemon[@]}")
  provides=("ring-daemon=2:$_pkgver") # AUR version scheme

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

package_ring-lrc() {
  pkgdesc="A client library for ${pkgdesc,}"
  depends=("${_depends_lrc[@]}" "ring-daemon=${epoch:+$epoch:}$pkgver")
  provides=("libringclient=2:$_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 ${pkgdesc,}"
  depends=("${_depends_client_gnome[@]}" "ring-lrc=${epoch:+$epoch:}$pkgver")
  provides=("ring-gnome=3:$_pkgver") # AUR name
  replaces=("ring-gnome") # AUR name

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