summaryrefslogtreecommitdiff
blob: b79ddd4bf803b4fd21f15dc404d24f017d8d6c13 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-video/transcode/transcode-0.6.12-r1.ebuild,v 1.9 2004/06/02 02:40:32 lv Exp $

inherit libtool flag-o-matic eutils

MY_P="${P/_pre/.}"
S=${WORKDIR}/${MY_P}
DESCRIPTION="video stream processing tool"
HOMEPAGE="http://zebra.fh-weingarten.de/~transcode/"
SRC_URI="http://www.zebra.fh-weingarten.de/~transcode/pre/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc -sparc amd64"
IUSE="sdl mpeg sse 3dnow encode X quicktime avi altivec oggvorbis theora"

DEPEND=">=media-libs/a52dec-0.7.4
	=sys-devel/gcc-3*
	>=media-libs/libdv-0.99
	x86? ( >=dev-lang/nasm-0.98.36 )
	>=media-libs/libdvdread-0.9.0
	>=media-video/ffmpeg-0.4.6
	>=media-libs/xvid-0.9.1
	>=media-video/mjpegtools-1.6.0
	>=dev-libs/lzo-1.08
	>=media-libs/libfame-0.9.0
	>=media-gfx/imagemagick-5.5.6.0
	media-libs/netpbm
	X? ( virtual/x11 )
	avi? (	>=media-video/avifile-0.7.38 )
	avi? ( x86? ( >=media-libs/divx4linux-20030428 ) )
	mpeg? ( media-libs/libmpeg3 )
	encode? ( >=media-sound/lame-3.93 )
	sdl? ( media-libs/libsdl )
	quicktime? ( virtual/quicktime )
	oggvorbis? ( media-libs/libvorbis media-libs/libogg )
	theora? ( media-libs/libtheora )"

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${FILESDIR}/transcode-gcc34.patch

	if has_version  '>=media-libs/netpbm-9.13'
	then
		einfo "New netbpm (>9.12)..."
		sed -i 's:-lppm:-lnetpbm:' \
			contrib/subrip/Makefile
	else
		einfo "Old netbpm (<=9.12)..."
	fi
}

src_compile() {
	# Don't build with -mfpmath=sse (Bug #14920)
	filter-mfpmath sse
	filter-flags -maltivec -mabi=altivec -fforce-addr -momit-leaf-frame-pointer
	# BREG error with -fPIC
	# ---
	# really ? no on amd64, and we need -fPIC.
	# Danny van Dyk <kugelfang@gentoo.org> 2004/05/25
	use !amd64 && filter-flags -fPIC

	local myconf="--with-dvdread"

	# fix invalid paths in .la files of plugins
	elibtoolize

	if [ "`use quicktime`" ]; then
		has_version 'media-libs/openquicktime' \
			&& myconf="${myconf} --with-openqt --without-qt" \
			|| myconf="${myconf} --without-openqt --with-qt"
	fi

	# Use the MPlayer libpostproc if present
	[ -f ${ROOT}/usr/lib/libpostproc.a ] && \
	[ -f ${ROOT}/usr/include/postproc/postprocess.h ] && \
		myconf="${myconf} --with-libpostproc-builddir=${ROOT}/usr/lib"

	econf \
		CFLAGS="${CFLAGS} -DDCT_YUV_PRECISION=1" \
		`use_enable sse` \
		`use_enable 3dnow` \
		`use_enable altivec` \
		`use_with avi avifile-mods` \
		`use_enable avi avifile6` \
		`use_enable encode lame` \
		`use_enable mpeg libmpeg3` \
		`use_with oggvorbis ogg` \
		`use_with oggvorbis vorbis` \
		`use_with theora` \
		`use_enable X x` \
		${myconf} \
		|| die

	# workaround for including avifile haders, which are expected
	# in an directory named "avifile"
	use avi \
		&& avi_inc=$(avifile-config --cflags | sed -e "s|^-I||") \
		&& [ -d "$avi_inc" ] \
		&& [ "$(basename "$avi_inc")" != "avifile" ] \
		&& ln -s "$avi_inc" avifile

	einfo "if this fails with broken kde libs, try reemerge avifile"
	einfo "also add mmx to your USE flags if you cpu supports it"
	emake -j1 all || die

	# subrip stuff
	cd contrib/subrip
	make || die
}

src_install () {
	make \
		DESTDIR=${D} \
		install || die

	dodoc AUTHORS COPYING ChangeLog README TODO

	# subrip stuff
	cd contrib/subrip
	dobin pgm2txt srttool subtitle2pgm subtitle2vobsub
	einfo ""
	einfo "This ebuild uses subtitles !!!"
	einfo ""
}