summaryrefslogtreecommitdiff
blob: 74a6725f968a572981ae5056865fdb7cceda6e82 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-video/xanim-export/xanim-export-2.80.1-r4.ebuild,v 1.6 2007/07/22 08:31:42 dberkholz Exp $

inherit flag-o-matic eutils toolchain-funcs
strip-flags -finline-functions
replace-flags -O3 -O2

_XA_CYUV_sparc=xa1.0_cyuv_sparcELF.o
_XA_CVID_sparc=xa2.0_cvid_sparcELF.o
_XA_IV32_sparc=xa2.0_iv32_sparcELF.o
_XA_EXT_sparc=.Z

_XA_CYUV_x86=xa1.0_cyuv_linuxELFg21.o
_XA_CVID_x86=xa2.0_cvid_linuxELFg21.o
_XA_IV32_x86=xa2.1_iv32_linuxELFg21.o
_XA_EXT_x86=.gz

_XA_CYUV_ppc=xa1.0_cyuv_linuxPPC.o
_XA_CVID_ppc=xa2.0_cvid_linuxPPC.o
_XA_IV32_ppc=xa2.0_iv32_linuxPPC.o
_XA_EXT_ppc=.Z

MY_P="xanim_exporting_edition"

# This might leave _XA_EXT empty and that's fine, just indicates no
# particular support for a given arch
eval _XA_EXT=\${_XA_EXT_${ARCH}}
eval _XA_CVID=\${_XA_CVID_${ARCH}}
eval _XA_CYUV=\${_XA_CYUV_${ARCH}}
eval _XA_IV32=\${_XA_IV32_${ARCH}}

# Not much we could do here, the modules are predownloaded and
# xanim-export compiles against them
QA_EXECSTACK_x86="usr/bin/xanim-export
	    usr/lib/xanim/mods-export/${_XA_CVID}
	    usr/lib/xanim/mods-export/${_XA_CYUV}
	    usr/lib/xanim/mods-export/${_XA_IV32}
	    usr/lib/xanim/mods-export/${_XA_CVID/g21/}
	    usr/lib/xanim/mods-export/${_XA_CYUV/g21/}
	    usr/lib/xanim/mods-export/xa2.0_iv32_linuxELF.o"

DESCRIPTION="XAnim with Quicktime and RAW Audio export functions"
HOMEPAGE="http://heroin.linuxave.net/toys.html"
SRC_URI="http://heroine.linuxave.net/${MY_P}.tar.gz
	sparc? (
		ftp://xanim.va.pubnix.com/modules/${_XA_CYUV_sparc}${_XA_EXT_sparc}
		ftp://xanim.va.pubnix.com/modules/${_XA_CVID_sparc}${_XA_EXT_sparc}
		ftp://xanim.va.pubnix.com/modules/${_XA_IV32_sparc}${_XA_EXT_sparc}
	)
	ppc? (
		ftp://xanim.va.pubnix.com/modules/${_XA_CYUV_ppc}${_XA_EXT_ppc}
		ftp://xanim.va.pubnix.com/modules/${_XA_CVID_ppc}${_XA_EXT_ppc}
		ftp://xanim.va.pubnix.com/modules/${_XA_IV32_ppc}${_XA_EXT_ppc}
	)
	x86? (
		ftp://xanim.va.pubnix.com/modules/${_XA_CYUV_x86}${_XA_EXT_x86}
		ftp://xanim.va.pubnix.com/modules/${_XA_CVID_x86}${_XA_EXT_x86}
		ftp://xanim.va.pubnix.com/modules/${_XA_IV32_x86}${_XA_EXT_x86}
	)"

LICENSE="XAnim"
SLOT="0"
KEYWORDS="ppc sparc x86"
IUSE=""

RDEPEND="virtual/libc
	>=media-libs/jpeg-6b
	>=media-libs/libpng-1.2.1
	x11-libs/libXext
	x11-libs/libXt"

DEPEND="${RDEPEND}
	app-arch/ncompress
	x11-proto/xextproto
	x11-proto/xproto"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${MY_P}.tar.gz

	if [[ -n ${_XA_EXT} ]]; then
		cd "${S}"/mods || die
		unpack ${_XA_CVID}${_XA_EXT}
		unpack ${_XA_CYUV}${_XA_EXT}
		unpack ${_XA_IV32}${_XA_EXT}
	fi

	cd "${S}"
	rm -f xanim
	epatch "${FILESDIR}"/${PV}-makefile.patch

	# make compile respect CC, fix deprecated paths
	sed -i -e "/CC =/s:gcc:$(tc-getCC):" \
		-e "/INCLUDE =/s:/usr/X11R6:/usr:g" \
		-e "/XLIBDIR =/s:/usr/X11R6:/usr:" \
		-e "/XA_DLL_PATH =/s:/usr/X11R6:/usr:" \
		Makefile || die "sed failed in Makefile"

	# make quicktime compile respect CFLAGS
	local x="$(echo \`./c_flags\`)"
	local dir="quicktime/quicktime"
	sed -i -e "s:${x}:${CFLAGS}:" \
		${dir}/Makefile || die "sed failed in ${dir}/Makefile"
}

src_compile() {
	cd "${S}"/quicktime
	make \
		CC="$(tc-getCC)" \
		XA_IV32_LIB=mods/${_XA_CYUV} \
		XA_CVID_LIB=mods/${_XA_CVID} \
		XA_CYUV_LIB=mods/${_XA_IV32} \
		|| die "make quicktime failed"
	cd ..
	make \
		XA_IV32_LIB=mods/${_XA_CYUV} \
		XA_CVID_LIB=mods/${_XA_CVID} \
		XA_CYUV_LIB=mods/${_XA_IV32} \
		OPTIMIZE="${CFLAGS}" \
		|| die "main make failed"
}

src_install() {
	newbin xanim xanim-export
	insinto /usr/lib/xanim/mods-export
	doins mods/*
	dodoc README*
	dodoc docs/README.* docs/*.readme docs/*.doc
}