summaryrefslogtreecommitdiff
blob: 63d7fe7307907607b9e1060c974493e9cb528e82 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/gst-plugins/gst-plugins-0.6.1.ebuild,v 1.11 2004/03/19 07:56:03 mr_bones_ Exp $

inherit eutils libtool gnome2 flag-o-matic

# Create a major/minor combo for our SLOT and executables suffix
PVP=($(echo " $PV " | sed 's:[-\._]: :g'))
PV_MAJ_MIN=${PVP[0]}.${PVP[1]}

DESCRIPTION="Additional plugins for gstreamer - streaming media framework"
HOMEPAGE="http://gstreamer.sourceforge.net"
SRC_URI="mirror://sourceforge/gstreamer/${P}.tar.bz2"

LICENSE="LGPL-2.1"
SLOT=${PV_MAJ_MIN}
KEYWORDS="x86 sparc ppc amd64"
IUSE="encode quicktime mpeg jpeg esd gnome mikmod sdl png alsa arts dvd aalib oggvorbis mmx"

# required packages
# there are many many optional libraries. features are compiled if the libraries
# are present. most optional libraries are from gnome.

# TODO: I think we should split up these plugins in seperate ebuilds

RDEPEND="=media-libs/gstreamer-${PV}*

	media-sound/mad
	media-libs/hermes
	media-sound/cdparanoia

	oggvorbis? ( media-libs/libvorbis
		media-libs/libogg )
	encode? ( media-sound/lame )
	quicktime? ( media-libs/openquicktime )
	mpeg? (	=media-libs/libmpeg2-0.3.1* )
	esd? ( media-sound/esound )
	gnome? ( >=gnome-base/gnome-vfs-2.0.1 )
	mikmod? ( media-libs/libmikmod )
	sdl? ( media-libs/libsdl )
	jpeg? ( x86? ( mmx? ( media-video/mjpegtools ) ) )
	jpeg? ( media-libs/jpeg )
	png? ( >=media-libs/libpng-1.2.3 )
	alsa? ( >=media-libs/alsa-lib-0.9.0_rc2 )
	arts? ( >=kde-base/arts-1.0.2 )
	dvd? ( 	media-libs/libdvdnav
		media-libs/libdvdread )
	aalib? ( media-libs/aalib )"

# Some ditched minor plugins to bring number of deps down
#	>=media-libs/flac-1.0.3
#	virtual/jack
#	media-libs/ladspa-sdk"
#	>=media-libs/libdv-0.9.5

DEPEND="${RDEPEND}
	>=gnome-base/gconf-1.2.0
	>=dev-util/pkgconfig-0.9"

src_unpack() {
	unpack ${A}
	cd ${S}
	# ppc asm included in the resample plugin seems to be broken,
	# using a slower but working version for now
	epatch ${FILESDIR}/noppcasm.patch

	# ffmpeg libs fix
	use oggvorbis && epatch ${FILESDIR}/${PN}-${PV_MAJ_MIN}-ffmpeg_ldflags.patch

	# fix the scripts
	cd ${S}/tools
	mv gst-launch-ext gst-launch-ext.old
	sed -e "s:gst-launch :gst-launch-${PV_MAJ_MIN} :" \
		-e "s:gst-launch-ext:gst-launch-ext-${PV_MAJ_MIN}:" gst-launch-ext.old > gst-launch-ext
	chmod +x gst-launch-ext

	mv gst-visualise gst-visualise.old
	sed -e "s:gst-launch :gst-launch-${PV_MAJ_MIN} :" \
		-e "s:gst-visualise:gst-visualise-${PV_MAJ_MIN}:" gst-visualise.old > gst-visualise
	chmod +x gst-visualise
}

src_compile() {
	elibtoolize

	# gst doesnt handle optimisations well
	strip-flags
	replace-flags "-O3" "-O2"

	local myconf=""

	# FIXME : do this for _all_ IUSE flags
	use aalib \
		&& myconf="${myconf} --enable-aalib" \
		|| myconf="${myconf} --disable-aalib"
	use dvd \
		&& myconf="${myconf} --enable-dvdread --enable-dvdnav" \
		|| myconf="${myconf} --disable-dvdread --disable-dvdnav"
	use esd \
		&& myconf="${myconf} --enable-esd" \
		|| myconf="${myconf} --disable-esd"
	use alsa \
		&& myconf="${myconf} --enable-alsa" \
		|| myconf="${myconf} --disable-alsa"
	use arts \
		&& myconf="${myconf} --enable-arts --enable-artsc" \
		|| myconf="${myconf} --disable-arts --disable-artsc"
	use encode \
		&& myconf="${myconf} --enable-lame" \
		|| myconf="${myconf} --disable-lame"
	use jpeg \
		&& myconf="${myconf} --enable-jpeg" \
		|| myconf="${myconf} --disable-jpeg"
	use jpeg && use mmx \
		&& myconf="${myconf} --enable-mjpegtools" \
		|| myconf="${myconf} --disable-mjpegtools"
	use png \
		&& myconf="${myconf} --enable-png" \
		|| myconf="${myconf} --disable-png"
	use gnome \
		&& myconf="${myconf} --enable-gnome_vfs" \
		|| myconf="${myconf} --disable-gnome_vfs"
	use encode \
		&& myconf="${myconf} --enable-lame" \
		|| myconf="${myconf} --disable-lame"
	use quicktime \
		&& myconf="${myconf} --enable-openquicktime" \
		|| myconf="${myconf} --disable-openquicktime"
	use mpeg \
		&& myconf="${myconf} --enable-mpeg2dec" \
		|| myconf="${myconf} --disable-mpeg2dec"
	use sdl \
		&& myconf="${myconf} --enable-sdl --enable-sdltest" \
		|| myconf="${myconf} --disable-sdl --disable-sdltest"
	use oggvorbis \
		&& myconf="${myconf} --enable-vorbis --enable-vorbistest" \
		|| myconf="${myconf} --disable-vorbis --disable-vorbistest"
	use mikmod \
		&& myconf="${myconf} --enable-mikmod --enable-libmikmodtest" \
		|| myconf="${myconf} --disable-mikmod --disable-libmikmodtest"

	# qcam doesn't work on PPC
	use ppc && myconf="${myconf} --disable-qcam"

	econf ${myconf} \
		--program-suffix=-${PV_MAJ_MIN} \
		|| die "./configure failed"

	emake || make || die
}

pkg_postinst () {
	gnome2_gconf_install
	gst-register-${PV_MAJ_MIN}
}

USE_DESTDIR="1"
SCROLLKEEPER_UPDATE="0"

DOCS="AUTHORS COPYING INSTALL README RELEASE TODO"