PKGBUILD 4.73 KB
Newer Older
Luca Giambonini's avatar
Luca Giambonini committed
1
# Maintainer: AlmAck
amnon's avatar
amnon committed
2

3 4
pkgbase=pulseaudio
pkgname=(pulseaudio libpulse)
5
pkgdesc="A featureful, general-purpose sound server"
Luca Giambonini's avatar
Luca Giambonini committed
6
pkgver=5.0
7
pkgrel=2
8
arch=('x86_64')
Manuel's avatar
Manuel committed
9 10 11 12
url="http://www.freedesktop.org/wiki/Software/PulseAudio"
license=(GPL LGPL)
makedepends=(libasyncns libcap attr libxtst libsm libsamplerate libtool rtkit
             speex tdb systemd dbus avahi bluez intltool jack sbc
13
             lirc-utils openssl fftw orc json-c webrtc-audio-processing)
Luca Giambonini's avatar
Luca Giambonini committed
14
options=(!emptydirs)
15
source=(http://freedesktop.org/software/$pkgbase/releases/$pkgbase-$pkgver.tar.xz)
Luca Giambonini's avatar
Luca Giambonini committed
16
md5sums=('c43749838612f4860465e83ed62ca38e')
amnon's avatar
amnon committed
17 18

build() {
Manuel's avatar
Manuel committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32
  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-rpath \
    --disable-default-build-tests

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

amnon's avatar
amnon committed
34 35 36
  make
}

37 38 39
package_pulseaudio() {
  depends=("libpulse=$pkgver-$pkgrel" rtkit libltdl speex tdb systemd fftw orc
           libsamplerate webrtc-audio-processing sbc)
Luca Giambonini's avatar
Luca Giambonini committed
40 41
  optdepends=('pulseaudio-alsa: ALSA configuration (recommended)'
              'avahi: zeroconf support'
42 43 44 45
              'bluez: bluetooth support'
              'jack: jack support'
              'lirc-utils: infra-red support'
              'openssl: RAOP support'
Luca Giambonini's avatar
Luca Giambonini committed
46
              'python2-pyqt4: Equalizer GUI (qpaeq)')
47 48 49
  backup=(etc/pulse/{daemon.conf,default.pa,system.pa})
  install=pulseaudio.install

Manuel's avatar
Manuel committed
50
  cd $pkgbase-$pkgver
Luca Giambonini's avatar
Luca Giambonini committed
51
  make -j1 DESTDIR="$pkgdir" install \
52
    bashcompletiondir=/usr/share/bash-completion/completions
53

54 55
  install -Dm644 shell-completion/pulseaudio-zsh-completion.zsh \
    "$pkgdir/usr/share/zsh/site-functions/_pulseaudio"
56
  
57 58
  # Disable cork-request module, can result in e.g. media players unpausing
  # when there's a Skype call incoming
59
  # https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1004607
philm's avatar
philm committed
60
  sed -e 's|/usr/bin/pactl load-module module-x11-cork-request|#&|' \
61 62
      -i "$pkgdir/usr/bin/start-pulseaudio-x11"

63 64 65 66 67 68 69 70 71 72 73 74
  # PulseAudio is started automatically wit autosawn=yes (default value)
  sed -e 's|/usr/bin/pulseaudio --start "$@"|#&|' \
      -i "$pkgdir/usr/bin/start-pulseaudio-x11"
  sed -e 's|/usr/bin/pulseaudio --start "$@"|#&|' \
      -i "$pkgdir/usr/bin/start-pulseaudio-kde"
  
  # Avoid kde to show the "remove unused sound devices" if bell sound is executed by an application
  sed -e '27i\    /usr/bin/pactl load-module module-x11-bell "display=$DISPLAY" "sample=bell.ogg" > /dev/null' \
      -i "$pkgdir/usr/bin/start-pulseaudio-x11"
  sed -e '29i\    /usr/bin/pactl load-module module-x11-bell "display=$DISPLAY" "sample=bell.ogg" > /dev/null' \
      -i "$pkgdir/usr/bin/start-pulseaudio-kde"

75
  # Python fix
76
  sed -i '1s:python$:&2:' "$pkgdir/usr/bin/qpaeq"
77 78 79 80 81
    
  #### daemon.conf ####
  # Speed up pulseaudio shutdown
  # Lower resample quality, saves CPU
  sed -e '/exit-idle-time/iexit-idle-time=0' \
82
      -e '/resample-method/iresample-method=speex-float-1' \
83
      -i "$pkgdir/etc/pulse/daemon.conf"
84
  sed -e 's|; flat-volumes = yes|flat-volumes = no|' -i "$pkgdir/etc/pulse/daemon.conf"
85
  #### default.pa ####
86 87 88
  # Delay of sound notification workaround, needs to be removed once fixed in systemd
  sed -e 's/load-module module-udev-detect/load-module module-udev-detect tsched=0/' \
      -i "${pkgdir}/etc/pulse/default.pa"
89
  
90 91
  # Used only for SystemWide no needed for us
  # http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/
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
  rm "$pkgdir/etc/dbus-1/system.d/pulseaudio-system.conf"

### 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)
  optdepends=('alsa-plugins: ALSA support'
              'avahi: zeroconf support')
  backup=(etc/pulse/client.conf)
philm's avatar
philm committed
128

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