X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 24347DC00EB for ; Mon, 1 Dec 2014 06:02:02 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id r20so25545575wiv.2 for ; Sun, 30 Nov 2014 22:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=ErFAnlmFDcEC9gvvUDVgiaXZTZxEb6Di7M/hVUOuARs=; b=udB47e+HszjBkP8WduLXIXjBYc/R9vabRKIKDyMSFbmD/9PJS08K1U1XCkHJARtnHC x/oj5PnIDjeWHD3jp5eQk1vbF8pWw7Ghn6C2k3INEn5fUfyKipn/2DUOLnQHKgDjbNak N2F2VPkCafogT6mXsQb2+g5zF6q7mlqoqHg/WBt0SczXswkNgWg0GuVl180hlFJv74pE c2LLexEsu8t6CxrB0NXImA+kamDfhPDK+mPoii0gi2AB6Onw4H4MXrFxk5DwhZRgT0yo kGYDE1RNhWLd/SmlwCfDgDbZR/5s6fV9qQCxrWK9a8QTR//g3CoiJxAQcRJ597bRfUG9 5byw== X-Received: by 10.194.185.167 with SMTP id fd7mr91936879wjc.108.1417413721448; Sun, 30 Nov 2014 22:02:01 -0800 (PST) Received: from alpine.my.domain (84.127.141.73.dyn.user.ono.com. [84.127.141.73]) by mx.google.com with ESMTPSA id hs1sm40635231wib.1.2014.11.30.22.02.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Nov 2014 22:02:00 -0800 (PST) From: Amatcoder To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH] testing/epdfview: new aport Date: Mon, 1 Dec 2014 05:57:36 +0000 Message-Id: <1417413456-31634-1-git-send-email-amatcoder@gmail.com> X-Mailer: git-send-email 2.2.0 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/epdfview/APKBUILD | 55 ++++++++++ testing/epdfview/epdfview-0.1.8-fixes-1.patch | 146 ++++++++++++++++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 testing/epdfview/APKBUILD create mode 100644 testing/epdfview/epdfview-0.1.8-fixes-1.patch diff --git a/testing/epdfview/APKBUILD b/testing/epdfview/APKBUILD new file mode 100644 index 0000000..9b529c1 --- /dev/null +++ b/testing/epdfview/APKBUILD @@ -0,0 +1,55 @@ +# Contributor: August Klein +# Maintainer: August Klein +pkgname=epdfview +pkgver=0.1.8 +pkgrel=0 +pkgdesc="A lightweight PDF document viewer" +url="http://freecode.com/projects/epdfview" +arch="all" +license="GPL2" +depends="" +depends_dev="gtk+2.0-dev poppler-dev" +makedepends="$depends_dev" +install="" +subpackages="$pkgname-lang $pkgname-doc" +source="http://anduin.linuxfromscratch.org/sources/BLFS/conglomeration/$pkgname/$pkgname-$pkgver.tar.bz2 + epdfview-0.1.8-fixes-1.patch" + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + local i + cd "$_builddir" + update_config_sub || return 1 + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --mandir=/usr/share/man \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + + mkdir "${pkgdir}/usr/share/pixmaps/" + cp -p -f "${pkgdir}/usr/share/epdfview/pixmaps/icon_epdfview-48.png" \ + "${pkgdir}/usr/share/pixmaps/icon_epdfview-48.png" +} + +md5sums="e50285b01612169b2594fea375f53ae4 epdfview-0.1.8.tar.bz2 +806a1a3ed437bb513a07299824c99dfa epdfview-0.1.8-fixes-1.patch" +sha256sums="948648ae7c9d7b3b408d738bd4f48d87375b1196cae1129d6b846a8de0f2f8f0 epdfview-0.1.8.tar.bz2 +ef9b881173bc1a593125dfd5c49199dee6a2d37648cef9d007dd458a678b325f epdfview-0.1.8-fixes-1.patch" +sha512sums="e81ca39158ed77040a00b69cdbbea4726a1bbf4885a096aaa3dfc4c64d0cbcadabdc69c559bb14d23c2bf7fc8244799176d2c2d5689ab670c13237edc10e8e40 epdfview-0.1.8.tar.bz2 +1ba732ddffcbc44fe35b2d9dc6d1b6c59c63d2eb0ffb088ae06ad425264124b433f59ccdb0f567070931ba98ece14efc42b3cff2b8f79152676588c0b18c10b5 epdfview-0.1.8-fixes-1.patch" diff --git a/testing/epdfview/epdfview-0.1.8-fixes-1.patch b/testing/epdfview/epdfview-0.1.8-fixes-1.patch new file mode 100644 index 0000000..5e8ec28 --- /dev/null +++ b/testing/epdfview/epdfview-0.1.8-fixes-1.patch @@ -0,0 +1,146 @@ +Submitted By: Ken Moffat +Date: 2012-08-22 +Initial Package Version: 0.1.8 +Upstream Status: Varies +Origin: Found at fedora. +Description: Three fixes found at fedora. For the first (only glib.h +can be included directly, with recent glib), we used to use a sed - but +the other two fixes need patches so I've put them all together. + + Second part is from upstream and fixes trashed colours +Upstream: http://trac.emma-soft.com/epdfview/changeset/367/trunk +Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=745483 + + Third part is the most critical - from Jiri Popelka, found at +https://bugzilla.redhat.com/show_bug.cgi?id=841880 - looks as if fedora +haven't applied it yet. It solves building with cups-1.6. + +diff -Naur epdfview-0.1.8.orig/src/gtk/StockIcons.h epdfview-0.1.8/src/gtk/StockIcons.h +--- epdfview-0.1.8.orig/src/gtk/StockIcons.h 2011-05-28 11:24:57.000000000 +0100 ++++ epdfview-0.1.8/src/gtk/StockIcons.h 2012-08-22 20:06:08.728195806 +0100 +@@ -18,7 +18,7 @@ + #if !defined (__STOCK_ICONS_H__) + #define __STOCK_ICONS_H__ + +-#include ++#include + + G_BEGIN_DECLS + +diff -Naur epdfview-0.1.8.orig/src/PDFDocument.cxx epdfview-0.1.8/src/PDFDocument.cxx +--- epdfview-0.1.8.orig/src/PDFDocument.cxx 2011-05-28 11:25:01.000000000 +0100 ++++ epdfview-0.1.8/src/PDFDocument.cxx 2012-08-22 20:07:03.627913886 +0100 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "epdfview.h" + + using namespace ePDFView; +@@ -33,6 +34,24 @@ + static PageMode convertPageMode (gint pageMode); + static gchar *getAbsoluteFileName (const gchar *fileName); + ++namespace ++{ ++ void ++ convert_bgra_to_rgba (guint8 *data, int width, int height) ++ { ++ using std::swap; ++ ++ for (int y = 0; y < height; y++) ++ { ++ for (int x = 0; x < width; x++) ++ { ++ swap(data[0], data[2]); ++ data += 4; ++ } ++ } ++ } ++} ++ + /// + /// @brief Constructs a new PDFDocument object. + /// +@@ -650,6 +669,7 @@ + poppler_page_render (page, context); + cairo_destroy(context); + cairo_surface_destroy (surface); ++ convert_bgra_to_rgba(renderedPage->getData (), width, height); + #else // !HAVE_POPPLER_0_17_0 + // Create the pixbuf from the data and render to it. + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (), +diff -Naur epdfview-0.1.8.orig/src/PrintPter.cxx epdfview-0.1.8/src/PrintPter.cxx +--- epdfview-0.1.8.orig/src/PrintPter.cxx 2011-05-28 11:25:01.000000000 +0100 ++++ epdfview-0.1.8/src/PrintPter.cxx 2012-08-22 20:11:46.362436859 +0100 +@@ -22,6 +22,40 @@ + #include + #include "epdfview.h" + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++inline int ippGetInteger (ipp_attribute_t *attr, int element) ++{ ++ return (attr->values[element].integer); ++} ++ ++inline const char * ippGetString (ipp_attribute_t *attr, ++ int element, ++ const char **language /*UNUSED*/) ++{ ++ return (attr->values[element].string.text); ++} ++ ++inline int ippSetOperation (ipp_t *ipp, ipp_op_t op) ++{ ++ if (!ipp) ++ return (0); ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++inline int ippSetRequestId (ipp_t *ipp, int request_id) ++{ ++ if (!ipp) ++ return (0); ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif ++ + using namespace ePDFView; + + // Structures +@@ -380,8 +414,8 @@ + + ipp_t *request = ippNew (); + +- request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; +- request->request.op.request_id = 1; ++ ippSetOperation(request, IPP_GET_PRINTER_ATTRIBUTES); ++ ippSetRequestId(request, 1); + + ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, "utf-8"); +@@ -403,7 +437,7 @@ + ippFindAttribute (answer, "printer-state", IPP_TAG_ZERO); + if ( NULL != state ) + { +- switch (state->values[0].integer) ++ switch (ippGetInteger (state, 0)) + { + case IPP_PRINTER_IDLE: + attributes->state = g_strdup (_("Idle")); +@@ -425,7 +459,7 @@ + ippFindAttribute (answer, "printer-location", IPP_TAG_ZERO); + if ( NULL != location ) + { +- attributes->location = g_strdup (location->values[0].string.text); ++ attributes->location = g_strdup (ippGetString (location, 0, NULL)); + } + + ippDelete (answer); -- 2.2.0 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---