commit:     cbe4c6c3a354718374b20e0017069c62e523457e
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 16 15:42:15 2017 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun Apr 16 15:42:46 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbe4c6c3

media-gfx/gnome-raw-thumbnailer: fix build with >=libopenraw-0.1, bug #609970

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 ...raw-thumbnailer-3.0.0-deprecation-warning.patch | 63 ++++++++++++++++++++++
 ...gnome-raw-thumbnailer-3.0.0-fix-downscale.patch | 35 ++++++++++++
 ...nome-raw-thumbnailer-3.0.0-libopenraw-0.1.patch | 25 +++++++++
 .../gnome-raw-thumbnailer-3.0.0-r1.ebuild          | 42 +++++++++++++++
 4 files changed, 165 insertions(+)

diff --git 
a/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-deprecation-warning.patch
 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-deprecation-warning.patch
new file mode 100644
index 00000000000..8fddadb435a
--- /dev/null
+++ 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-deprecation-warning.patch
@@ -0,0 +1,63 @@
+From e769ad77617a3456f0f4aee9418ef6bdbab40403 Mon Sep 17 00:00:00 2001
+From: Anton Keks <an...@codeborne.com>
+Date: Thu, 2 Jan 2014 23:14:55 +0200
+Subject: [PATCH 1/8] fix deprecation warnings
+
+---
+ src/raw-thumbnailer.c | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/src/raw-thumbnailer.c b/src/raw-thumbnailer.c
+index d638102..b32bc49 100644
+--- a/src/raw-thumbnailer.c
++++ b/src/raw-thumbnailer.c
+@@ -64,7 +64,7 @@ save_pixbuf (GdkPixbuf *pixbuf, const char *path, int size)
+   }
+   else {
+     small = pixbuf;
+-    gdk_pixbuf_ref (small);
++    g_object_ref (small);
+   }
+   
+   a_width = g_strdup_printf ("%d", width);
+@@ -88,14 +88,11 @@ save_pixbuf (GdkPixbuf *pixbuf, const char *path, int size)
+   g_free(a_height);
+   
+   if (small) {
+-    gdk_pixbuf_unref (small);
++    g_object_unref (small);
+   }
+   return;
+ }
+ 
+-
+-
+-
+ static const GOptionEntry entries[] = {
+   { "jpeg", 'j',  0, G_OPTION_ARG_NONE, &jpeg_output, "Output the thumbnail 
as a JPEG instead of PNG", NULL },
+   { "size", 's', 0, G_OPTION_ARG_INT, &output_size, "Size of the thumbnail in 
pixels", NULL },
+@@ -107,8 +104,6 @@ static const GOptionEntry entries[] = {
+   { NULL }
+ };
+ 
+-
+-
+ int main (int argc, char ** argv)
+ {
+   const char *output_name;
+@@ -121,7 +116,6 @@ int main (int argc, char ** argv)
+   
+   context = g_option_context_new ("Thumbnail camera RAW files.");
+   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+-  g_type_init ();
+   
+   if (g_option_context_parse (context, &argc, &argv, &err) == FALSE) {
+     g_print ("couldn't parse command-line options: %s\n", err->message);
+@@ -161,4 +155,3 @@ int main (int argc, char ** argv)
+   return 0;
+ }
+ 
+-
+-- 
+2.12.2
+

diff --git 
a/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-fix-downscale.patch
 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-fix-downscale.patch
new file mode 100644
index 00000000000..def91cb3fb3
--- /dev/null
+++ 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-fix-downscale.patch
@@ -0,0 +1,35 @@
+From 5a03b1a9ffece1d38cc0cf91c599975b9f2b028e Mon Sep 17 00:00:00 2001
+From: Anton Keks <an...@codeborne.com>
+Date: Thu, 2 Jan 2014 23:44:03 +0200
+Subject: [PATCH 1/7] downscale thumbnail if requested size is smaller than it
+ is, do not hardcode 128
+
+---
+ src/raw-thumbnailer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/raw-thumbnailer.c b/src/raw-thumbnailer.c
+index b32bc49..135dbe3 100644
+--- a/src/raw-thumbnailer.c
++++ b/src/raw-thumbnailer.c
+@@ -47,7 +47,7 @@ save_pixbuf (GdkPixbuf *pixbuf, const char *path, int size)
+   height = gdk_pixbuf_get_height (pixbuf);
+   width = gdk_pixbuf_get_width (pixbuf);
+   
+-  if (size <= 128) {
++  if (size < height || size < width) {
+     int d_width, d_height;
+     
+     if (width > height) {
+@@ -143,7 +143,7 @@ int main (int argc, char ** argv)
+   
+   char* inputfname = g_filename_from_uri (uri, NULL, NULL);
+   g_free(uri);
+-  
++
+   pixbuf = or_gdkpixbuf_extract_rotated_thumbnail(inputfname, output_size);
+   g_free(inputfname);
+   
+-- 
+2.12.2
+

diff --git 
a/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-libopenraw-0.1.patch
 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-libopenraw-0.1.patch
new file mode 100644
index 00000000000..50e5433809a
--- /dev/null
+++ 
b/media-gfx/gnome-raw-thumbnailer/files/gnome-raw-thumbnailer-3.0.0-libopenraw-0.1.patch
@@ -0,0 +1,25 @@
+From 5cc4ad36b9f25f6973ae48166595d201f215a012 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <e...@gentoo.org>
+Date: Sun, 16 Apr 2017 16:50:00 +0200
+Subject: [PATCH] Update pkgconfig name of libopenraw
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0f637b5..26dbf5a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -22,7 +22,7 @@ PKG_CHECK_MODULES(GNOME, gdk-pixbuf-2.0 gio-2.0 glib-2.0)
+ AC_SUBST(GNOME_CFLAGS)
+ AC_SUBST(GNOME_LIBS)
+ 
+-PKG_CHECK_MODULES(OPENRAW, libopenraw-gnome-1.0 >= 0.0.9)
++PKG_CHECK_MODULES(OPENRAW, libopenraw-gnome-0.1 >= 0.1.0)
+ AC_SUBST(OPENRAW_CFLAGS)
+ AC_SUBST(OPENRAW_LIBS)
+ 
+-- 
+2.12.2
+

diff --git 
a/media-gfx/gnome-raw-thumbnailer/gnome-raw-thumbnailer-3.0.0-r1.ebuild 
b/media-gfx/gnome-raw-thumbnailer/gnome-raw-thumbnailer-3.0.0-r1.ebuild
new file mode 100644
index 00000000000..710d2a6cde4
--- /dev/null
+++ b/media-gfx/gnome-raw-thumbnailer/gnome-raw-thumbnailer-3.0.0-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools gnome2
+
+MY_P="${PN/gnome-}-${PV}"
+
+DESCRIPTION="A lightweight and fast raw image thumbnailer for GNOME"
+HOMEPAGE="https://libopenraw.freedesktop.org/wiki/RawThumbnailer";
+SRC_URI="https://libopenraw.freedesktop.org/download/${MY_P}.tar.bz2";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+       >=media-libs/libopenraw-0.1.0[gtk]
+       >=x11-libs/gdk-pixbuf-2:2
+       >=dev-libs/glib-2.26:2
+       !media-gfx/raw-thumbnailer
+"
+DEPEND="${RDEPEND}
+       dev-util/intltool
+       gnome-base/gnome-common
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-deprecation-warning.patch
+       "${FILESDIR}"/${P}-fix-downscale.patch
+       "${FILESDIR}"/${P}-libopenraw-0.1.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}

Reply via email to