summaryrefslogtreecommitdiff
path: root/extra/pulseaudio/PKGBUILD
blob: 528e997284b8f3ac57573e12d410b8f06ac6f878 (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
# $Id: PKGBUILD 206632 2014-03-03 20:45:50Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <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)
pkgdesc="A featureful, general-purpose sound server"
pkgver=5.0
pkgrel=1
arch=(i686 x86_64)
url="http://www.freedesktop.org/wiki/Software/PulseAudio"
license=(LGPL AGPL3)
makedepends=(libasyncns libcap attr libxtst libsm libsamplerate libtool rtkit
             speex tdb systemd dbus avahi bluez bluez-libs gconf intltool jack2-dbus sbc
             lirc-utils openssl xenstore fftw orc json-c gtk3 webrtc-audio-processing
             check git)
options=(!emptydirs)
source=(http://freedesktop.org/software/$pkgbase/releases/$pkgbase-$pkgver.tar.xz)
sha256sums=('99c13a8b1249ddbd724f195579df79484e9af6418cecf6a15f003a7f36caf939')

prepare() {
  cd $pkgbase-$pkgver
}

build() {
  cd $pkgbase-$pkgver

  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --localstatedir=/var \
    --with-udev-rules-dir=/usr/lib/udev/rules.d \
    --with-database=tdb \
    --disable-tcpwrap \
    --disable-bluez4 \
    --disable-rpath \
    --disable-default-build-tests

  # fight unused direct deps
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package_pulseaudio() {
  depends=("libpulse=$pkgver-$pkgrel" rtkit libltdl speex tdb fftw orc
           libsamplerate webrtc-audio-processing sbc)
  optdepends=('pulseaudio-alsa: ALSA configuration (recommended)'
              'avahi: zeroconf publishing and discovery'
              'bluez: Bluetooth'
              'bluez-libs: Bluetooth'
              'gconf: paprefs configuration'
              'jack2-dbus: JACK support'
              'lirc-utils: IR control'
              'openssl: RAOP (AirPlay) output'
              'python-pyqt4: Equalizer GUI (qpaeq)'
              'xenstore: Xen paravirtual output')
  backup=(etc/pulse/{daemon.conf,default.pa,system.pa})

  cd $pkgbase-$pkgver
  make -j1 DESTDIR="$pkgdir" install \
    bashcompletiondir=/usr/share/bash-completion/completions

  # Speed up pulseaudio shutdown so that it exits immediately with
  # the last user session (module-systemd-login keeps it alive)
  sed -e '/exit-idle-time/iexit-idle-time=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"

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

  install -Dm644 shell-completion/pulseaudio-zsh-completion.zsh \
    "$pkgdir/usr/share/zsh/site-functions/_pulseaudio"

### Split libpulse

  mkdir -p "$srcdir"/libpulse/{etc/pulse,usr/{bin,lib/pulseaudio,share/man/man{1,5}}}

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

  mv "$pkgdir"/usr/bin/pa{cat,ctl,dsp,mon,play,rec,record} \
     "$srcdir/libpulse/usr/bin"

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

  mv "$pkgdir"/usr/lib/pulseaudio/libpulsedsp.so \
     "$pkgdir"/usr/lib/pulseaudio/libpulsecommon-*.so \
     "$srcdir/libpulse/usr/lib/pulseaudio"

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

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

  mv "$pkgdir"/usr/share/man/man1/pa{cat,ctl,dsp,play}.1 \
     "$srcdir/libpulse/usr/share/man/man1"

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

package_libpulse() {
  pkgdesc="$pkgdesc (client library)"
  depends=(dbus libasyncns libcap libxtst libsm libsndfile json-c systemd)
  optdepends=('alsa-plugins: ALSA support'
              'avahi: zeroconf support')
  backup=(etc/pulse/client.conf)
  license=(LGPL)

  mv "$srcdir"/libpulse/* "$pkgdir"
}