summaryrefslogtreecommitdiff
blob: ffc3a86298f40b38980e52ea7d2dfec68dede09d (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
58
59
60
61
62
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/libmikmod/libmikmod-3.2.0_beta2-r5.ebuild,v 1.1 2012/02/09 18:27:38 slyfox Exp $

EAPI=2
MY_P=${P/_/-}
inherit autotools eutils flag-o-matic

DESCRIPTION="A library to play a wide range of module formats"
HOMEPAGE="http://mikmod.raphnet.net/"
SRC_URI="http://mikmod.raphnet.net/files/${MY_P}.tar.gz"

LICENSE="|| ( LGPL-2.1 LGPL-2 )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
# Enable OSS by default since ALSA support isn't available, look below
IUSE="+oss raw static-libs"

S=${WORKDIR}/${MY_P}

src_prepare() {
	epatch "${FILESDIR}"/${P}-64bit.patch \
		"${FILESDIR}"/${P}-autotools.patch \
		"${FILESDIR}"/${P}-info.patch \
		"${FILESDIR}"/${P}-doubleRegister.patch \
		"${FILESDIR}"/${PN}-CVE-2007-6720.patch \
		"${FILESDIR}"/${PN}-CVE-2009-0179.patch \
		"${FILESDIR}"/${P}-no-drv_raw.patch \
		"${FILESDIR}"/${P}-fix-vol-crash.patch \
		"${FILESDIR}"/${P}-fix-unload-crash.patch \
		"${FILESDIR}"/${P}-CVE-2009-3995-3996.patch \
		"${FILESDIR}"/${P}-CVE-2010-2546-2971.patch \
		"${FILESDIR}"/${P}-pa-workaround.patch \
		"${FILESDIR}"/${P}-shell.patch

	AT_M4DIR=${S} eautoreconf
}

src_configure() {
	use raw && append-flags -DDRV_RAW

	# * af is something called AF/AFlib.h and -lAF, not audiofile in tree
	# * alsa support is for deprecated API and doesn't work
	econf \
		--disable-af \
		--disable-alsa \
		--disable-esd \
		$(use_enable oss) \
		$(use_enable static-libs static)
}

src_install() {
	emake DESTDIR="${D}" install || die
	dodoc AUTHORS NEWS README TODO
	dohtml docs/*.html

	use static-libs || find "${ED}" -name '*.la' -delete
}

pkg_postinst() {
	use oss || ewarn "No audio output will be available because of USE=\"-oss\"."
}