summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2012-11-07 17:18:20 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2012-11-07 17:18:20 -0500
commit13d15a7d29202439f3afae07aa05e05f8bc88265 (patch)
tree961375911d729460d4e3fc6730283ffea5dcc2f6
parentf42fc14f1c72df432bf84d39676350741313decd (diff)
Add epdfview-0.1.8-cups-1.6.1.patch
-rw-r--r--libre/epdfview-libre/PKGBUILD8
-rw-r--r--libre/epdfview-libre/epdfview-0.1.8-cups-1.6.1.patch74
2 files changed, 79 insertions, 3 deletions
diff --git a/libre/epdfview-libre/PKGBUILD b/libre/epdfview-libre/PKGBUILD
index 28c77eed8..3a0446c49 100644
--- a/libre/epdfview-libre/PKGBUILD
+++ b/libre/epdfview-libre/PKGBUILD
@@ -22,11 +22,13 @@ install='epdfview.install'
source=("http://www.emma-soft.com/projects/${_pkgname}/chrome/site/releases/${_pkgname}-${pkgver}.tar.bz2"
"${_pkgname}.desktop.patch"
"glib2_headers.patch"
- "0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch")
+ "0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch"
+ "epdfview-0.1.8-cups-1.6.1.patch")
md5sums=('e50285b01612169b2594fea375f53ae4'
'fbf22bbabdbb7544db615ac5775d57e2'
'41b30f53f20472cbc2fcd4eae161125e'
- '7f9ea101a41f5b4e999fd024f423d41f')
+ '7f9ea101a41f5b4e999fd024f423d41f'
+ 'c4f3c8ee5fa3a00c8e34515b285e1266')
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
@@ -34,7 +36,7 @@ build() {
patch -Np0 -i "${srcdir}/${_pkgname}.desktop.patch"
patch -Np1 -i "${srcdir}/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch"
patch -Np1 -i "${srcdir}/glib2_headers.patch" # FS#30116
-
+ patch -Np1 -i "${srcdir}/epdfview-0.1.8-cups-1.6.1.patch"
# Use xdg-open as default browser.
sed -r '/DEFAULT_EXTERNAL_BROWSER_COMMAND_LINE/s/firefox[^ ]*/xdg-open/' -i src/Config.cxx
diff --git a/libre/epdfview-libre/epdfview-0.1.8-cups-1.6.1.patch b/libre/epdfview-libre/epdfview-0.1.8-cups-1.6.1.patch
new file mode 100644
index 000000000..739579d29
--- /dev/null
+++ b/libre/epdfview-libre/epdfview-0.1.8-cups-1.6.1.patch
@@ -0,0 +1,74 @@
+diff -up epdfview-0.1.8/configure.ac.cups16 epdfview-0.1.8/configure.ac
+diff -up epdfview-0.1.8/src/PrintPter.cxx.cups16 epdfview-0.1.8/src/PrintPter.cxx
+--- epdfview-0.1.8/src/PrintPter.cxx.cups16 2011-05-28 12:25:01.000000000 +0200
++++ epdfview-0.1.8/src/PrintPter.cxx 2012-07-20 15:04:30.846111813 +0200
+@@ -22,6 +22,40 @@
+ #include <locale.h>
+ #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 @@ PrintPter::getPrinterAttributes (const g
+
+ 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 @@ PrintPter::getPrinterAttributes (const g
+ 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 @@ PrintPter::getPrinterAttributes (const g
+ 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);