Name libcanberra
Description A small and lightweight implementation of the XDG Sound Theme Specification
Version 1:0.30+r2+gc0620e4-6
Package Base libcanberra
Homepage https://0pointer.net/lennart/projects/libcanberra/
Maintainers ['Balló György <bgyorgy@archlinux.org>', 'Jan Alexander Steffens (heftig) <heftig@archlinux.org>']
Contributors ['Jan de Groot <jgc@archlinux.org>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/libcanberra
Sources ['40-libcanberra-gtk-module.sh', 'git+https://git.0pointer.net/clone/libcanberra.git#commit=c0620e432650e81062c1967cc669829dbd29b310', 'libcanberra-multi-backend.patch']
Dependencies ['alsa-lib', 'libltdl', 'libpulse', 'libvorbis', 'sound-theme-freedesktop', 'tdb']
Optional-Dependencies ['gtk3']
Build-Dependencies ['gtk-doc', 'gtk3', 'git']
Provides ['libcanberra-pulse', 'libcanberra.so', 'libcanberra-gtk3.so']
Builddate 24-10-2025 18:44:35
Architecture x86_64
Distro-Version
Licenses ['LGPL-2.1-or-later']
Hash 1aca6220b76c4009dbfcad432fcef529fa8fcb2cb187b03a506a2270d50110b1
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libcanberra
pkgver=0.30+r2+gc0620e4
pkgrel=6
epoch=1
pkgdesc="A small and lightweight implementation of the XDG Sound Theme Specification"
url="https://0pointer.net/lennart/projects/libcanberra/"
arch=(x86_64)
license=(LGPL-2.1-or-later)
depends=(libvorbis libltdl alsa-lib libpulse tdb sound-theme-freedesktop)
makedepends=(gtk-doc gtk3 git)
optdepends=('gtk3: canberra-gtk-play')
provides=(libcanberra-pulse libcanberra{,-gtk3}.so)
replaces=("libcanberra-pulse<0.30+2+gc0620e4-4")
options=(libtool)
_commit=c0620e432650e81062c1967cc669829dbd29b310  # master
source=("git+https://git.0pointer.net/clone/libcanberra.git#commit=$_commit"
        40-libcanberra-gtk-module.sh
        libcanberra-multi-backend.patch)
sha256sums=('SKIP'
            'a0d0b135d3fea5c703a5f84208b79d66f671b082ae85f67b629ee2568a7ddc30'
            'de146cae3e40a16b38c8edb4f1a3a423c64eb9c5000e36c316b677e9909c9b06')

pkgver() {
  cd libcanberra
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libcanberra

  # https://bugs.archlinux.org/task/71341
  # https://bugs.freedesktop.org/show_bug.cgi?id=51662
  git apply -3 ../libcanberra-multi-backend.patch

  ./autogen.sh
}

build() {
  cd libcanberra
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --disable-static --with-builtin=dso --enable-null --disable-oss \
      --enable-alsa --enable-pulse \
      --with-systemdsystemunitdir=/usr/lib/systemd/system --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd libcanberra

  make -j1 DESTDIR="$pkgdir" install

  rm "$pkgdir"/usr/lib/*.la
  rm "$pkgdir"/usr/lib/gtk-3.0/modules/*.la

  # FS#52370: Remove login, logout and system-ready sounds.
  # We have no sound themes that include these so do not play them.
  rm -r "$pkgdir"/usr/share/{gnome,gdm}

  install -Dt "$pkgdir/etc/X11/xinit/xinitrc.d" ../40-libcanberra-gtk-module.sh
}

# vim:set sw=2 sts=-1 et: