From 73517ac75958a14ba307612decaae65a0c30699e Mon Sep 17 00:00:00 2001 From: ChaosEngine Date: Mon, 21 Nov 2016 16:25:39 +0100 Subject: media-video/qgifer: Port codebase to >=media-libs/giflib-5.1 Gentoo-bug: 536634 Closes: https://github.com/gentoo/gentoo/pull/2881 --- .../qgifer/files/qgifer-0.2.1-giflib5.patch | 157 +++++++++++++++++++++ media-video/qgifer/qgifer-0.2.1-r5.ebuild | 50 +++++++ 2 files changed, 207 insertions(+) create mode 100644 media-video/qgifer/files/qgifer-0.2.1-giflib5.patch create mode 100644 media-video/qgifer/qgifer-0.2.1-r5.ebuild (limited to 'media-video/qgifer') diff --git a/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch b/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch new file mode 100644 index 000000000000..9ddfdac80641 --- /dev/null +++ b/media-video/qgifer/files/qgifer-0.2.1-giflib5.patch @@ -0,0 +1,157 @@ +Port qgifer to giflib 5 API. +See also: https://bugs.gentoo.org/show_bug.cgi?id=536634 + +--- a/src/gifcreator.cpp ++++ b/src/gifcreator.cpp +@@ -38,7 +38,7 @@ + j--; + } + for(int i=0;i ni ? cmaps.at(ni) : cmaps.at(cmaps.size()-1) ++ 0, 0, w, h, 0, cmaps.size() > ni ? cmaps.at(ni) : cmaps.at(cmaps.size()-1) + ) == GIF_ERROR) { + PrintGifError(); + endProgress(); +@@ -135,7 +135,7 @@ + return false; + } + +- if (EGifCloseFile(GifFile) == GIF_ERROR) { ++ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR) { + PrintGifError(); + endProgress(); + return false; +--- a/src/gifcreator.h ++++ b/src/gifcreator.h +@@ -31,6 +31,12 @@ + typedef vector Frame; + typedef unsigned char Byte; + ++static inline void ++PrintGifError() ++{ ++ fprintf(stderr, "\nGIF-LIB error: %s.\n", GifErrorString(GIF_ERROR)); ++} ++ + class GifCreator + { + +--- a/src/palettewidget.cpp ++++ b/src/palettewidget.cpp +@@ -34,7 +34,7 @@ + + PaletteWidget::~PaletteWidget() + { +- FreeMapObject(palette); ++ GifFreeMapObject(palette); + } + + void PaletteWidget::paintEvent(QPaintEvent*) +@@ -117,7 +117,7 @@ + if(palette && mindiff > 1) + { + qDebug() << "deleting old palette, size: " << size << ", colors: " << palette->ColorCount; +- FreeMapObject(palette); ++ GifFreeMapObject(palette); + qDebug() << "done"; + palette = NULL; + } +@@ -157,7 +157,7 @@ + } + + ColorMapObject* previous = palette; +- palette = MakeMapObject(size, NULL); ++ palette = GifMakeMapObject(size, NULL); + if (!palette) + { + qDebug() << "NULL palette!"; +@@ -165,7 +165,7 @@ + } + + +- if (QuantizeBuffer(fimg.width(), fimg.height(), &size, ++ if (GifQuantizeBuffer(fimg.width(), fimg.height(), &size, + &(r[0]),&(g[0]),&(b[0]), &(output[0]), + palette->Colors) == GIF_ERROR) + { +@@ -178,11 +178,11 @@ + //qDebug() << "difference: " << df; + if(previous && df < mindiff) + { +- FreeMapObject(palette); ++ GifFreeMapObject(palette); + palette = previous; + } + else if(df >= mindiff) +- FreeMapObject(previous); ++ GifFreeMapObject(previous); + + // qDebug() << "palette (" << palette->ColorCount << ") :"; + // for(int i=0;iColorCount, palette->Colors);} ++ ColorMapObject* mapCopy() {return GifMakeMapObject(palette->ColorCount, palette->Colors);} + bool fromImage(const QImage& img, int palette_size, float mindiff = 2); + void setColumnCount(int cc){cols = cc;} + bool toFile(const QString& path); +@@ -38,7 +38,7 @@ + QString toString(); + bool fromString(const QString& str); + int getSize() const {return size;} +- void clear() {if(palette) FreeMapObject(palette); palette = NULL; update();} ++ void clear() {if(palette) GifFreeMapObject(palette); palette = NULL; update();} + private: + int size; + int cols; diff --git a/media-video/qgifer/qgifer-0.2.1-r5.ebuild b/media-video/qgifer/qgifer-0.2.1-r5.ebuild new file mode 100644 index 000000000000..554e2432bfbf --- /dev/null +++ b/media-video/qgifer/qgifer-0.2.1-r5.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit cmake-utils + +DESCRIPTION="A video-based animated GIF creator" +HOMEPAGE="https://sourceforge.net/projects/qgifer/" +SRC_URI="mirror://sourceforge/${PN}/${P}-source.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="debug imagemagick opencv3" + +RDEPEND=" + >=media-libs/giflib-5.1:= + dev-qt/qtcore:4 + dev-qt/qtgui:4 + virtual/ffmpeg:0 + imagemagick? ( media-gfx/imagemagick:0 ) + !opencv3? ( =media-libs/opencv-3.0.0:0=[ffmpeg] )" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${P}-source" + +PATCHES=( + "${FILESDIR}/${P}-desktop.patch" + # Port to giflib 5 API + "${FILESDIR}/${P}-giflib5.patch" +) + +src_prepare(){ + use opencv3 && PATCHES+=( "${FILESDIR}/${P}-opencv3.patch" ) + cmake-utils_src_prepare + + # Fix the doc path + sed -i -e "s|share/doc/qgifer|share/doc/${PF}|" CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + $(usex debug '-DRELEASE_MODE=OFF' '') + ) + cmake-utils_src_configure +} -- cgit v1.2.3-65-gdbad