Initial commit for 1.0.18-rc1 alsa (alsa-lib 1.0.17 -> 1.0.17a, REQUIRED if you are...
[gentoo-diskmaster-overlay.git] / media-sound / alsa-driver / alsa-driver-1.0.18_rc1.ebuild
blobab54d349bdce4109b6eaca11ef4f3d1e02bc6177
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.16.ebuild,v 1.1 2008/04/14 02:47:04 beandog Exp $
5 inherit autotools linux-mod flag-o-matic eutils multilib linux-info
7 MY_P="${P/_rc/rc}"
8 S="${WORKDIR}/${MY_P}"
10 DESCRIPTION="Advanced Linux Sound Architecture kernel modules"
11 HOMEPAGE="http://www.alsa-project.org/"
12 RESTRICT="nomirror"
14 if [[ ${MY_P} == ${MY_P/_p*/} ]]; then
15 SRC_URI="mirror://alsaproject/driver/${MY_P}.tar.bz2"
16 else # Gentoo snapshots
17 SRC_URI="mirror://gentoo/${MY_P}.tar.bz2"
20 LICENSE="GPL-2 LGPL-2.1"
21 SLOT="0"
23 KEYWORDS="-amd64 -x86"
24 IUSE="oss debug midi"
26 IUSE_CARDS="seq-dummy dummy virmidi mtpav mts64 serial-u16550 mpu401
27 loopback portman2x4 pcsp ad1848-lib adlib ad1816a ad1848
28 als100 azt2320 cmi8330 cs4231 cs4232 cs4236 dt019x es968 es1688 es18xx
29 gusclassic gusextreme gusmax interwave interwave-stb opl3sa2
30 opti92x-ad1848 opti92x-cs4231 opti93x miro sb8 sb16 sbawe sgalaxy
31 sscape wavefront pc98-cs4232 msnd-pinnacle ad1889 als300 als4000
32 ali5451 atiixp atiixp-modem au8810 au8820 au8830 azt3328 bt87x ca0106
33 cmipci cs4281 cs46xx cs5535audio darla20 gina20 layla20 darla24 gina24
34 layla24 mona mia echo3g indigo indigoio indigodj emu10k1 emu10k1x
35 ens1370 ens1371 es1938 es1968 fm801 fm801-tea575x hda-intel hdsp hdspm
36 ice1712 ice1724 intel8x0 intel8x0m korg1212 maestro3 mixart nm256
37 pcxhr riptide rme32 rme96 rme9652 sonicvibes trident via82xx
38 via82xx-modem vx222 ymfpci pdplus asihpi powermac aoa
39 aoa-fabric-layout aoa-onyx aoa-tas aoa-toonie aoa-soundbus
40 aoa-soundbus-i2s sa11xx-uda1341 armaaci s3c2410 pxa2xx-i2sound au1x00
41 usb-audio usb-usx2y vxpocket pdaudiocf sun-amd7930 sun-cs4231 sun-dbri
42 harmony soc at91-soc at91-soc-eti-b1-wm8731 pxa2xx-soc
43 pxa2xx-soc-corgi pxa2xx-soc-spitz pxa2xx-soc-poodle pxa2xx-soc-tosa hifier
44 ml403-ac97cr oxygen pxa2xx-soc-e800 sis7019 virtuoso"
46 for iuse_card in ${IUSE_CARDS}; do
47 IUSE="${IUSE} alsa_cards_${iuse_card}"
48 done
50 RDEPEND="virtual/modutils
51 !media-sound/snd-aoa"
52 DEPEND="${RDEPEND}
53 >=media-sound/alsa-headers-${PV}
54 virtual/linux-sources
55 sys-apps/debianutils"
57 PROVIDE="virtual/alsa"
59 pkg_setup() {
60 # By default, drivers for all supported cards will be compiled.
61 # If you want to only compile for specific card(s), set ALSA_CARDS
62 # environment to a space-separated list of drivers that you want to build.
63 # For example:
65 # env ALSA_CARDS='emu10k1 intel8x0 ens1370' emerge alsa-driver
67 ALSA_CARDS=${ALSA_CARDS:-${IUSE_ALSA_CARDS}}
69 local PNP_DRIVERS="interwave interwave-stb"
70 local PNP_ERROR="Some of the drivers you selected require PnP support in your kernel (${PNP_DRIVERS}). Either enable PnP in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf."
72 local ISA_DRIVERS="cs4232 msnd-pinnacle adlib ad1816a ad1848 als100 azt2320
73 cmi8330 cs4231 cs4236 dt019x es968 es1688 es18xx gusclassic gusextreme gusmax
74 interwave interwave-stb opl3sa2 opti92x-ad1848 opti92x-cs4231 opti93x miro sb8
75 sb16 sbawe sb16_csp sgalaxy sscape wavefront"
76 local ISA_ERROR="Some of the drivers you selected require ISA support in your kernel ($(echo $ISA_DRIVERS)). Either enable ISA in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf."
78 local FW_DRIVERS="darla20 gina20 layla20 darla24 gina24 layla24 mona mia echo3g indigo
79 indigoio indigodj emu10k1 korg1212 maestro3 riptide ymfpci asihpi"
80 local FW_LOADER_ERROR="Some of the drivers you selected require 'Userspace firmware loading support' in your kernel (${FW_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf."
82 local PARPORT_DRIVERS="portman2x4"
83 local PARPORT_ERROR="Some if the drivers you selected require Parallel Port support (${PARPORT_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf."
85 local TMP_ALSA_CARDS
86 local CHECK_PNP
87 local CHECK_ISA
88 local CHECK_FW
89 local CHECK_PARPORT
90 for card in ${ALSA_CARDS}; do
91 if has alsa_cards_${card} ${IUSE} && use alsa_cards_${card}; then
92 TMP_ALSA_CARDS="${TMP_ALSA_CARDS} ${card}"
93 has ${card} ${PNP_DRIVERS} && CHECK_PNP="PNP"
94 has ${card} ${ISA_DRIVERS} && CHECK_ISA="ISA"
95 has ${card} ${FW_DRIVERS} && CHECK_FW="FW_LOADER"
96 has ${card} ${PARPORT_DRIVERS} && CHECK_PARPORT="PARPORT"
98 done
99 ALSA_CARDS="${TMP_ALSA_CARDS}"
101 local CONFIG_CHECK="!SND SOUND ${CHECK_PNP} ${CHECK_ISA} ${CHECK_FW} ${CHECK_PARPORT}"
102 local SND_ERROR="ALSA is already compiled into the kernel. This is the recommended configuration, don't emerge alsa-driver."
103 local SOUND_ERROR="Your kernel doesn't have sound support enabled."
104 local SOUND_PRIME_ERROR="Your kernel is configured to use the deprecated OSS drivers. Please disable them and re-emerge alsa-driver."
106 linux-mod_pkg_setup
108 if [[ ${PROFILE_ARCH} == "sparc64" ]] ; then
109 export CBUILD=${CBUILD-${CHOST}}
110 export CHOST="sparc64-unknown-linux-gnu"
114 src_unpack() {
115 unpack ${A}
117 cd "${S}"
119 #epatch "${FILESDIR}"/git-update-r${PR}.patch
120 convert_to_m "${S}/Makefile"
121 sed -i -e 's:\(.*depmod\):#\1:' "${S}/Makefile"
122 eautoconf
125 src_compile() {
126 local myABI=${ABI:-${DEFAULT_ABI}}
128 # Should fix bug #46901
129 is-flag "-malign-double" && filter-flags "-fomit-frame-pointer"
130 append-flags "-I${KV_DIR}/arch/$(tc-arch-kernel)/include"
132 econf $(use_with oss) \
133 $(use_with debug debug full) \
134 --with-kernel="${KV_DIR}" \
135 --with-build="${KV_OUT_DIR}" \
136 --with-isapnp=yes \
137 $(use_with midi sequencer) \
138 --with-cards="${ALSA_CARDS}" || die "econf failed"
140 # linux-mod_src_compile doesn't work well with alsa
142 ARCH=$(tc-arch-kernel)
143 ABI=${KERNEL_ABI}
144 emake LDFLAGS="$(raw-ldflags)" HOSTCC="$(tc-getBUILD_CC)" CC="$(tc-getCC)" || die "Make Failed"
145 ARCH=$(tc-arch)
146 ABI=${myABI}
149 src_install() {
150 emake DESTDIR="${D}" install-modules || die "make install failed"
152 dodoc CARDS-STATUS FAQ README WARNING TODO SUPPORTED_KERNELS
154 if kernel_is 2 6; then
155 # mv the drivers somewhere they won't be killed by the kernel's make modules_install
156 mv "${D}/lib/modules/${KV_FULL}/kernel/sound" "${D}/lib/modules/${KV_FULL}/${PN}"
157 rmdir "${D}/lib/modules/${KV_FULL}/kernel" &> /dev/null
161 pkg_postinst() {
162 elog
163 elog "Remember that all mixer channels will be MUTED by default."
164 elog "Use the 'alsamixer' program to unmute them, then save your"
165 elog "mixer settings with /etc/init.d/alsasound save"
166 elog
167 elog "If you experience problems, please try building the in-kernel"
168 elog "ALSA drivers instead. This ebuild is unsupported."
169 elog
171 linux-mod_pkg_postinst
173 if kernel_is 2 6 && [ -e "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" ]; then
174 # Cleanup if they had older alsa installed
175 for file in $(find "${ROOT}/lib/modules/${KV_FULL}/${PN}" -type f); do
176 rm -f ${file//${KV_FULL}\/${PN}/${KV_FULL}\/kernel\/sound}
177 done
179 find "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" -type d -print0 | xargs --null rmdir