From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PpXVE-0003bE-PK for garchives@archives.gentoo.org; Wed, 16 Feb 2011 02:52:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 08922E086F; Wed, 16 Feb 2011 02:52:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 76B39E086F for ; Wed, 16 Feb 2011 02:52:20 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BED6F1B4056 for ; Wed, 16 Feb 2011 02:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 334948006A for ; Wed, 16 Feb 2011 02:52:19 +0000 (UTC) From: "Jory Pratt" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jory Pratt" Message-ID: Subject: [gentoo-commits] dev/anarchy:master commit in: app-text/ghostscript-gpl/, media-video/ffmpegthumbnailer/files/, ... X-VCS-Repository: dev/anarchy X-VCS-Files: app-text/ghostscript-gpl/Manifest app-text/ghostscript-gpl/files/ghostscript-gpl-9.00-libpng1.5.patch app-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild media-video/dvdauthor/Manifest media-video/dvdauthor/dvdauthor-0.6.18.ebuild media-video/dvdauthor/files/dvdauthor-0.6.18-libpng-1.5.patch media-video/ffmpegthumbnailer/Manifest media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.0.6.ebuild media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-asneeded.patch media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-flags.patch media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-libpng-1.5.patch media-video/mjpegtools/Manifest media-video/mjpegtools/files/mjpegtools-1.9.0-glibc-2.10.patch media-video/mjpegtools/files/mjpegtools-1.9.0-jpeg-7.patch media-video/mjpegtools/files/mjpegtools-1.9.0-libpng-1.5.patch media-video/mjpegtools/mjpegtools-1.9.0-r1.ebuild X-VCS-Directories: app-text/ghostscript-gpl/ media-video/ffmpegthumbnailer/files/ media-video/mjpegtools/ media-video/dvdauthor/ app-text/ghostscript-gpl/files/ media-video/dvdauthor/files/ media-video/ffmpegthumbnailer/ media-video/mjpegtools/files/ X-VCS-Committer: anarchy X-VCS-Committer-Name: Jory Pratt X-VCS-Revision: f2f2752b24117dd9a678dd01780bcccc4993847d Date: Wed, 16 Feb 2011 02:52:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c338665412770c0e42d69c57b62f8296 commit: f2f2752b24117dd9a678dd01780bcccc4993847d Author: Jory A. Pratt gentoo org> AuthorDate: Wed Feb 16 02:52:24 2011 +0000 Commit: Jory Pratt gentoo org> CommitDate: Wed Feb 16 02:52:24 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/anarchy.git;a=3D= commit;h=3Df2f2752b more libpng-1.5 fixes --- app-text/ghostscript-gpl/Manifest | 5 + .../files/ghostscript-gpl-9.00-libpng1.5.patch | 196 ++++++++ .../ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild | 198 ++++++++ media-video/dvdauthor/Manifest | 3 + media-video/dvdauthor/dvdauthor-0.6.18.ebuild | 36 ++ .../files/dvdauthor-0.6.18-libpng-1.5.patch | 25 + media-video/ffmpegthumbnailer/Manifest | 5 + .../ffmpegthumbnailer-2.0.6.ebuild | 43 ++ .../files/ffmpegthumbnailer-2.0.6-asneeded.patch | 19 + .../files/ffmpegthumbnailer-2.0.6-flags.patch | 25 + .../files/ffmpegthumbnailer-2.0.6-libpng-1.5.patch | 13 + media-video/mjpegtools/Manifest | 5 + .../files/mjpegtools-1.9.0-glibc-2.10.patch | 11 + .../mjpegtools/files/mjpegtools-1.9.0-jpeg-7.patch | 24 + .../files/mjpegtools-1.9.0-libpng-1.5.patch | 525 ++++++++++++++= ++++++ media-video/mjpegtools/mjpegtools-1.9.0-r1.ebuild | 88 ++++ 16 files changed, 1221 insertions(+), 0 deletions(-) diff --git a/app-text/ghostscript-gpl/Manifest b/app-text/ghostscript-gpl= /Manifest new file mode 100644 index 0000000..9228e2b --- /dev/null +++ b/app-text/ghostscript-gpl/Manifest @@ -0,0 +1,5 @@ +AUX ghostscript-gpl-9.00-libpng1.5.patch 6699 RMD160 984a970c768a24c4e7e= ae14bfac8432cb1031129 SHA1 adf2ae55d8d7242f808f852632ed26f7e574858f SHA25= 6 228c65f1ed286122bf8ca96979932989ace83e162f7a894f99474886a41732bc +DIST ghostscript-9.00.tar.xz 17377160 RMD160 4dd9bf15ccc3e23e11fdebc1d23= 155e1b9d8993b SHA1 873fbeedecc472ec804943bc5ded131fa8342251 SHA256 2d3afc= f30873c8bf8619beeeb6d4c3370fc2944fd1bd47423461b6778daa8248 +DIST ghostscript-gpl-9.00-patchset-2.tar.bz2 12996 RMD160 b3ef870d4e690a= 4cd6984066f9846d5ec19879ee SHA1 fe6c48949f29b6a5d6bab7b8b3e588373e195b3f = SHA256 842f073369414981467bd6264a6f2f77ef4ef53864a2ddd2ee8872d966b0ff41 +DIST gsdjvu-1.4.tar.gz 208611 RMD160 ecbb2fded61a29c4f49f852f99d106a0ba0= eb48d SHA1 2650c85481de3aef66a4f7970d14a7dd36a1bc96 SHA256 7b5992f5203d66= 2a7e03ce57d4a1b7a97990b0d3e09eb46ef1b4cb66d8d8c57d +EBUILD ghostscript-gpl-9.00-r1.ebuild 5694 RMD160 3bd27762e6c56dfe1352cc= 0dbfcdb83990bc1649 SHA1 a198013448caeb6166a43ad165cd197828f3142c SHA256 6= b48b5a816e6a06ae34b5a914b6bfe0612a4a4ea3465187bf7118ed4a355051a diff --git a/app-text/ghostscript-gpl/files/ghostscript-gpl-9.00-libpng1.= 5.patch b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.00-libpng1.5.p= atch new file mode 100644 index 0000000..dca4f07 --- /dev/null +++ b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.00-libpng1.5.patch @@ -0,0 +1,196 @@ +$NetBSD: patch-ak,v 1.5 2011/01/15 14:08:10 wiz Exp $ + +Fix build with png-1.5. From John Bowler. + +--- base/gdevpng.c.orig 2008-07-17 02:34:01.000000000 +0000 ++++ base/gdevpng.c +@@ -36,12 +36,14 @@ + #include "gdevpccm.h" + #include "gscdefs.h" +=20 +-#define PNG_INTERNAL + /* + * libpng versions 1.0.3 and later allow disabling access to the stdxxx + * files while retaining support for FILE * I/O. ++ * ++ * This is a misunderstanding - this is a build time option for libpng, ++ * it has no effect on a user of libpng. + */ +-#define PNG_NO_CONSOLE_IO ++/*#define PNG_NO_CONSOLE_IO*/ + /* + * Earlier libpng versions require disabling FILE * I/O altogether. + * This produces a compiler warning about no prototype for png_init_io. +@@ -280,7 +282,7 @@ png_print_page(gx_device_printer * pdev, + goto done; + } + /* set error handling */ +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + /* If we get here, we had a problem reading the file */ + code =3D gs_note_error(gs_error_VMerror); + goto done; +@@ -290,19 +292,12 @@ png_print_page(gx_device_printer * pdev, + png_init_io(png_ptr, file); +=20 + /* set the file information here */ +- info_ptr->width =3D pdev->width; +- info_ptr->height =3D pdev->height; +- /* resolution is in pixels per meter vs. dpi */ +- info_ptr->x_pixels_per_unit =3D +- (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)); +- info_ptr->y_pixels_per_unit =3D +- (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)); +- info_ptr->phys_unit_type =3D PNG_RESOLUTION_METER; +- info_ptr->valid |=3D PNG_INFO_pHYs; + switch (depth) { + case 32: +- info_ptr->bit_depth =3D 8; +- info_ptr->color_type =3D PNG_COLOR_TYPE_RGB_ALPHA; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, PNG_COLOR_TYPE_RGB_ALPHA, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + png_set_invert_alpha(png_ptr); + { gx_device_pngalpha *ppdev =3D (gx_device_pngalpha *)pdev; + png_color_16 background; +@@ -315,57 +310,69 @@ png_print_page(gx_device_printer * pdev, + } + break; + case 48: +- info_ptr->bit_depth =3D 16; +- info_ptr->color_type =3D PNG_COLOR_TYPE_RGB; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 16, PNG_COLOR_TYPE_RGB, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + #if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN)=20 + png_set_swap(png_ptr); + #endif + break; + case 24: +- info_ptr->bit_depth =3D 8; +- info_ptr->color_type =3D PNG_COLOR_TYPE_RGB; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, PNG_COLOR_TYPE_RGB, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 8: +- info_ptr->bit_depth =3D 8; +- if (gx_device_has_color(pdev)) +- info_ptr->color_type =3D PNG_COLOR_TYPE_PALETTE; +- else +- info_ptr->color_type =3D PNG_COLOR_TYPE_GRAY; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, gx_device_has_color(pdev) ? ++ PNG_COLOR_TYPE_PALETTE : PNG_COLOR_TYPE_GRAY, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 4: +- info_ptr->bit_depth =3D 4; +- info_ptr->color_type =3D PNG_COLOR_TYPE_PALETTE; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 4, PNG_COLOR_TYPE_PALETTE, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 1: +- info_ptr->bit_depth =3D 1; +- info_ptr->color_type =3D PNG_COLOR_TYPE_GRAY; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 1, PNG_COLOR_TYPE_GRAY, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + /* invert monocrome pixels */ + png_set_invert_mono(png_ptr); + break; ++ default: ++ png_error(png_ptr, "invalid bit depth"); + } +=20 ++ /* resolution is in pixels per meter vs. dpi */ ++ png_set_pHYs(png_ptr, info_ptr,=20 ++ (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)), ++ (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)), ++ PNG_RESOLUTION_METER); ++ + /* set the palette if there is one */ +- if (info_ptr->color_type =3D=3D PNG_COLOR_TYPE_PALETTE) { ++ if (png_get_color_type(png_ptr, info_ptr) =3D=3D PNG_COLOR_TYPE_PA= LETTE) { + int i; + int num_colors =3D 1 << depth; + gx_color_value rgb[3]; ++ png_color palette[256]; ++ ++ if (num_colors > 256) ++ num_colors =3D 256; +=20 +- info_ptr->palette =3D +- (void *)gs_alloc_bytes(mem, 256 * sizeof(png_color), +- "png palette"); +- if (info_ptr->palette =3D=3D 0) { +- code =3D gs_note_error(gs_error_VMerror); +- goto done; +- } +- info_ptr->num_palette =3D num_colors; +- info_ptr->valid |=3D PNG_INFO_PLTE; + for (i =3D 0; i < num_colors; i++) { + (*dev_proc(pdev, map_color_rgb)) ((gx_device *) pdev, + (gx_color_index) i, rgb); +- info_ptr->palette[i].red =3D gx_color_value_to_byte(rgb[0]); +- info_ptr->palette[i].green =3D gx_color_value_to_byte(rgb[1]); +- info_ptr->palette[i].blue =3D gx_color_value_to_byte(rgb[2]); ++ palette[i].red =3D gx_color_value_to_byte(rgb[0]); ++ palette[i].green =3D gx_color_value_to_byte(rgb[1]); ++ palette[i].blue =3D gx_color_value_to_byte(rgb[2]); + } ++ png_set_PLTE(png_ptr, info_ptr, palette, num_colors); + } + /* add comment */ + strncpy(software_key, "Software", sizeof(software_key)); +@@ -375,15 +382,14 @@ png_print_page(gx_device_printer * pdev, + text_png.key =3D software_key; + text_png.text =3D software_text; + text_png.text_length =3D strlen(software_text); +- info_ptr->text =3D &text_png; +- info_ptr->num_text =3D 1; ++ png_set_text(png_ptr, info_ptr, &text_png, 1); +=20 + /* write the file information */ + png_write_info(png_ptr, info_ptr); +=20 + /* don't write the comments twice */ +- info_ptr->num_text =3D 0; +- info_ptr->text =3D NULL; ++ /*info_ptr->num_text =3D 0;*/ ++ /*info_ptr->text =3D NULL;*/ +=20 + /* Write the contents of the image. */ + for (y =3D 0; y < height; y++) { +@@ -395,7 +401,7 @@ png_print_page(gx_device_printer * pdev, + png_write_end(png_ptr, info_ptr); +=20 + /* if you alloced the palette, free it here */ +- gs_free_object(mem, info_ptr->palette, "png palette"); ++ /*gs_free_object(mem, info_ptr->palette, "png palette");*/ +=20 + done: + /* free the structures */ +@@ -405,6 +411,7 @@ png_print_page(gx_device_printer * pdev, + return code; + } +=20 ++#if 0 /* not required in 1.5 */ + /* + * Patch around a static reference to a never-used procedure. + * This could be avoided if we were willing to edit pngconf.h to +@@ -422,6 +429,7 @@ png_push_fill_buffer(png_structp png_ptr + { + } + #endif ++#endif +=20 + static int + pngalpha_open(gx_device * pdev) diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild b/ap= p-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild new file mode 100644 index 0000000..a2d7dd1 --- /dev/null +++ b/app-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild @@ -0,0 +1,198 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ghostscript-= gpl-9.00-r1.ebuild,v 1.1 2011/02/01 19:02:39 tgurr Exp $ + +EAPI=3D3 +inherit autotools eutils versionator flag-o-matic + +DESCRIPTION=3D"Ghostscript is an interpreter for the PostScript language= and for PDF" +HOMEPAGE=3D"http://ghostscript.com/" + +MY_P=3D${P/-gpl} +GSDJVU_PV=3D1.4 +PVM=3D$(get_version_component_range 1-2) +SRC_URI=3D"!bindist? ( djvu? ( mirror://sourceforge/djvu/gsdjvu-${GSDJVU= _PV}.tar.gz ) ) + mirror://sourceforge/ghostscript/${MY_P}.tar.xz + mirror://gentoo/${P}-patchset-2.tar.bz2" + +LICENSE=3D"GPL-3 CPL-1.0" +SLOT=3D"0" +KEYWORDS=3D"~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~= sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE=3D"bindist cups djvu gtk idn jpeg2k X" + +COMMON_DEPEND=3D"app-text/libpaper + media-libs/freetype:2 + media-libs/fontconfig + virtual/jpeg + >=3Dmedia-libs/libpng-1.2.42 + >=3Dmedia-libs/tiff-3.9.2 + >=3Dsys-libs/zlib-1.2.3 + !bindist? ( djvu? ( app-text/djvu ) ) + cups? ( >=3Dnet-print/cups-1.3.8 ) + gtk? ( >=3Dx11-libs/gtk+-2.0 ) + idn? ( net-dns/libidn ) + jpeg2k? ( media-libs/jasper ) + X? ( x11-libs/libXt x11-libs/libXext )" + +DEPEND=3D"${COMMON_DEPEND} + app-arch/xz-utils + dev-util/pkgconfig" + +RDEPEND=3D"${COMMON_DEPEND} + >=3Dapp-text/poppler-data-0.4.4 + >=3Dmedia-fonts/urw-fonts-2.4.9 + linguas_ja? ( media-fonts/kochi-substitute ) + linguas_ko? ( media-fonts/baekmuk-fonts ) + linguas_zh_CN? ( media-fonts/arphicfonts ) + linguas_zh_TW? ( media-fonts/arphicfonts )" + +S=3D"${WORKDIR}/${MY_P}" + +LANGS=3D"ja ko zh_CN zh_TW" +for X in ${LANGS} ; do + IUSE=3D"${IUSE} linguas_${X}" +done + +pkg_setup() { + if use bindist && use djvu; then + ewarn "You have bindist in your USE, djvu support will NOT be compiled= !" + ewarn "See http://djvu.sourceforge.net/gsdjvu/COPYING for details on l= icensing issues." + fi +} + +src_prepare() { + # remove internal copies of various libraries + rm -rf "${S}/expat" + rm -rf "${S}/jasper" + rm -rf "${S}/jpeg" + rm -rf "${S}/libpng" + rm -rf "${S}/tiff" + rm -rf "${S}/zlib" + # remove internal urw-fonts + rm -rf "${S}/Resource/Font" + # remove internal CMaps (CMaps from poppler-data are used instead) + rm -rf "${S}/Resource/CMap" + + # apply various patches, many borrowed from Fedora + # http://pkgs.fedoraproject.org/gitweb/?p=3Dghostscript.git + EPATCH_SUFFIX=3D"patch" EPATCH_FORCE=3D"yes" + EPATCH_SOURCE=3D"${WORKDIR}/patches/" + epatch + + epatch "${FILESDIR}"/${P}-libpng1.5.patch + + if ! use bindist && use djvu ; then + unpack gsdjvu-${GSDJVU_PV}.tar.gz + cp gsdjvu-${GSDJVU_PV}/gsdjvu "${S}" + cp gsdjvu-${GSDJVU_PV}/gdevdjvu.c "${S}/base" + epatch "${WORKDIR}/patches-gsdjvu/gsdjvu-1.3-${PN}-8.64.patch" + epatch "${WORKDIR}/patches-gsdjvu/gsdjvu-1.4-${PN}-9.00-upstream-build= fixes.patch" + cp gsdjvu-${GSDJVU_PV}/ps2utf8.ps "${S}/lib" + cp "${S}/base/contrib.mak" "${S}/base/contrib.mak.gsdjvu" + grep -q djvusep "${S}/base/contrib.mak" || \ + cat gsdjvu-${GSDJVU_PV}/gsdjvu.mak >> "${S}/base/contrib.mak" + + # install ps2utf8.ps, bug #197818 + sed -i -e '/$(EXTRA_INIT_FILES)/ a\ps2utf8.ps \\' "${S}/base/unixinst.= mak" \ + || die "sed failed" + fi + + if ! use gtk ; then + sed -i "s:\$(GSSOX)::" base/*.mak || die "gsx sed failed" + sed -i "s:.*\$(GSSOX_XENAME)$::" base/*.mak || die "gsxso sed failed" + fi + + # search path fix + sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/${PVM}/$(get_li= bdir):" \ + -e "s:exdir=3D.*:exdir=3D/usr/share/doc/${PF}/examples:" \ + -e "s:docdir=3D.*:docdir=3D/usr/share/doc/${PF}/html:" \ + -e "s:GS_DOCDIR=3D.*:GS_DOCDIR=3D/usr/share/doc/${PF}/html:" \ + base/Makefile.in base/*.mak || die "sed failed" + + cd "${S}" + eautoreconf + + cd "${S}/jbig2dec" + eautoreconf + + cd "${S}/ijs" + eautoreconf +} + +src_configure() { + local FONTPATH + for path in \ + /usr/share/fonts/urw-fonts \ + /usr/share/fonts/Type1 \ + /usr/share/fonts \ + /usr/share/poppler/cMap/Adobe-CNS1 \ + /usr/share/poppler/cMap/Adobe-GB1 \ + /usr/share/poppler/cMap/Adobe-Japan1 \ + /usr/share/poppler/cMap/Adobe-Japan2 \ + /usr/share/poppler/cMap/Adobe-Korea1 + do + FONTPATH=3D"$FONTPATH${FONTPATH:+:}$path" + done + + econf \ + $(use_enable cups) \ + $(use_enable gtk) \ + $(use_with cups pdftoraster) \ + $(use_with idn libidn) \ + $(use_with jpeg2k jasper) \ + $(use_with X x) \ + --disable-compile-inits \ + --enable-dynamic \ + --enable-freetype \ + --enable-fontconfig \ + --with-drivers=3DALL \ + --with-fontpath=3D"$FONTPATH" \ + --with-ijs \ + --with-jbig2dec \ + --with-libpaper \ + --with-system-libtiff + + if ! use bindist && use djvu ; then + sed -i -e 's!$(DD)bbox.dev!& $(DD)djvumask.dev $(DD)djvusep.dev!g' Mak= efile + fi + + cd "${S}/ijs" + econf +} + +src_compile() { + emake -j1 so all || die "emake failed" + + cd "${S}/ijs" + emake || die "ijs emake failed" +} + +src_install() { + emake DESTDIR=3D"${D}" install-so install || die "emake install failed" + + if ! use bindist && use djvu ; then + dobin gsdjvu || die "dobin gsdjvu install failed" + fi + + # remove gsc in favor of gambit, bug #253064 + rm -rf "${D}/usr/bin/gsc" + + rm -rf "${D}/usr/share/doc/${PF}/html/"{README,PUBLIC} + dodoc doc/GS9_Color_Management.pdf || die "dodoc install failed" + + cd "${S}/ijs" + emake DESTDIR=3D"${D}" install || die "emake ijs install failed" + + # rename the original cidfmap to cidfmap.GS + mv "${D}/usr/share/ghostscript/${PVM}/Resource/Init/cidfmap"{,.GS} || d= ie + + # install our own cidfmap to handle CJK fonts + insinto "/usr/share/ghostscript/${PVM}/Resource/Init" + doins "${WORKDIR}/fontmaps/CIDFnmap" || die "doins CIDFnmap failed" + doins "${WORKDIR}/fontmaps/cidfmap" || die "doins cidfmap failed" + for X in ${LANGS} ; do + if use linguas_${X} ; then + doins "${WORKDIR}/fontmaps/cidfmap.${X}" || die "doins cidfmap.${X} f= ailed" + fi + done +} diff --git a/media-video/dvdauthor/Manifest b/media-video/dvdauthor/Manif= est new file mode 100644 index 0000000..335b881 --- /dev/null +++ b/media-video/dvdauthor/Manifest @@ -0,0 +1,3 @@ +AUX dvdauthor-0.6.18-libpng-1.5.patch 631 RMD160 51b0e0e4b36947163153a52= a59907978b1c34812 SHA1 3c01fcd6a6f9667994af8e94822bb19e5eb88341 SHA256 7a= 16d0dd5a37525a345b2e75f122b9ecfb43beed388eb7a8f33f0ab7b8b9e176 +DIST dvdauthor-0.6.18.tar.gz 392809 RMD160 d7571a8371305aefb283f433440b3= be2264e9e34 SHA1 7b6e190a3903f617d08368e3cc5e6fd80677e2fb SHA256 0e21c2d9= c09f7e347c4c9bd7b691455f524ec2e91bcafc18b84d7b7fb3a9cb26 +EBUILD dvdauthor-0.6.18.ebuild 855 RMD160 0fe7354da217a9020bd34308c1a0fc= fda9bb50f1 SHA1 aaf7f2b1104673a0fdd618596dd4fe2ae670ec4f SHA256 136156d87= 4204a94b13d1bc8fc13ba8fe1e16f9061fea6f6f000d3d82b1ef4fc diff --git a/media-video/dvdauthor/dvdauthor-0.6.18.ebuild b/media-video/= dvdauthor/dvdauthor-0.6.18.ebuild new file mode 100644 index 0000000..0dbb672 --- /dev/null +++ b/media-video/dvdauthor/dvdauthor-0.6.18.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/dvdauthor/dvdauthor-0.6.1= 4.ebuild,v 1.3 2008/12/21 14:51:30 nixnut Exp $ + +EAPI=3D"2" + +inherit eutils + +DESCRIPTION=3D"Tools for generating DVD files to be played on standalone= DVD players" +HOMEPAGE=3D"http://dvdauthor.sourceforge.net/" +SRC_URI=3D"mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE=3D"GPL-2" +SLOT=3D"0" +KEYWORDS=3D"amd64 ppc ~ppc64 ~sparc x86" +IUSE=3D"" + +DEPEND=3D"media-libs/libdvdread + >=3Dmedia-gfx/imagemagick-5.5.7.14 + >=3Ddev-libs/libxml2-2.6.0 + media-libs/freetype + dev-libs/fribidi + media-libs/libpng" + +src_unpack() { + unpack ${A} +} + +src_prepare() { + epatch "${FILESDIR}/${P}-libpng-1.5.patch" +} + +src_install() { + make install DESTDIR=3D"${D}" || die "installation failed" + dodoc README TODO ChangeLog +} diff --git a/media-video/dvdauthor/files/dvdauthor-0.6.18-libpng-1.5.patc= h b/media-video/dvdauthor/files/dvdauthor-0.6.18-libpng-1.5.patch new file mode 100644 index 0000000..d234187 --- /dev/null +++ b/media-video/dvdauthor/files/dvdauthor-0.6.18-libpng-1.5.patch @@ -0,0 +1,25 @@ +$NetBSD: patch-ab,v 1.4 2011/01/27 00:00:58 wiz Exp $ + +Fix build with png-1.5. +Accepted upstream in +https://github.com/ldo/dvdauthor/commit/c82aaa4eb1a1c36bf7e2b7ae3c9140d0= bf8000b5 + +--- src/spuunmux.c.orig 2010-03-05 06:37:06.000000000 +0000 ++++ src/spuunmux.c +@@ -38,6 +38,7 @@ + #include +=20 + #include ++#include +=20 + #include "rgb.h" + #include "common.h" +@@ -483,7 +484,7 @@ static int write_png(char *file_name,str + return -1; + } +=20 +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return -1; diff --git a/media-video/ffmpegthumbnailer/Manifest b/media-video/ffmpegt= humbnailer/Manifest new file mode 100644 index 0000000..ff2afd9 --- /dev/null +++ b/media-video/ffmpegthumbnailer/Manifest @@ -0,0 +1,5 @@ +AUX ffmpegthumbnailer-2.0.6-asneeded.patch 763 RMD160 602d8a289b5da40e65= d27f17fbe5781f5f601088 SHA1 e81d9f7b63b71c45a14f5b25c4397f4c37991ff1 SHA2= 56 355341d389b90c31d0a80ba6ff92f6cbbcc3da397878f4b50b05500a8ac9a2e7 +AUX ffmpegthumbnailer-2.0.6-flags.patch 797 RMD160 58371ffbda3b458c20288= 3e31b36697c826470a7 SHA1 4705bca7e0836782875117eff57883016ba09e0a SHA256 = 1f8bfe8a1cafdda386fbe2d19920874a001c64d58e5e1ca86aee7762755c4db4 +AUX ffmpegthumbnailer-2.0.6-libpng-1.5.patch 466 RMD160 c5992ae8ca6822df= d5a5c5862facc7a7ef3e8cf2 SHA1 1c804b3ac26f13c59aae5670a90804225e3c23fc SH= A256 668af27cb56823de1fb6f7de50b279d01cf16c9f20725d024323f0d194a6287b +DIST ffmpegthumbnailer-2.0.6.tar.gz 340052 RMD160 8c635c6d35b699ea9d2ef7= 53fc70aa23827c0a57 SHA1 c565eb31910ea03801045e19230870c7e772b1a6 SHA256 e= 9752c0fd3c9bbe20382b527a11d5d4abf2386d0a18ae77fc0e6b1eeb00b7dcd +EBUILD ffmpegthumbnailer-2.0.6.ebuild 1165 RMD160 c67e18cbbba68cbc5bcb10= 8fb441872af644a260 SHA1 d1b1d9f2d897a6dfa7e34f51965f7b9267185f9f SHA256 c= cf92ef3e5bf4e46722c14e5bd543f6c7890a3de9d9908569f6418536c475b37 diff --git a/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.0.6.ebuild= b/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.0.6.ebuild new file mode 100644 index 0000000..022e695 --- /dev/null +++ b/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.0.6.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpegthumbnailer/ffmpegt= humbnailer-2.0.6.ebuild,v 1.2 2011/01/09 14:05:49 ssuominen Exp $ + +EAPI=3D2 +inherit autotools eutils + +DESCRIPTION=3D"Lightweight video thumbnailer that can be used by file ma= nagers" +HOMEPAGE=3D"http://code.google.com/p/ffmpegthumbnailer/" +SRC_URI=3D"http://${PN}.googlecode.com/files/${P}.tar.gz" + +LICENSE=3D"GPL-2" +SLOT=3D"0" +KEYWORDS=3D"~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-= fbsd" +IUSE=3D"gtk jpeg png" + +COMMON_DEPEND=3D">=3Dmedia-video/ffmpeg-0.5 + png? ( >=3Dmedia-libs/libpng-1.4 ) + jpeg? ( virtual/jpeg )" +RDEPEND=3D"${COMMON_DEPEND} + gtk? ( >=3Ddev-libs/glib-2.14:2 )" +DEPEND=3D"${COMMON_DEPEND} + dev-util/pkgconfig" + +src_prepare() { + epatch "${FILESDIR}"/${P}-{asneeded,flags,libpng-1.5}.patch + eautoreconf +} + +src_configure() { + econf \ + --disable-dependency-tracking \ + --disable-static \ + $(use_enable png) \ + $(use_enable jpeg) \ + $(use_enable gtk gio) +} + +src_install() { + emake DESTDIR=3D"${D}" install || die + dodoc AUTHORS ChangeLog README + find "${D}" -name '*.la' -delete +} diff --git a/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-= asneeded.patch b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.= 0.6-asneeded.patch new file mode 100644 index 0000000..d48c187 --- /dev/null +++ b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-asneede= d.patch @@ -0,0 +1,19 @@ +http://code.google.com/p/ffmpegthumbnailer/issues/detail?id=3D75 + +--- Makefile.am ++++ Makefile.am +@@ -39,12 +39,12 @@ + libffmpegthumbnailer_includedir =3D $(includedir)/libffmpegthum= bnailer + libffmpegthumbnailer_la_CXXFLAGS =3D $(AM_CXXFLAGS) $(FFMPEG_CFL= AGS) $(PNG_CFLAGS) + libffmpegthumbnailer_la_LDFLAGS =3D -version-info 4:6:0 +-libffmpegthumbnailer_la_LIBADD =3D $(DL_LIBS) $(FFMPEG_LIBS) $= (PNG_LIBS) $(JPEG_LIBS) ++libffmpegthumbnailer_la_LIBADD =3D $(FFMPEG_LIBS) $(PNG_LIBS) = $(JPEG_LIBS) +=20 + bin_PROGRAMS =3D ffmpegthumbnailer +=20 + ffmpegthumbnailer_SOURCES =3D main.cpp +-ffmpegthumbnailer_LDADD =3D libffmpegthumbnailer.la ++ffmpegthumbnailer_LDADD =3D $(DL_LIBS) libffmpegthumbnailer.la +=20 + if ENABLE_UNITTEST + check_PROGRAMS =3D testrunner diff --git a/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-= flags.patch b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6= -flags.patch new file mode 100644 index 0000000..2262fae --- /dev/null +++ b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-flags.p= atch @@ -0,0 +1,25 @@ +http://code.google.com/p/ffmpegthumbnailer/issues/detail?id=3D76 + +--- configure.ac ++++ configure.ac +@@ -104,9 +104,9 @@ + fi +=20 + #######################################################################= # +-# Compiler flags ++# Preprocessor flags + #######################################################################= # +-CXXFLAGS=3D-D__STDC_CONSTANT_MACROS ++CPPFLAGS=3D"$CPPFLAGS -D__STDC_CONSTANT_MACROS" +=20 + #######################################################################= # + # Check debug mode +@@ -118,7 +118,7 @@ + AM_CONDITIONAL(DEBUG, test "$enable_debug" =3D "yes") + if test "$DEBUG" =3D "yes"; then + AC_DEFINE(ENABLE_DEBUG, [], "Enable debug mode") +- CXXFLAGS+=3D" -g -O1 -Wall -Werror -Wfatal-errors" ++ CXXFLAGS=3D"$CXXFLAGS -g -O1 -Wall -Werror -Wfatal-errors" + fi +=20 + AC_ARG_ENABLE(unittests, diff --git a/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-= libpng-1.5.patch b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-= 2.0.6-libpng-1.5.patch new file mode 100644 index 0000000..7236f7e --- /dev/null +++ b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.0.6-libpng-= 1.5.patch @@ -0,0 +1,13 @@ +$NetBSD: patch-aa,v 1.1 2011/01/20 20:21:16 gavan Exp $ + +--- libffmpegthumbnailer/pngwriter.cpp.orig 2011-01-06 19:01:50.00000000= 0 +0000 ++++ libffmpegthumbnailer/pngwriter.cpp +@@ -49,7 +49,7 @@ PngWriter::PngWriter(std::vector 0) { + jpeg_read_header (&dinfo, TRUE); + dinfo.raw_data_out =3D TRUE; ++ dinfo.do_fancy_upsampling =3D FALSE; + dinfo.out_color_space =3D JCS_YCbCr; + dinfo.dct_method =3D JDCT_IFAST; + jpeg_start_decompress (&dinfo); diff --git a/media-video/mjpegtools/files/mjpegtools-1.9.0-libpng-1.5.pat= ch b/media-video/mjpegtools/files/mjpegtools-1.9.0-libpng-1.5.patch new file mode 100644 index 0000000..2aacb18 --- /dev/null +++ b/media-video/mjpegtools/files/mjpegtools-1.9.0-libpng-1.5.patch @@ -0,0 +1,525 @@ +$NetBSD: patch-ac,v 1.11 2011/02/10 17:06:27 wiz Exp $ + +Fix build with png-1.5, from John Bowler . +https://sourceforge.net/tracker/?func=3Ddetail&aid=3D3177485&group_id=3D= 5776&atid=3D105776 + +--- lavtools/png2yuv.c.orig 2007-11-08 17:31:50.000000000 +0000 ++++ lavtools/png2yuv.c +@@ -49,12 +49,9 @@ png2yuv +=20 + #include "subsample.h" + #include "colorspace.h" +-//#include "mplexconsts.hh" +=20 + #define DEFAULT_CHROMA_MODE Y4M_CHROMA_420JPEG +=20 +-#define MAXPIXELS (2800*1152) /**< Maximum size of final image */ +- + typedef struct _parameters=20 + { + char *pngformatstr; +@@ -70,14 +67,10 @@ typedef struct _parameters=20 + int ss_mode; /**< subsampling mode (based on ssm_id from subsample.h)= */ +=20 + int new_width; /// new MPEG2 width, in case the original one is uneve= n ++ int new_height; /// new MPEG2 width, in case the original one is unev= en + } parameters_t; +=20 +=20 +-struct _parameters *sh_param;=20 +-png_structp png_ptr; +-png_infop info_ptr, end_info; +-uint8_t *raw0, *raw1, *raw2; /* buffer for RGB first, and then Y/Cb/Cr= planes of decoded PNG */ +- + /* + * The User Interface parts=20 + */ +@@ -152,8 +145,6 @@ static void parse_commandline(int argc,=20 + param->interleave =3D -1; + param->verbose =3D 1; + param->ss_mode =3D DEFAULT_CHROMA_MODE; +- //param->mza_filename =3D NULL; +- //param->make_z_alpha =3D 0; +=20 + /* parse options */ + for (;;) { +@@ -240,93 +231,43 @@ static void parse_commandline(int argc,=20 + } + } +=20 +-void png_separation(png_structp png_ptr, png_row_infop row_info, png_by= tep data) +-{ +- int row_nr =3D png_ptr->row_number; // internal variable ?=20 +- int i, width =3D row_info->width;=20 +- int new_width =3D sh_param->new_width; +- +- /* contents of row_info: +- * png_uint_32 width width of row +- * png_uint_32 rowbytes number of bytes in row +- * png_byte color_type color type of pixels +- * png_byte bit_depth bit depth of samples +- * png_byte channels number of channels (1-4) +- * png_byte pixel_depth bits per pixel (depth*channels) +- */ +- +- //mjpeg_debug("PNG YUV transformation callback; color_type is %d row_= number %d\n",=20 +- // row_info->color_type, row_nr); +- +- if(row_info->color_type =3D=3D PNG_COLOR_TYPE_GRAY) // only Z availab= le +- { +- //mjpeg_debug("Grayscale to YUV, row %d", row_nr); +- for (i =3D 0; i < width; i++) +- { +- raw0[i + row_nr * new_width] =3D data[i]; +- raw1[i + row_nr * new_width] =3D data[i]; +- raw2[i + row_nr * new_width] =3D data[i]; +- } +- return; +- } +- +- if(row_info->color_type =3D=3D PNG_COLOR_TYPE_RGB) // Z and Alpha ava= ilable +- { +- //mjpeg_info("RGB to YUV, row %d", row_nr); +- for (i =3D 0; i < width; i++) +- { +- raw0[i + row_nr * new_width] =3D data[i*3]; +- raw1[i + row_nr * new_width] =3D data[i*3 + 1]; +- raw2[i + row_nr * new_width] =3D data[i*3 + 2]; +- } +- return; +- } +- +- mjpeg_error_exit1("mpegz: UNKNOWN COLOR FORMAT %d in PNG transformati= on !\n", row_info->color_type); +-} +- +=20 + /* + * The file handling parts=20 + */ + /**=20 + Reads one PNG file.=20 +-@param process Process the image data (0 for initial parameter determin= ation) ++@param process Process the image data (NULL for initial parameter deter= mination) + @returns -1 on failure, 1 on sucess ++@on success returns RGB data in the second, yuv, parameter + */ +-int decode_png(const char *pngname, int process, parameters_t *param) ++int decode_png(const char *pngname, uint8_t *yuv[], parameters_t *param= ) + { +- int num_pass =3D 1; +- int bit_depth, color_type; ++ png_structp png_ptr; ++ png_infop info_ptr; + FILE *pngfile; +- //png_byte hdptr[8]; +- +- /* Now open this PNG file, and examine its header to retrieve the=20 +- YUV4MPEG info that shall be written */ +- pngfile =3D fopen(pngname, "rb"); +- if (!pngfile) +- { +- perror("PNG file open failed:"); +- return -1; +- } +=20 +- //fread(hdptr, 1, 8, pngfile); ++ /* libpng needs two structs - a png_struct and a png_info, there is n= o ++ * need to make the third, another png_info, because that is only use= d ++ * to store data (such as textual information) that can come after th= e ++ * PNG image. This code only cares about the image. ++ */ ++ info_ptr =3D NULL; ++ pngfile =3D NULL; ++ png_ptr =3D png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL,= NULL); ++ if (!png_ptr) ++ mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngna= me); +=20 +-#if 0=20 +- bool is_png =3D !png_sig_cmp(hdptr, 0, 8); +- if (!is_png) ++ /* This needs to be done immediately after creation of the png_struct ++ * because storage allocation failures will longjmp back to here: ++ */ ++ if (setjmp(png_jmpbuf(png_ptr))) + { +- mjpeg_error("%s is _no_ PNG file !\n"); ++ png_destroy_read_struct(&png_ptr, &info_ptr, 0); ++ if (pngfile) (void)fclose(pngfile); ++ mjpeg_error("%s: Corrupted PNG file !", pngname); + return -1; + } +-#endif +- =20 +- png_ptr =3D png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL,= NULL); +- if (!png_ptr) +- mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngna= me); +- =20 +- png_init_io(png_ptr, pngfile); +- //png_set_sig_bytes(png_ptr, 8); + =20 + info_ptr =3D png_create_info_struct(png_ptr); + if (!info_ptr) +@@ -336,79 +277,101 @@ int decode_png(const char *pngname, int=20 + mjpeg_error_exit1("%s: Could not allocate PNG info struct !", png= name); + } + =20 +- end_info =3D png_create_info_struct(png_ptr); +- if (!end_info) ++ /* Now open this PNG file, and examine its header to retrieve the=20 ++ YUV4MPEG info that shall be written */ ++ pngfile =3D fopen(pngname, "rb"); ++ if (!pngfile) + { +- png_destroy_read_struct(&png_ptr, &info_ptr, +- (png_infopp)NULL); +- mjpeg_error_exit1("%s: Could not allocate PNG end info struct !",= pngname); ++ perror(pngname); ++ png_error(png_ptr, "PNG file open failed"); + } +- =20 +- if (setjmp(png_jmpbuf(png_ptr))) ++ ++ png_init_io(png_ptr, pngfile); ++ ++ if (yuv) + { +- png_destroy_read_struct(&png_ptr, &info_ptr, +- &end_info); +- mjpeg_error("%s: Corrupted PNG file !", pngname); +- return -1; ++ png_uint_32 nr, input_height, input_width, output_height, output_= width; ++ uint8_t *r, *g, *b; ++ png_bytepp rows; ++ ++ /* The code uses png_read_png to obtain a complete buffered copy = of the ++ * PNG file reduced (or expanded) to 8 bit RGB. This is a little= wasteful ++ * in the case of a non-interlaced image - the code could work ro= w by ++ * row without buffering the whole image - but the interlaced cas= e is ++ * almost impossible to handle this way so it is better to be sim= ple and ++ * correct. ++ */ ++# if PNG_LIBPNG_VER >=3D 10500 && PNG_LIBPNG_VER < 10502 ++ /* There is a bug in 1.5 before 1.5.2 which causes png_read_png to ++ * whine most terribly on interlaced images, this stops it: ++ */ ++ (void)png_set_interlace_handling(png_ptr); ++# endif ++ png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | ++ PNG_TRANSFORM_STRIP_ALPHA | PNG_TRANSFORM_EXPAND | ++ PNG_TRANSFORM_GRAY_TO_RGB /* requires libpng 1.4 or later */, 0); ++ ++ /* And return the separated data to the parameters. */ ++ rows =3D png_get_rows(png_ptr, info_ptr); ++ ++ /* Since the PNG files for the frames are separate the actual PNG= file=20 ++ * that was read could be unrelated - a random width and height. = Because ++ * the output may be interleaved the output height may be twice t= he input ++ * PNG height. Because the MPEG code requires an even width the = output ++ * width may be one more than the original frame width. ++ * ++ * For the interleaving the PNG data is smashed into the lower ha= lf of ++ * the yuv rows. For the other cases the input data is cropped o= r ++ * top-lefted as appropriate. ++ */ ++ output_height =3D param->new_height; ++ ++ input_height =3D png_get_image_height(png_ptr, info_ptr); ++ if (input_height > output_height) ++ input_height =3D output_height; ++ ++ output_width =3D param->new_width; ++ ++ input_width =3D png_get_image_width(png_ptr, info_ptr); ++ if (input_width > output_width) ++ input_width =3D output_width; ++ ++ /* Breaking up the RGB data is not hard to do, the separated chan= nels are ++ * simply packed into the three raw yuv arrays with new_width val= ues per ++ * row. ++ */ ++ r =3D yuv[0]; ++ g =3D yuv[1]; ++ b =3D yuv[2]; ++ for (nr=3D0; nrwidth, ¶m->height, &b= it_depth, +- // &color_type, &interlace_type, &compression_type, &filter_= type)) +- &color_type, NULL, NULL, NULL))=09 +- num_pass =3D png_set_interlace_handling(png_ptr); + else +- mjpeg_error_exit1("PNG header reading failed !!\n"); +-#if 0=20 +- mjpeg_info("Reading info struct...\n"); +- png_read_info(png_ptr, info_ptr); +- mjpeg_info("Done...\n"); +- =20 +- if (png_get_IHDR(png_ptr, info_ptr, ¶m->width, ¶m->height, &b= it_depth, +- // &color_type, &interlace_type, &compression_type, &filter_= type)) +- &color_type, NULL, NULL, NULL))=09 +- num_pass =3D png_set_interlace_handling(png_ptr); +- else +- mjpeg_error_exit1("PNG header reading failed !!\n"); +- =20 +- if (process) + { +- printf("%d passes needed\n\n", num_pass); +- =20 +- if (bit_depth !=3D 8 && bit_depth !=3D 16) +- { +- mjpeg_error_exit1("Invalid bit_depth %d, only 8 and 16 bit allowed != !\n", bit_depth); +- } +- =20 +- png_set_strip_16(png_ptr); // always has to strip the 16bit input= , MPEG can't handle it =20 +- png_set_strip_alpha(png_ptr); // Alpha can't be processed until Z= /Alpha is integrated +- =20 +- printf("\nAllocating row buffer..."); +- png_set_read_user_transform_fn(png_ptr, png_separation); +- png_bytep row_buf =3D (png_bytep)png_malloc(png_ptr, +- png_get_rowbytes(png_ptr, info_ptr)); +- =20 +- for (int n=3D0; n < num_pass; n++) +- for (int y=3D0; y < sh_param->height; y++) +- { +- printf("Writing row data for pass %d\n", n); +- png_read_rows(png_ptr, (png_bytepp)&row_buf, NULL, 1); +- } +- =20 +- png_free(png_ptr, row_buf); =20 +- } +- png_read_end(png_ptr, info_ptr); +-#endif =20 +- if (setjmp(png_ptr->jmpbuf)) { +- png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); +- return 2; ++ /* Just return the image width and height in *param */ ++ png_read_info(png_ptr, info_ptr); ++ ++ param->width =3D png_get_image_width(png_ptr, info_ptr); ++ param->height =3D png_get_image_height(png_ptr, info_ptr); + } +=20 ++ /* Successful exit: */ ++ png_destroy_read_struct(&png_ptr, &info_ptr, 0); + fclose(pngfile); +- + return 1; + } +=20 +@@ -419,13 +382,17 @@ int decode_png(const char *pngname, int=20 + */ + static int init_parse_files(parameters_t *param) + {=20 +- char pngname[255]; ++ char pngname[PATH_MAX+1]; /* See POSIX 1003.1 section 2.9.5 */ +=20 + snprintf(pngname, sizeof(pngname),=20 + param->pngformatstr, param->begin); + mjpeg_debug("Analyzing %s to get the right pic params", pngname); + =20 +- if (decode_png(pngname, 0, param) =3D=3D -1) ++ /* The first frame (the param->begin frame) determines the height and ++ * width of the output. Passing NULL instead of yuv (see below) caus= es ++ * decode_png to fill in param with the image dimensions. ++ */ ++ if (decode_png(pngname, NULL, param) =3D=3D -1) + mjpeg_error_exit1("Reading of %s failed.\n", pngname); +=20 + mjpeg_info("Image dimensions are %ux%u", +@@ -455,6 +422,7 @@ static int init_parse_files(parameters_t +=20 + if (!(param->interleave) && (param->interlace !=3D Y4M_ILACE_NONE))=20 + { ++ /* So the height in 'param' might be twice the PNG input height:*= / + param->height *=3D 2; + mjpeg_info("Non-interleaved fields (image height doubled)"); + } +@@ -466,33 +434,29 @@ static int init_parse_files(parameters_t + static int generate_YUV4MPEG(parameters_t *param) + { + uint32_t frame; +- //size_t pngsize; +- char pngname[FILENAME_MAX]; +- uint8_t *yuv[3]; /* buffer for Y/U/V planes of decoded PNG */ ++ uint8_t *yuv[3]; /* Buffers, initially for R,G,B then Y,Cb,Cr */ + y4m_stream_info_t streaminfo; + y4m_frame_info_t frameinfo; +=20 +- if ((param->width % 2) =3D=3D 0) +- param->new_width =3D param->width; +- else +- { +- param->new_width =3D ((param->width >> 1) + 1) << 1; +- printf("Setting new, even image width %d", param->new_width); +- } ++ /* Make the output even, so the output may be one larger than the ++ * original PNG image width. ++ */ ++ param->new_width =3D param->width + (param->width & 1); ++ param->new_height =3D param->height + (param->height & 1); +=20 + mjpeg_info("Now generating YUV4MPEG stream."); + y4m_init_stream_info(&streaminfo); + y4m_init_frame_info(&frameinfo); +=20 + y4m_si_set_width(&streaminfo, param->new_width); +- y4m_si_set_height(&streaminfo, param->height); ++ y4m_si_set_height(&streaminfo, param->new_height); + y4m_si_set_interlace(&streaminfo, param->interlace); + y4m_si_set_framerate(&streaminfo, param->framerate); + y4m_si_set_chroma(&streaminfo, param->ss_mode); +=20 +- yuv[0] =3D (uint8_t *)malloc(param->new_width * param->height * sizeo= f(yuv[0][0])); +- yuv[1] =3D (uint8_t *)malloc(param->new_width * param->height * sizeo= f(yuv[1][0])); +- yuv[2] =3D (uint8_t *)malloc(param->new_width * param->height * sizeo= f(yuv[2][0])); ++ yuv[0] =3D (uint8_t *)malloc(param->new_width * param->new_height * s= izeof(yuv[0][0])); ++ yuv[1] =3D (uint8_t *)malloc(param->new_width * param->new_height * s= izeof(yuv[1][0])); ++ yuv[2] =3D (uint8_t *)malloc(param->new_width * param->new_height * s= izeof(yuv[2][0])); +=20 + y4m_write_stream_header(STDOUT_FILENO, &streaminfo); +=20 +@@ -500,15 +464,13 @@ static int generate_YUV4MPEG(parameters_ + (frame < param->numframes + param->begin) || (param->numframes =3D= =3D -1); + frame++)=20 + { +- // if (frame < 25) +- // else =20 +- //snprintf(pngname, sizeof(pngname), param->pngformatstr, frame -= 25); ++ char pngname[PATH_MAX+1]; + snprintf(pngname, sizeof(pngname), param->pngformatstr, frame); + =20 +- raw0 =3D yuv[0]; +- raw1 =3D yuv[1]; +- raw2 =3D yuv[2]; +- if (decode_png(pngname, 1, param) =3D=3D -1) ++ /* decode_png reads the PNG into the yuv buffers as r,g,b [0..255= ] ++ * values. ++ */ ++ if (decode_png(pngname, yuv, param) =3D=3D -1) + { + mjpeg_info("Read from '%s' failed: %s", pngname, strerror(errno)); + if (param->numframes =3D=3D -1)=20 +@@ -523,79 +485,18 @@ static int generate_YUV4MPEG(parameters_ + }=20 + else=20 + { +-#if 0=20 +- mjpeg_debug("Preparing frame"); +- =20 +- /* Now open this PNG file, and examine its header to retrieve the=20 +- YUV4MPEG info that shall be written */ +- +- if ((param->interlace =3D=3D Y4M_ILACE_NONE) || (param->interleave =3D= =3D 1))=20 +- { +- mjpeg_info("Processing non-interlaced/interleaved %s.",=20 +- pngname, pngsize); +- +- decode_png(imagedata, 0, 420, yuv[0], yuv[1], yuv[2],=20 +- param->width, param->height, param->new_width); +- =20 +-#if 0=20 +- if (param->make_z_alpha) +- { +- mjpeg_info("Writing Z/Alpha data.\n"); +- za_write(real_z_imagemap, param->width, param->height,z_alpha_fp,fr= ame); +- } +-#endif +- }=20 +- else=20 +- { +- mjpeg_error_exit1("Can't handle interlaced PNG information (yet)= since there is no standard for it.\n" +- "Use interleaved mode (-L option) to create interlaced material."); +- +- switch (param->interlace)=20 +- { =20 +- case Y4M_ILACE_TOP_FIRST: +- mjpeg_info("Processing interlaced, top-first %s", pngname); +-#if 0=20 +- decode_jpeg_raw(jpegdata, jpegsize, +- Y4M_ILACE_TOP_FIRST, +- 420, param->width, param->height, +- yuv[0], yuv[1], yuv[2]); +-#endif +- break; +- case Y4M_ILACE_BOTTOM_FIRST: +- mjpeg_info("Processing interlaced, bottom-first %s", pngname); +-#if 0=20 +- decode_jpeg_raw(jpegdata, jpegsize, +- Y4M_ILACE_BOTTOM_FIRST, +- 420, param->width, param->height, +- yuv[0], yuv[1], yuv[2]); +-#endif +- break; +- default: +- mjpeg_error_exit1("FATAL logic error?!?"); +- break; +- } +- } +-#endif + mjpeg_debug("Converting frame to YUV format."); + /* Transform colorspace, then subsample (in place) */ +- convert_RGB_to_YCbCr(yuv, param->height * param->new_width); +- chroma_subsample(param->ss_mode, yuv, param->new_width, param->heigh= t); ++ convert_RGB_to_YCbCr(yuv, param->new_height * param->new_width); ++ chroma_subsample(param->ss_mode, yuv, param->new_width, param->new_h= eight); +=20 + mjpeg_debug("Frame decoded, now writing to output stream."); + } +- =20 ++ + mjpeg_debug("Frame decoded, now writing to output stream."); + y4m_write_frame(STDOUT_FILENO, &streaminfo, &frameinfo, yuv); + } +=20 +-#if 0=20 +- if (param->make_z_alpha) +- { +- za_write_end(z_alpha_fp); +- fclose(z_alpha_fp); +- } +-#endif +- + y4m_fini_stream_info(&streaminfo); + y4m_fini_frame_info(&frameinfo); + free(yuv[0]); +@@ -614,7 +515,6 @@ static int generate_YUV4MPEG(parameters_ + int main(int argc, char ** argv) + {=20 + parameters_t param; +- sh_param =3D ¶m; +=20 + y4m_accept_extensions(1); +=20 +@@ -632,13 +532,3 @@ int main(int argc, char ** argv) +=20 + return 0; + } +- +- +- +- +- +- +- +- +- +- diff --git a/media-video/mjpegtools/mjpegtools-1.9.0-r1.ebuild b/media-vi= deo/mjpegtools/mjpegtools-1.9.0-r1.ebuild new file mode 100644 index 0000000..f566364 --- /dev/null +++ b/media-video/mjpegtools/mjpegtools-1.9.0-r1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/mjpegtools/mjpegtools-1.9= .0-r1.ebuild,v 1.7 2010/11/07 19:15:03 anarchy Exp $ + +EAPI=3D"1" + +inherit flag-o-matic toolchain-funcs eutils libtool + +MY_P=3D${P/_/} + +DESCRIPTION=3D"Tools for MJPEG video" +HOMEPAGE=3D"http://mjpeg.sourceforge.net/" +SRC_URI=3D"mirror://sourceforge/mjpeg/${MY_P}.tar.gz" + +LICENSE=3D"as-is" +SLOT=3D"1" +KEYWORDS=3D"alpha amd64 ppc ppc64 sparc x86" +IUSE=3D"gtk dv quicktime sdl X yv12 v4l dga png mmx" + +RDEPEND=3D"virtual/jpeg + gtk? ( x11-libs/gtk+:2 ) + dv? ( >=3Dmedia-libs/libdv-0.99 ) + quicktime? ( virtual/quicktime ) + png? ( media-libs/libpng ) + sdl? ( >=3Dmedia-libs/libsdl-1.2.7-r3 ) + X? ( x11-libs/libX11 + x11-libs/libXt )" + +DEPEND=3D"${RDEPEND} + mmx? ( dev-lang/nasm ) + >=3Dsys-apps/sed-4 + dev-util/pkgconfig" + +S=3D"${WORKDIR}/${MY_P}" + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i -e '/ARCHFLAGS=3D/s:=3D.*:=3D:' configure + epatch "${FILESDIR}"/${P}-glibc-2.10.patch \ + "${FILESDIR}"/${P}-jpeg-7.patch \ + "${FILESDIR}"/${P}-libpng-1.5.patch +} + +src_compile() { + local myconf + + if use yv12 && use dv; then + myconf=3D"${myconf} --with-dv-yv12" + elif use yv12; then + ewarn "yv12 support is possible when 'dv' is in your USE flags." + fi + + [[ $(gcc-major-version) -eq 3 ]] && append-flags -mno-sse2 + + append-flags -fno-strict-aliasing + + econf \ + $(use_with X x) \ + $(use_enable dga xfree-ext) \ + $(use_with quicktime libquicktime) \ + $(use_with png libpng) \ + $(use_with v4l) \ + $(use_with gtk) \ + $(use_with sdl) \ + $(use_with dv libdv /usr) \ + $(use_enable mmx simd-accel) \ + --enable-largefile \ + --without-jpeg-mmx \ + ${myconf} || die "configure failed" + + emake || die "emake failed" + + cd docs + local infofile + for infofile in mjpeg*info*; do + echo "INFO-DIR-SECTION Miscellaneous" >> ${infofile} + echo "START-INFO-DIR-ENTRY" >> ${infofile} + echo "* mjpeg-howto: (mjpeg-howto). How to use the mjpeg-tools" >= > ${infofile} + echo "END-INFO-DIR-ENTRY" >> ${infofile} + done +} + +src_install() { + einstall || die "install failed" + dodoc mjpeg_howto.txt README* PLANS NEWS TODO HINTS BUGS ChangeLog \ + AUTHORS CHANGES +}