summaryrefslogtreecommitdiff
blob: cb58e9760511dd162e673de6ba7c6e7a6dd53162 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils linux-info linux-mod

SPKG="btsco"

DESCRIPTION="BlueTooth headset driver for ALSA (snd-bt-sco)"
HOMEPAGE="http://bluetooth-alsa.sourceforge.net/"
SRC_URI="mirror://sourceforge/bluetooth-alsa/${SPKG}-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~x86"
IUSE=""

DEPEND=""

S="${WORKDIR}/${SPKG}-${PV}/kernel"

MODULE_NAMES="snd-bt-sco()"
BUILD_PARAMS="-j1"
BUILD_TARGETS="default"

pkg_setup() {

	if kernel_is 2 4; then
		die "${P} does not support building against kernel 2.4.x"
	fi

	# The wording below is checked for linux-2.6.14.4
	CONFIG_CHECK="BT_SCO BT_HCIUSB_SCO SND_HWDEP"
	ERROR_BT_SCO="BT_SCO is not set! \n\
		Please select 'L2CAP protocol support' and 'SCO links support' under \n\
		Networking|Bluetooth subsystem support|SCO links support"
	ERROR_BT_HCIUSB_SCO="BT_HCIUSB_SCO is not set! \n\
		Please select 'HCI USB driver' under \n\
		Networking|Bluetooth subsystem support|Bluetooth device drivers|SCO (voice) support"
	ERROR_SND_HWDEP="SND_HWDEP is not set! \n\
		Please select a config like SND_USB_AUDIO or SND_EMU10K1; \n\
		look under Device drivers|Sound|ALSA|PCI"

	linux-mod_pkg_setup
}

src_unpack() {
	cd ${S}
	unpack ${A}
	einfo "Patching ${S}/Makefile to use '${KV_DIR}'"
	sed -i ${S}/Makefile -e "s,/lib/modules/\`uname -r\`/build,${KV_DIR},g" || die "Unable to patch Makefile"
}