summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d0d0e6c3bedc062a0ac7b4161fa40b3e6657f8da (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
# Maintainer: Christian Hesse <arch@eworm.de>
# Contributor: speps <speps at aur dot archlinux dot org>

pkgname=lib32-apulse
pkgver=0.1.13
pkgrel=1
pkgdesc='PulseAudio emulation for ALSA (32-bit)'
arch=('x86_64')
url='https://github.com/i-rinat/apulse'
license=('custom:MIT')
depends=('lib32-glib2' 'lib32-alsa-lib')
makedepends=('cmake' 'gcc-multilib')
install=lib32-apulse.install
source=("apulse-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
        'asoundrc.sample')
sha256sums=('9234ec4e10e408b9c01d5f4ea768ad1fc15494217c932db2c435202a9c7b5efd'
            'e851197ec9ebff528154210751cd6d5c426abfc2b1aa34343580407b1ea789a4')

prepare() {
	cd apulse-${pkgver}
	mkdir -p build

	# install in /usr/lib32
	sed -i '/^set(APULSEPATH /s|lib|&32|' CMakeLists.txt
}

build() {
	cd apulse-${pkgver}/build

	export CFLAGS=-m32
	export CXXFLAGS=-m32
	export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release
	make
}

package() {
	cd apulse-${pkgver}/build

	make DESTDIR="${pkgdir}/" install

	# do not conflict with apulse
	mv "${pkgdir}/usr/bin/apulse" \
		"${pkgdir}/usr/bin/apulse32"

	# sample asoundrc
	install -Dm644 ../../${source[1]} \
		"${pkgdir}/usr/share/${pkgname}/${source[1]}"

	# license
	install -Dm644 ../LICENSE.MIT \
		"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}