Lines 4-59
Link Here
|
4 |
|
4 |
|
5 |
inherit flag-o-matic gcc eutils |
5 |
inherit flag-o-matic gcc eutils |
6 |
|
6 |
|
|
|
7 |
M4V="1" |
8 |
|
7 |
DESCRIPTION="Tools for MJPEG video" |
9 |
DESCRIPTION="Tools for MJPEG video" |
8 |
HOMEPAGE="http://mjpeg.sourceforge.net/" |
10 |
HOMEPAGE="http://mjpeg.sourceforge.net/" |
9 |
SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz" |
11 |
SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz |
|
|
12 |
mirror://gentoo/${PN}-m4-${M4V}.tar.bz2" |
10 |
|
13 |
|
11 |
LICENSE="as-is" |
14 |
LICENSE="as-is" |
12 |
SLOT="1" |
15 |
SLOT="1" |
13 |
KEYWORDS="x86 ppc amd64 ~sparc ppc64" |
16 |
KEYWORDS="x86 ppc amd64 ~sparc ppc64" |
14 |
IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse" |
17 |
IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse v4l dga cmov" |
15 |
|
18 |
|
16 |
DEPEND="media-libs/jpeg |
19 |
RDEPEND="media-libs/jpeg |
17 |
>=sys-apps/sed-4 |
|
|
18 |
x86? ( media-libs/libmovtar |
20 |
x86? ( media-libs/libmovtar |
19 |
mmx? ( >=media-libs/jpeg-mmx-1.1.2-r1 |
21 |
mmx? ( >=media-libs/jpeg-mmx-1.1.2-r1 ) |
20 |
dev-lang/nasm ) |
|
|
21 |
3dnow? ( dev-lang/nasm ) |
22 |
sse? ( dev-lang/nasm ) |
23 |
) |
22 |
) |
24 |
gtk? ( =x11-libs/gtk+-1.2* |
23 |
gtk? ( =x11-libs/gtk+-1.2* |
25 |
=dev-libs/glib-1.2* ) |
24 |
=dev-libs/glib-1.2* ) |
26 |
avi? ( >=media-video/avifile-0.7.38 ) |
25 |
avi? ( >=media-video/avifile-0.7.38 ) |
27 |
dv? ( >=media-libs/libdv-0.99 ) |
26 |
dv? ( >=media-libs/libdv-0.99 ) |
28 |
quicktime? ( virtual/quicktime ) |
27 |
quicktime? ( virtual/quicktime ) |
29 |
sdl? ( >=media-libs/libsdl-1.2.7-r3 ) |
28 |
sdl? ( >=media-libs/libsdl-1.2.7-r3 ) |
30 |
X? ( virtual/x11 )" |
29 |
X? ( virtual/x11 )" |
31 |
|
30 |
|
|
|
31 |
DEPEND="${RDEPEND} |
32 |
x86? ( mmx? ( dev-lang/nasm ) |
33 |
3dnow? ( dev-lang/nasm ) |
34 |
sse? ( dev-lang/nasm ) |
35 |
) |
36 |
>=sys-apps/sed-4 |
37 |
sys-devel/autoconf |
38 |
=sys-devel/automake-1.5*" |
39 |
|
32 |
src_unpack() { |
40 |
src_unpack() { |
33 |
unpack ${A} ; cd ${S} |
41 |
unpack ${A} ; cd ${S} |
34 |
cp -rf ${S}{,.orig} |
|
|
35 |
|
42 |
|
|
|
43 |
epatch ${FILESDIR}/${PV}-configure.patch |
36 |
epatch ${FILESDIR}/${P}-fPIC.patch |
44 |
epatch ${FILESDIR}/${P}-fPIC.patch |
37 |
epatch ${FILESDIR}/${P}-gcc34.patch |
45 |
epatch ${FILESDIR}/${P}-gcc34.patch |
38 |
epatch ${FILESDIR}/${P}-dv.patch |
|
|
39 |
|
40 |
# remove checks for gtk in configure in |
41 |
use gtk || epatch ${FILESDIR}/${P}-nogtk.patch |
42 |
|
46 |
|
43 |
if use ppc; then |
47 |
if use ppc; then |
44 |
# Fix an error in the detection of the altivec-support |
48 |
# Fix an error in the detection of the altivec-support |
45 |
# in the compiler |
49 |
# in the compiler |
46 |
epatch "${FILESDIR}/altivec-fix-${PV}.patch" |
50 |
epatch "${FILESDIR}/altivec-fix-${PV}.patch" |
47 |
sed -i 's:-O3::' configure.in |
51 |
sed -i -e 's:-O3::' configure.in |
48 |
#Worst workaround ever... |
52 |
#Worst workaround ever... |
49 |
sed -i \ |
53 |
sed -i -e "s/const vector signed short/vector signed short/g" \ |
50 |
-e "s/const vector signed short /vector signed short /g" \ |
54 |
${S}/utils/altivec/fdct_idct.c |
51 |
${S}/utils/altivec/fdct_idct.c |
|
|
52 |
fi |
55 |
fi |
53 |
|
56 |
|
54 |
aclocal |
|
|
55 |
libtoolize --copy --force |
57 |
libtoolize --copy --force |
56 |
autoreconf || die |
58 |
ACLOCAL="aclocal -I ${WORKDIR}/m4" autoreconf || die |
57 |
|
59 |
|
58 |
use X || epatch "${FILESDIR}/no-x11-lib-2.patch" |
60 |
use X || epatch "${FILESDIR}/no-x11-lib-2.patch" |
59 |
} |
61 |
} |
Lines 61-85
Link Here
|
61 |
src_compile() { |
63 |
src_compile() { |
62 |
local myconf |
64 |
local myconf |
63 |
|
65 |
|
64 |
[ $(gcc-major-version) -eq 3 ] && [ "${ARCH}" == "x86" ] && append-flags -mno-sse2 |
66 |
if use yv12 && use dv; then |
65 |
|
67 |
myconf="${myconf} --with-dv-yv12" |
66 |
myconf="${myconf} $(use_with X x)" |
68 |
elif use yv12; then |
67 |
myconf="${myconf} $(use_with quicktime)" |
69 |
ewarn "yv12 support is possible when 'dv' is in your USE flags." |
68 |
myconf="${myconf} $(use_enable x86 cmov-extensions)" |
|
|
69 |
|
70 |
# Fix for Via C3-1, see #30345 |
71 |
grep -q cmov /proc/cpuinfo || myconf="${myconf} --enable-cmov-extension=no" |
72 |
|
73 |
if use dv; then |
74 |
myconf="${myconf} --with-dv=/usr" |
75 |
myconf="${myconf} $(use_with yv12 dv-yv12)" |
76 |
else |
77 |
myconf="${myconf} --without-dv --without-dv-yv12" |
78 |
if use yv12; then |
79 |
ewarn "yv12 support is only possible when \"dv\" is in your USE flags." |
80 |
fi |
81 |
fi |
70 |
fi |
82 |
|
71 |
|
|
|
72 |
# This could be changed to allow building on g/fbsd in the future. |
83 |
if use x86; then |
73 |
if use x86; then |
84 |
if use mmx || use 3dnow || use sse; then |
74 |
if use mmx || use 3dnow || use sse; then |
85 |
myconf="${myconf} --enable-simd-accel" |
75 |
myconf="${myconf} --enable-simd-accel" |
Lines 88-108
Link Here
|
88 |
if use mmx; then |
78 |
if use mmx; then |
89 |
myconf="${myconf} --with-jpeg-mmx=/usr/include/jpeg-mmx" |
79 |
myconf="${myconf} --with-jpeg-mmx=/usr/include/jpeg-mmx" |
90 |
fi |
80 |
fi |
|
|
81 |
|
82 |
myconf="${myconf} $(use_enable cmov cmov-extension)" |
83 |
|
84 |
[[ $(gcc-major-version) -eq 3 ]] && append-flags -mno-sse2 |
91 |
fi |
85 |
fi |
92 |
|
86 |
|
93 |
econf ${myconf} || die |
87 |
econf \ |
94 |
|
88 |
$(use_with X x) \ |
95 |
if has_pie ; then |
89 |
$(use_enable dga xfree-ext) \ |
96 |
pie_magic="`test_flag -fno-pic` `test_flag -nopie`" |
90 |
$(use_with quicktime) \ |
97 |
for i in `find "${S}" -name "Makefile"` ; do |
91 |
$(use_with v4l) \ |
98 |
sed -e "s:CC = gcc:CC = gcc ${pie_magic}:g" \ |
92 |
$(use_with gtk) \ |
99 |
-e "s:CXX = gcc:CXX = g++ ${pie_magic}:g" \ |
93 |
$(use_with sdl) \ |
100 |
-e "s:CXXCPP = gcc -E:CXX = g++ -E ${pie_magic}:g" \ |
94 |
$(use_with dv dv /usr) \ |
101 |
-i "${i}" || die "sed failed" |
95 |
${myconf} || die |
102 |
done |
96 |
|
|
|
97 |
if has_pie; then |
98 |
pie_magic="$(test_flag -fno-pic) $(test_flag -nopie)" |
99 |
|
100 |
find "${S}" -name Makefile | xargs sed -i \ |
101 |
-e "s:CC = gcc:CC = gcc ${pie_magic}:g" \ |
102 |
-e "s:CXX = gcc:CXX = g++ ${pie_magic}:g" \ |
103 |
-e "s:CXXCPP = gcc -E:CXX = g++ -E ${pie_magic}:g" \ |
104 |
|| die "sed failed" |
103 |
fi |
105 |
fi |
104 |
|
106 |
|
105 |
emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" -j1 || die "compile problem" |
107 |
emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" -j1 || die "emake failed" |
106 |
cd docs |
108 |
cd docs |
107 |
local infofile |
109 |
local infofile |
108 |
for infofile in mjpeg*info*; do |
110 |
for infofile in mjpeg*info*; do |
Lines 115-119
Link Here
|
115 |
|
117 |
|
116 |
src_install() { |
118 |
src_install() { |
117 |
einstall || die "install failed" |
119 |
einstall || die "install failed" |
118 |
dodoc mjpeg_howto.txt |
120 |
dodoc mjpeg_howto.txt README PLANS NEWS README.AltiVec README.avilib \ |
|
|
121 |
README.DV README.glav README.lavpipe README.transist TODO \ |
122 |
HINTS BUGS ChangeLog AUTHORS CHANGES |
119 |
} |
123 |
} |