summaryrefslogtreecommitdiff
path: root/extra/libcanberra/PKGBUILD
blob: 5e62b6ae10b4df6a61e77e503af9ac391d2be4a2 (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
# $Id: PKGBUILD 170401 2012-11-07 07:11:35Z heftig $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=libcanberra
pkgname=(libcanberra libcanberra-pulse libcanberra-gstreamer)
pkgver=0.30
pkgrel=2
pkgdesc="A small and lightweight implementation of the XDG Sound Theme Specification"
arch=(i686 x86_64 'mips64el')
license=(LGPL)
depends=(libvorbis libltdl alsa-lib tdb)
makedepends=(gtk-doc libpulse gstreamer gtk2 gtk3)
options=(!emptydirs)
url=http://0pointer.de/lennart/projects/libcanberra
source=("$url/$pkgbase-$pkgver.tar.xz"
        libcanberra.xinit)
sha256sums=('c2b671e67e0c288a69fc33dc1b6f1b534d07882c2aceed37004bf48c601afa72'
            '68a68d66b7491f99d5aa09fe7c6ef4eb38352a2a8ff7997d184d1cbc5e80c0d3')

_plugindir=usr/lib/$pkgbase-$pkgver

build() {
  cd $pkgbase-$pkgver
  ./configure --sysconfdir=/etc --prefix=/usr --localstatedir=/var \
      --disable-static --with-builtin=dso --enable-null --disable-oss \
      --enable-alsa --enable-gstreamer --enable-pulse \
      --with-systemdsystemunitdir=/usr/lib/systemd/system

  # Fight unused direct deps
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/      func_append compile_command " -Wl,-O1,--as-needed"\n      func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool

  make
}

package_libcanberra() {
  install=libcanberra.install
  optdepends=("$pkgbase-pulse: PulseAudio driver"
              "$pkgbase-gstreamer: GStreamer driver")

  cd $pkgbase-$pkgver

  make -j1 DESTDIR="$pkgdir" install
  rm "$pkgdir"/usr/lib/libcanberra-gtk*.la
  rm "$pkgdir"/usr/lib/gtk-{2,3}.0/modules/*.la

  install -D "$srcdir/libcanberra.xinit" \
    "$pkgdir/etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module"

  # Split plugins
  for _p in pulse gstreamer; do
    mkdir ../$_p-plugin
    mv "$pkgdir/$_plugindir"/libcanberra-$_p.* ../$_p-plugin
  done
}

package_libcanberra-pulse() {
  pkgdesc="PulseAudio plugin for libcanberra"
  depends=("$pkgbase=$pkgver-$pkgrel" libpulse)

  install -d "$pkgdir/$_plugindir"
  mv pulse-plugin/* "$pkgdir/$_plugindir"
}

package_libcanberra-gstreamer() {
  pkgdesc="GStreamer plugin for libcanberra"
  depends=("$pkgbase=$pkgver-$pkgrel" gstreamer)

  install -d "$pkgdir/$_plugindir"
  mv gstreamer-plugin/* "$pkgdir/$_plugindir"
}