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

EAPI=4
inherit linux-mod versionator

MY_PV=$(get_version_component_range 1-2)
BUILD=$(get_version_component_range 3)

DESCRIPTION="Open Sound System - drivers"
HOMEPAGE="http://developer.opensound.com/"
SRC_URI="mirror://debian/pool/main/o/oss4/oss4-dkms_${MY_PV}-build${BUILD}-2_amd64.deb"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

src_unpack() {
	unpack ${A}
	mkdir "${S}"
	cd "${S}"
	tar xf "${WORKDIR}"/data.tar.gz
}

src_prepare() {
	sed -e "s/-isystem \$(MULTIARCH_PATH)//" \
		-e "/^MULTIARCH_PATH/d" \
		-i usr/src/oss4-${MY_PV}-build${BUILD}/{core,drivers}/Makefile || die
}

src_compile() {
	cd usr/src/oss4-${MY_PV}-build${BUILD}
	set_arch_to_kernel
	cp /usr/include/linux/limits.h core
	emake -C "${KV_DIR}" SUBDIRS="$(pwd)"/core modules
	emake -C drivers osscore_symbols.inc
	emake -C "${KV_DIR}" SUBDIRS="$(pwd)"/drivers modules
}

src_install() {
	cd usr/src/oss4-${MY_PV}-build${BUILD}
	insinto /lib/modules/${KV_FULL}/kernel/sound/core
	doins core/osscore.${KV_OBJ}

	insinto /lib/modules/${KV_FULL}/kernel/sound/pci
	doins drivers/*.${KV_OBJ}
}

pkg_postinst() {
	elog "To get sound devices, you need to run"
	elog "	# ossdetect -d"
	elog "and"
	elog "	# ossdevlinks"
}