Skip to contentSkip to conversation

hplip: Fix build with clang

PATCH Superseded Khem Raj 2 participants 4 messages Dec 16, 2016 – Dec 21, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 hplip: Fix build with clang

---
 ...de-cups-ppd.h-for-missing-ppd-definitions.patch | 42 ++++++++++++++++++++++
 meta-oe/recipes-extended/hplip/hplip_3.12.6.bb     |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch
meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch new file +42 -0
new file mode 100644
index 0000000..f259b5f
@@ -0,0 +1,42 @@
+From 7ef9c040dd959105c16d4dc67e14f3bbea25e77f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 16 Dec 2016 19:51:19 +0000
+Subject: [PATCH] include cups/ppd.h for missing ppd definitions
+
+Fixes errors spotted by clang
+
+| prnt/hpcups/HPCupsFilter.cpp:365:18: error: use of undeclared identifier 'ppdFindAttr'
+|     if (((attr = ppdFindAttr(m_ppd, "hpPrinterLanguage", NULL)) == NULL) ||
+|                  ^
+| prnt/hpcups/HPCupsFilter.cpp:368:13: error: use of undeclared identifier 'ppdClose'
+|             ppdClose(m_ppd);
+|             ^
+| prnt/hpcups/HPCupsFilter.cpp:444:9: error: use of undeclared identifier 'ppdClose'
+|         ppdClose(m_ppd);
+|         ^
+| prnt/hpcups/HPCupsFilter.cpp:497:13: error: use of undeclared identifier 'ppdOpenFile'
+|     m_ppd = ppdOpenFile(getenv("PPD"));
+|             ^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ prnt/hpcups/HPCupsFilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index 0431a7a..eb0cad6 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -37,6 +37,7 @@
+ #include "Job.h"
+ 
+ #include "dbuscomm.h"
++#include <cups/ppd.h>
+ 
+ #define		DBITMAPFILEHEADER		14
+ #define		DBITMAPINFOHEADER		40
+-- 
+1.9.1
+
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +1 -0
index 9848e5a..1f1e80c 100644
@@ -9,6 +9,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://fix-libusb-paths.patch \
            file://cups-1.6.patch \
            file://configure.patch \
+           file://0001-include-cups-ppd.h-for-missing-ppd-definitions.patch \
 "
 
 DEPENDS += "cups python libusb"
Signature · 1 line
2.10.2
#1 lore raw
Quoted 60 lines · Khem Raj
---
 ...de-cups-ppd.h-for-missing-ppd-definitions.patch | 42 ++++++++++++++++++++++
 meta-oe/recipes-extended/hplip/hplip_3.12.6.bb     |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch
meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch new file +42 -0
new file mode 100644
index 0000000..f259b5f
@@ -0,0 +1,42 @@
+From 7ef9c040dd959105c16d4dc67e14f3bbea25e77f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 16 Dec 2016 19:51:19 +0000
+Subject: [PATCH] include cups/ppd.h for missing ppd definitions
+
+Fixes errors spotted by clang
+
+| prnt/hpcups/HPCupsFilter.cpp:365:18: error: use of undeclared identifier 'ppdFindAttr'
+|     if (((attr = ppdFindAttr(m_ppd, "hpPrinterLanguage", NULL)) == NULL) ||
+|                  ^
+| prnt/hpcups/HPCupsFilter.cpp:368:13: error: use of undeclared identifier 'ppdClose'
+|             ppdClose(m_ppd);
+|             ^
+| prnt/hpcups/HPCupsFilter.cpp:444:9: error: use of undeclared identifier 'ppdClose'
+|         ppdClose(m_ppd);
+|         ^
+| prnt/hpcups/HPCupsFilter.cpp:497:13: error: use of undeclared identifier 'ppdOpenFile'
+|     m_ppd = ppdOpenFile(getenv("PPD"));
+|             ^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ prnt/hpcups/HPCupsFilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index 0431a7a..eb0cad6 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -37,6 +37,7 @@
+ #include "Job.h"
+ 
+ #include "dbuscomm.h"
++#include <cups/ppd.h>
+ 
+ #define		DBITMAPFILEHEADER		14
+ #define		DBITMAPINFOHEADER		40
+-- 
+1.9.1
+
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -0
index 9848e5a..1f1e80c 100644

meta-oe/recipes-extended/hplip/hplip_3.12.6.bb SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \ · line 13

Quoted 5 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +1 -0
@@ -9,6 +9,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://fix-libusb-paths.patch \
            file://cups-1.6.patch \
            file://configure.patch \
+           file://0001-include-cups-ppd.h-for-missing-ppd-definitions.patch \
 "

It failed to build even without clang (when using default toolchain), but this patch fails to apply:

http://logs.nslu2-linux.org/buildlogs/oe/world/pyro/log.dependencies.qemuarm.20161218_140914.log//2_max/failed/hplip.log

Quoted 10 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -0
 DEPENDS += "cups python libusb"
Signature · 7 lines
2.10.2

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#2 lore raw
Quoted 70 lines · Martin Jansa
Quoted 60 lines · Khem Raj
---
 ...de-cups-ppd.h-for-missing-ppd-definitions.patch | 42 ++++++++++++++++++++++
 meta-oe/recipes-extended/hplip/hplip_3.12.6.bb     |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch
meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch new file +42 -0
new file mode 100644
index 0000000..f259b5f
@@ -0,0 +1,42 @@
+From 7ef9c040dd959105c16d4dc67e14f3bbea25e77f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 16 Dec 2016 19:51:19 +0000
+Subject: [PATCH] include cups/ppd.h for missing ppd definitions
+
+Fixes errors spotted by clang
+
+| prnt/hpcups/HPCupsFilter.cpp:365:18: error: use of undeclared identifier 'ppdFindAttr'
+|     if (((attr = ppdFindAttr(m_ppd, "hpPrinterLanguage", NULL)) == NULL) ||
+|                  ^
+| prnt/hpcups/HPCupsFilter.cpp:368:13: error: use of undeclared identifier 'ppdClose'
+|             ppdClose(m_ppd);
+|             ^
+| prnt/hpcups/HPCupsFilter.cpp:444:9: error: use of undeclared identifier 'ppdClose'
+|         ppdClose(m_ppd);
+|         ^
+| prnt/hpcups/HPCupsFilter.cpp:497:13: error: use of undeclared identifier 'ppdOpenFile'
+|     m_ppd = ppdOpenFile(getenv("PPD"));
+|             ^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ prnt/hpcups/HPCupsFilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index 0431a7a..eb0cad6 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -37,6 +37,7 @@
+ #include "Job.h"
+
+ #include "dbuscomm.h"
++#include <cups/ppd.h>
+
+ #define             DBITMAPFILEHEADER               14
+ #define             DBITMAPINFOHEADER               40
+--
+1.9.1
+
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -0
index 9848e5a..1f1e80c 100644

meta-oe/recipes-extended/hplip/hplip_3.12.6.bb SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \ · line 13

Quoted 5 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +1 -0
@@ -9,6 +9,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://fix-libusb-paths.patch \
            file://cups-1.6.patch \
            file://configure.patch \
+           file://0001-include-cups-ppd.h-for-missing-ppd-definitions.patch \
 "

It failed to build even without clang (when using default toolchain), but this patch fails to apply:

Quoted 1 line

http://logs.nslu2-linux.org/buildlogs/oe/world/pyro/log.dependencies.qemuarm.20161218_140914.log//2_max/failed/hplip.log

This has to do with line endings, I guess patch program on your builder is not happy about the CR-LF endings. I have sent another patch, where I do not introduce new empty lines. Lets see if this one applies ok.

Quoted 21 lines
Quoted 11 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -1
 DEPENDS += "cups python libusb"
--

2.10.2

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
Martin 'JaMa' Jansa jabber: [email protected]

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#3 lore raw
In reply to Martin Jansa
Quoted 70 lines · Martin Jansa
Quoted 60 lines · Khem Raj
---
 ...de-cups-ppd.h-for-missing-ppd-definitions.patch | 42 ++++++++++++++++++++++
 meta-oe/recipes-extended/hplip/hplip_3.12.6.bb     |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch
meta-oe/recipes-extended/hplip/hplip-3.12.6/0001-include-cups-ppd.h-for-missing-ppd-definitions.patch new file +42 -0
new file mode 100644
index 0000000..f259b5f
@@ -0,0 +1,42 @@
+From 7ef9c040dd959105c16d4dc67e14f3bbea25e77f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 16 Dec 2016 19:51:19 +0000
+Subject: [PATCH] include cups/ppd.h for missing ppd definitions
+
+Fixes errors spotted by clang
+
+| prnt/hpcups/HPCupsFilter.cpp:365:18: error: use of undeclared identifier 'ppdFindAttr'
+|     if (((attr = ppdFindAttr(m_ppd, "hpPrinterLanguage", NULL)) == NULL) ||
+|                  ^
+| prnt/hpcups/HPCupsFilter.cpp:368:13: error: use of undeclared identifier 'ppdClose'
+|             ppdClose(m_ppd);
+|             ^
+| prnt/hpcups/HPCupsFilter.cpp:444:9: error: use of undeclared identifier 'ppdClose'
+|         ppdClose(m_ppd);
+|         ^
+| prnt/hpcups/HPCupsFilter.cpp:497:13: error: use of undeclared identifier 'ppdOpenFile'
+|     m_ppd = ppdOpenFile(getenv("PPD"));
+|             ^
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ prnt/hpcups/HPCupsFilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index 0431a7a..eb0cad6 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -37,6 +37,7 @@
+ #include "Job.h"
+ 
+ #include "dbuscomm.h"
++#include <cups/ppd.h>
+ 
+ #define		DBITMAPFILEHEADER		14
+ #define		DBITMAPINFOHEADER		40
+-- 
+1.9.1
+
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -0
index 9848e5a..1f1e80c 100644

meta-oe/recipes-extended/hplip/hplip_3.12.6.bb SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \ · line 13

Quoted 5 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +1 -0
@@ -9,6 +9,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://fix-libusb-paths.patch \
            file://cups-1.6.patch \
            file://configure.patch \
+           file://0001-include-cups-ppd.h-for-missing-ppd-definitions.patch \
 "

It failed to build even without clang (when using default toolchain), but this patch fails to apply:

Quoted 1 line

http://logs.nslu2-linux.org/buildlogs/oe/world/pyro/log.dependencies.qemuarm.20161218_140914.log//2_max/failed/hplip.log

I've cherry-picked this directly from you branch and it fixed the line endings in the patch and might fix to application of the .patch, lets see if it fixes also the build with default toolchain.

Quoted 14 lines
Quoted 11 lines
meta-oe/recipes-extended/hplip/hplip_3.12.6.bb +0 -0
 DEPENDS += "cups python libusb"
Signature · 7 lines
2.10.2

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]