summaryrefslogtreecommitdiff
path: root/gnome-unstable/pulseaudio/PKGBUILD
blob: f2ccf6bdd7065ffb578a306f43b6a12ef85f3786 (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
# $Id: PKGBUILD 138059 2011-09-15 12:10:17Z heftig $
# Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgbase=pulseaudio
pkgname=(pulseaudio libpulse)
pkgver=0.99.4
pkgrel=1
arch=(i686 x86_64)
url="http://pulseaudio.org/"
license=(GPL LGPL)
makedepends=(libasyncns libcap attr libxtst libsm libsamplerate libtool rtkit
             speex tdb udev dbus-core xcb-util avahi bluez gconf intltool jack
             lirc-utils openssl fftw orc json-c)
options=(!emptydirs !libtool !makeflags)
source=("http://freedesktop.org/software/$pkgbase/releases/$pkgbase-$pkgver.tar.gz"
        $pkgbase.xinit)
sha256sums=('7dde2f73f6b8336797d06928c8210d5e6cfaa7d679bea7b93f5ffc26fb970fec'
            '3fb64aee43c482b3ea18e1b260c8f310884362b24bcd02a1c117dcd99237312f')

build() {
  cd "$srcdir/$pkgbase-$pkgver"

  # Don't break circular dependency between libpulse and libpulsecommon
  LDFLAGS="${LDFLAGS//-Wl,--as-needed}"

  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --localstatedir=/var \
    --with-database=tdb \
    --disable-hal \
    --disable-tcpwrap \
    --disable-rpath \
    --disable-default-build-tests

  make
}

package_pulseaudio() {
  pkgdesc="A featureful, general-purpose sound server"
  depends=("libpulse=$pkgver-$pkgrel" rtkit libtool speex tdb udev fftw orc)
  optdepends=('avahi: zeroconf support'
              'bluez: bluetooth support'
              'gconf: configuration through gconf (paprefs)'
              'jack: jack support'
              'lirc-utils: infra-red support'
              'openssl: RAOP support'
              'python2-pyqt: Equalizer GUI (qpaeq)')
  backup=(etc/pulse/{daemon.conf,default.pa,system.pa})
  install=pulseaudio.install
  cd "$srcdir/$pkgbase-$pkgver"
  make DESTDIR="$pkgdir" install

  # Lower resample quality, saves CPU
  sed -e '/resample-method/iresample-method=speex-float-0' \
      -i "$pkgdir/etc/pulse/daemon.conf"

  # Disable cork-request module, can result in e.g. media players unpausing
  # when there's a Skype call incoming
  sed -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
      -i "$pkgdir/usr/bin/start-pulseaudio-x11"

  # Make module-console-kit optional
  sed -e $'/load-module module-console-kit/{i.nofail\n;a.fail\n;}' \
      -i "$pkgdir/etc/pulse/default.pa"

  # Python fix
  sed -i '1s:python$:&2:' "$pkgdir/usr/bin/qpaeq"

  install -Dm755 "$srcdir/pulseaudio.xinit" "$pkgdir/etc/X11/xinit/xinitrc.d/pulseaudio"

  rm "$pkgdir/etc/dbus-1/system.d/pulseaudio-system.conf"

### Split libpulse

  mkdir -p "$srcdir"/libpulse/{etc/pulse,usr/{lib,share/man/man5}}

  mv {"$pkgdir","$srcdir/libpulse"}/etc/pulse/client.conf

  mv "$pkgdir"/usr/lib/libpulse{,dsp,-simple,-mainloop-glib}.so* \
     "$pkgdir"/usr/lib/libpulsecommon-*.so \
     "$srcdir/libpulse/usr/lib"

  mv {"$pkgdir","$srcdir/libpulse"}/usr/lib/pkgconfig
  mv {"$pkgdir","$srcdir/libpulse"}/usr/include

  mv {"$pkgdir","$srcdir/libpulse"}/usr/share/man/man5/pulse-client.conf.5
  mv {"$pkgdir","$srcdir/libpulse"}/usr/share/vala
}

package_libpulse() {
  pkgdesc="A featureful, general-purpose sound server (client library)"
  depends=(dbus-core xcb-util libasyncns libcap libxtst libsm libsamplerate json-c)
  optdepends=('alsa-plugins: ALSA support'
              'avahi: zeroconf support')
  backup=(etc/pulse/client.conf)
  mv "$srcdir"/libpulse/* "$pkgdir"
}