--- mjpegtools-1.6.2-r3.ebuild.orig 2005-02-09 19:28:26.000000000 +0100 +++ mjpegtools-1.6.2-r3.ebuild 2005-02-09 19:53:43.000000000 +0100 @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/mjpegtools/mjpegtools-1.6.2-r3.ebuild,v 1.14 2005/02/06 17:27:56 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/mjpegtools/mjpegtools-1.6.2-r3.ebuild,v 1.13 2005/01/11 12:16:52 lu_zero Exp $ inherit flag-o-matic gcc eutils @@ -10,8 +10,8 @@ LICENSE="as-is" SLOT="1" -KEYWORDS="x86 ppc amd64 ~sparc ppc64" -IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse" +KEYWORDS="x86 ppc amd64 ~sparc ~ppc64" +IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse pic" DEPEND="media-libs/jpeg >=sys-apps/sed-4 @@ -30,31 +30,50 @@ X? ( virtual/x11 )" src_unpack() { + local autoreconfflags="" autoreconf="" unpack ${A} ; cd ${S} cp -rf ${S}{,.orig} - epatch ${FILESDIR}/${P}-fPIC.patch - epatch ${FILESDIR}/${P}-gcc34.patch + # Patch const altivec tables to const in aggregates epatch ${FILESDIR}/${P}-gcc34-altivec.patch - # remove checks for gtk in configure in - use gtk || epatch ${FILESDIR}/${P}-nogtk.patch + # remove checks for gtk in configure.in - reconf required + if use gtk; then + epatch ${FILESDIR}/${P}-nogtk.patch + autoreconf="yes" + fi if use ppc; then # Fix an error in the detection of the altivec-support - # in the compiler + # in the compiler; alters configure.in - reconf required epatch "${FILESDIR}/altivec-fix-${PV}.patch" sed -i 's:-O3::' configure.in - autoreconf || die + autoreconf="yes" fi - if use amd64; then - aclocal - libtoolize --copy --force - autoreconf || die + if use pic || use amd64; then + # Patch Makefile.am files to make mjpegutils library shared; libtoolize + # required. + epatch ${FILESDIR}/${P}-fPIC.patch + # Patch MMX assembler files to be PIC-compliant, where not already. + epatch ${FILESDIR}/${P}-mmx-fPIC.patch + # Cause autoreconf below to re-libtoolize, and force libtoolize + # to rebuild files that aren't old w.r.t. their respective source. + autoreconfflags="--install --force" + autoreconf="yes" fi + if [[ ${autoreconf} = "yes" ]]; then + # Autoreconf, to make configure.in/Makefile.am etc patches effective + einfo Auto-reconfiguring + autoreconf ${autoreconfflags} || die + fi + + # Patch configure, amongst other things - do after autoreconf + epatch ${FILESDIR}/${P}-gcc34.patch + use X || epatch "${FILESDIR}/no-x11-lib-2.patch" + } src_compile() { @@ -81,7 +100,7 @@ if use x86; then if use mmx || use 3dnow || use sse; then myconf="${myconf} --enable-simd-accel" - strip-flags -fstack-protector + #strip-flags -fstack-protector fi if use mmx; then myconf="${myconf} --with-jpeg-mmx=/usr/include/jpeg-mmx" @@ -90,16 +109,6 @@ econf ${myconf} || die - if has_pie ; then - pie_magic="`test_flag -fno-pic` `test_flag -nopie`" - for i in `find "${S}" -name "Makefile"` ; do - sed -e "s:CC = gcc:CC = gcc ${pie_magic}:g" \ - -e "s:CXX = gcc:CXX = g++ ${pie_magic}:g" \ - -e "s:CXXCPP = gcc -E:CXX = g++ -E ${pie_magic}:g" \ - -i "${i}" || die "sed failed" - done - fi - emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" -j1 || die "compile problem" cd docs local infofile