summaryrefslogtreecommitdiff
blob: c1a9ce4e01392420f050560e6bcc116ef36f0484 (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
63
64
65
66
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools multilib-minimal

DESCRIPTION="An mpeg library for linux"
HOMEPAGE="http://heroinewarrior.com/libmpeg3.php"
SRC_URI="
	mirror://sourceforge/heroines/${P}-src.tar.bz2
	https://dev.gentoo.org/~soap/distfiles/${P}-patches-r0.tar.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ppc ppc64 sparc x86"
IUSE="cpu_flags_x86_mmx"

RDEPEND="
	media-libs/a52dec
	sys-libs/zlib
	virtual/jpeg:0"
DEPEND="${RDEPEND}"
BDEPEND="cpu_flags_x86_mmx? ( dev-lang/nasm )"

PATCHES=(
	"${WORKDIR}"/patches/${PN}-1.7-mpeg3split.patch
	"${WORKDIR}"/patches/${PN}-1.7-textrel.patch
	"${WORKDIR}"/patches/${PN}-1.7-gnustack.patch
	"${WORKDIR}"/patches/${PN}-1.7-a52.patch
	"${WORKDIR}"/patches/${PN}-1.7-all_gcc4.patch
	"${WORKDIR}"/patches/${PN}-1.7-all_pthread.patch
	"${WORKDIR}"/patches/${P}-impldecl.patch
)

src_prepare() {
	default

	cp -rf "${WORKDIR}"/patches/1.7/. . || die
	eautoreconf
}

multilib_src_configure() {
	# disabling css since it's a fake one.
	# One can find in the sources this message :
	#   Stubs for deCSS which can't be distributed in source form
	ECONF_SOURCE="${S}" econf \
		$(use_enable cpu_flags_x86_mmx mmx) \
		--disable-css
}

multilib_src_install_all() {
	HTML_DOCS=( docs/. )
	einstalldocs

	# This is a workaround, it wants to rebuild
	# everything if the headers	 have changed
	# So we patch them after install...
	cd "${ED}"/usr/include/libmpeg3 || die
	# This patch patches the .h files that get installed into /usr/include
	# to show the correct include syntax '<>' instead of '""'  This patch
	# was also generated using info from SF's src.rpm
	eapply "${WORKDIR}"/patches/gentoo-p2.patch

	find "${ED}" -name '*.la' -delete || die
}