Skip to contentSkip to conversation

qextserialport: install QExtSerialPort header with qmake

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 6 messages Nov 24, 2016 – Dec 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 qextserialport: install QExtSerialPort header with qmake

Instead of manually copying the QExtSerialPort header introduced in patch 0002, update the patch to include this header in the qmake project file so it gets properly installed.

While we're at it, convert to a git-formatted patch.

Fixes:
http://autobuild.buildroot.net/results/818b564a6e23bcecf4afc7e53811227b08e5f4eb
http://autobuild.buildroot.net/results/0b6c2d7c63329f5e790f02ccd29f14a317eadc71
http://autobuild.buildroot.net/results/ac552b63c6fb099a136066cda421f68e639808fa

---
Note: probably won't apply cleanly because of the silly line endings in qextserialport.pri.

---
 ...Create-a-main-include-file-QExtSerialPort.patch | 43 ++++++++++++++++++++++
 package/qextserialport/0002-main-include.patch     | 15 --------
 package/qextserialport/qextserialport.mk           |  1 -
 3 files changed, 43 insertions(+), 16 deletions(-)
 create mode 100644 package/qextserialport/0002-Create-a-main-include-file-QExtSerialPort.patch
 delete mode 100644 package/qextserialport/0002-main-include.patch
package/qextserialport/0002-Create-a-main-include-file-QExtSerialPort.patch new file +43 -0
new file mode 100644
index 0000000..71ac911
@@ -0,0 +1,43 @@
+From 62fbe9c3539945df6204501b7e3ae0d51db075a3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Thu, 24 Nov 2016 22:30:40 +0100
+Subject: [PATCH] Create a main include file QExtSerialPort
+
+This main include file will be installed in
+<QtExtSerialPort/QExtSerialPort> so that Qt applications can use this
+library by including header files in a Qt-like style.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+[Arnout: add it to qextserialport.pri so it is installed]
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
+---
+ src/QExtSerialPort     | 2 ++
+ src/qextserialport.pri | 3 ++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 src/QExtSerialPort
+
+diff --git a/src/QExtSerialPort b/src/QExtSerialPort
+new file mode 100644
+index 0000000..a48aeea
+--- /dev/null
++++ b/src/QExtSerialPort
+@@ -0,0 +1,2 @@
++#include "qextserialport.h"
++#include "qextserialenumerator.h"
+diff --git a/src/qextserialport.pri b/src/qextserialport.pri
+index 461d56f..f8a678d 100644
+--- a/src/qextserialport.pri
++++ b/src/qextserialport.pri
+@@ -3,7 +3,8 @@ DEPENDPATH += $$PWD
+ 
+ PUBLIC_HEADERS         += $$PWD/qextserialport.h \
+                           $$PWD/qextserialenumerator.h \
+-                          $$PWD/qextserialport_global.h
++                          $$PWD/qextserialport_global.h \
++                          $$PWD/QExtSerialPort
+ 
+ HEADERS                += $$PUBLIC_HEADERS \
+                           $$PWD/qextserialport_p.h \
+-- 
+2.10.2
+
package/qextserialport/0002-main-include.patch deleted +0 -15
deleted file mode 100644
index 27f67f6..0000000
@@ -1,15 +0,0 @@
-Create a main include file QExtSerialPort
-
-This main include file will be installed in
-<QtExtSerialPort/QExtSerialPort> so that Qt applications can use this
-library by including header files in a Qt-like style.
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
-
-Index: qextserialport-ef4af2a2ee3f/src/QExtSerialPort
-===================================================================
---- /dev/null
-+++ qextserialport-ef4af2a2ee3f/src/QExtSerialPort
-@@ -0,0 +1,2 @@
-+#include "qextserialport.h"
-+#include "qextserialenumerator.h"
package/qextserialport/qextserialport.mk +0 -1
index 3641353..62bf3b0 100644
@@ -32,7 +32,6 @@ endef
 
 define QEXTSERIALPORT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	cp $(@D)/src/QExtSerialPort $(STAGING_DIR)/usr/include/QtExtSerialPort/
 	cp $(@D)/qextserialport.pc $(STAGING_DIR)/usr/lib/pkgconfig/
 endef
 
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/3 qextserialport: tell qmake to generate .pc file

Instead of creating our own .pc file with a patch, just tell qmake to do it by adding create_pc to CONFIG.

This corrects the .pc file for Qt5. Previously, the include directory was set to /usr/include, while for Qt5 it should be /usr/include/qt5. This hasn't caused any autobuild failures since no other package uses qextserialport.

Note, however, that the package is now called Qt5ExtSerialPort in Qt5, while before it was qextserialport like in the Qt4 case.

---
 ...to-add-a-pkgconfig-file-to-ease-usage-wit.patch | 28 ++++++++++++++++++++++
 package/qextserialport/0003-pkgconfig.patch        | 19 ---------------
 package/qextserialport/qextserialport.mk           |  1 -
 3 files changed, 28 insertions(+), 20 deletions(-)
 create mode 100644 package/qextserialport/0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch
 delete mode 100644 package/qextserialport/0003-pkgconfig.patch
package/qextserialport/0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch new file +28 -0
new file mode 100644
index 0000000..09e26a9
@@ -0,0 +1,28 @@
+From 14d4d3e7b5c748118acffddd397fb67b37fd5054 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]>
+Date: Thu, 24 Nov 2016 22:44:02 +0100
+Subject: [PATCH] Tell qmake to add a pkgconfig file to ease usage with
+ applications
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
+---
+ qextserialport.pro | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/qextserialport.pro b/qextserialport.pro
+index 8d2c03a..2fcb39c 100644
+--- a/qextserialport.pro
++++ b/qextserialport.pro
+@@ -42,7 +42,8 @@ TEMPLATE=lib
+ include(src/qextserialport.pri)
+ 
+ #create_prl is needed, otherwise, MinGW can't found libqextserialport1.a
+-CONFIG += create_prl
++CONFIG += create_prl create_pc
++QMAKE_PKGCONFIG_DESTDIR = pkgconfig
+ 
+ #mac framework is designed for shared library
+ macx:qesp_mac_framework:qesp_static: CONFIG -= qesp_static
+-- 
+2.10.2
+
package/qextserialport/0003-pkgconfig.patch deleted +0 -19
deleted file mode 100644
index bb55ad7..0000000
@@ -1,19 +0,0 @@
-Add a pkgconfig file to ease usage with applications
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
-
-Index: qextserialport-ef4af2a2ee3f/qextserialport.pc
-===================================================================
---- /dev/null
-+++ qextserialport-ef4af2a2ee3f/qextserialport.pc
-@@ -0,0 +1,10 @@
-+prefix=/usr
-+exec_prefix=${prefix}
-+libdir=${prefix}/lib
-+includedir=${prefix}/include/QtExtSerialPort
-+
-+Name: QtExtSerialPort
-+Description: QtExtSerialPort library
-+Version: 1.2.0
-+Libs: -L${libdir} -lqextserialport
-+Cflags: -I${includedir}
package/qextserialport/qextserialport.mk +0 -1
index 62bf3b0..1100946 100644
@@ -32,7 +32,6 @@ endef
 
 define QEXTSERIALPORT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	cp $(@D)/qextserialport.pc $(STAGING_DIR)/usr/lib/pkgconfig/
 endef
 
 ifeq ($(BR2_STATIC_LIBS),y)
Signature · 1 line
2.10.2
#2 lore raw

PATCH 3/3 qextserialport: remove redundant patch 0001-gui

In reply to Arnout Vandecappelle (Essensium/Mind)

The same thing was done in upstream commit 220d7a2f "QtGui module only needed by Windows", though it was done differently upstream.

---
This one is probably for next (though it depends on the other 2, so only apply after the merge).

---
 ...0001-Create-a-main-include-file-QExtSerialPort.patch} |  0
 package/qextserialport/0001-gui.patch                    | 16 ----------------
 ...make-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} |  0
 3 files changed, 16 deletions(-)
 rename package/qextserialport/{0002-Create-a-main-include-file-QExtSerialPort.patch => 0001-Create-a-main-include-file-QExtSerialPort.patch} (100%)
 delete mode 100644 package/qextserialport/0001-gui.patch
 rename package/qextserialport/{0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch => 0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} (100%)
package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch renamed from package/qextserialport/0002-Create-a-main-include-file-QExtSerialPort.patch +0 -0
similarity index 100%
rename from package/qextserialport/0002-Create-a-main-include-file-QExtSerialPort.patch
rename to package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch
package/qextserialport/0001-gui.patch deleted +0 -16
deleted file mode 100644
index d3dedae..0000000
@@ -1,16 +0,0 @@
-Don't require Qt GUI module
-
-Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
----
-diff -Nrup qextserialport-f83b4e7ca922e53.orig/qextserialport.pro qextserialport-f83b4e7ca922e53/qextserialport.pro
---- qextserialport-f83b4e7ca922e53.orig/qextserialport.pro	2012-10-17 09:13:53.000000000 +0200
-+++ qextserialport-f83b4e7ca922e53/qextserialport.pro	2012-11-13 22:48:29.249431510 +0100
-@@ -41,6 +41,8 @@ macx:qesp_mac_framework {
- 
- win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
- 
-+!win32*:!wince*:QT -= gui
-+
- #generate proper library name
- greaterThan(QT_MAJOR_VERSION, 4) {
-     QESP_LIB_BASENAME = QtExtSerialPort
package/qextserialport/0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch renamed from package/qextserialport/0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch +0 -0
similarity index 100%
rename from package/qextserialport/0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch
rename to package/qextserialport/0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch
Signature · 1 line
2.10.2
#3 lore raw

PATCH 3/3 qextserialport: remove redundant patch 0001-gui

Quoted 7 lines · Arnout Vandecappelle (Essensium/Mind)

The same thing was done in upstream commit 220d7a2f "QtGui module only needed by Windows", though it was done differently upstream.

---
This one is probably for next (though it depends on the other 2, so only apply after the merge).

Quoted 8 lines
---
 ...0001-Create-a-main-include-file-QExtSerialPort.patch} |  0
 package/qextserialport/0001-gui.patch                    | 16 ----------------
 ...make-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} |  0
 3 files changed, 16 deletions(-)
 rename package/qextserialport/{0002-Create-a-main-include-file-QExtSerialPort.patch => 0001-Create-a-main-include-file-QExtSerialPort.patch} (100%)
 delete mode 100644 package/qextserialport/0001-gui.patch
 rename package/qextserialport/{0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch => 0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} (100%)

BTW I sent a pull request with our two remaining patches:
https://github.com/qextserialport/qextserialport/pull/189

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 3/3 qextserialport: remove redundant patch 0001-gui

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 7 lines · Arnout Vandecappelle (Essensium/Mind)

The same thing was done in upstream commit 220d7a2f "QtGui module only needed by Windows", though it was done differently upstream.

---
This one is probably for next (though it depends on the other 2, so only apply after the merge).

Quoted 8 lines
---
 ...0001-Create-a-main-include-file-QExtSerialPort.patch} |  0
 package/qextserialport/0001-gui.patch                    | 16 ----------------
 ...make-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} |  0
 3 files changed, 16 deletions(-)
 rename package/qextserialport/{0002-Create-a-main-include-file-QExtSerialPort.patch => 0001-Create-a-main-include-file-QExtSerialPort.patch} (100%)
 delete mode 100644 package/qextserialport/0001-gui.patch
 rename package/qextserialport/{0003-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch => 0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch} (100%)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/3 qextserialport: install QExtSerialPort header with qmake

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 15 lines · Arnout Vandecappelle (Essensium/Mind)

Instead of manually copying the QExtSerialPort header introduced in patch 0002, update the patch to include this header in the qmake project file so it gets properly installed.

While we're at it, convert to a git-formatted patch.

Fixes:
http://autobuild.buildroot.net/results/818b564a6e23bcecf4afc7e53811227b08e5f4eb
http://autobuild.buildroot.net/results/0b6c2d7c63329f5e790f02ccd29f14a317eadc71
http://autobuild.buildroot.net/results/ac552b63c6fb099a136066cda421f68e639808fa

---
Note: probably won't apply cleanly because of the silly line endings in qextserialport.pri.

Quoted 7 lines
---
 ...Create-a-main-include-file-QExtSerialPort.patch | 43 ++++++++++++++++++++++
 package/qextserialport/0002-main-include.patch     | 15 --------
 package/qextserialport/qextserialport.mk           |  1 -
 3 files changed, 43 insertions(+), 16 deletions(-)
 create mode 100644 package/qextserialport/0002-Create-a-main-include-file-QExtSerialPort.patch
 delete mode 100644 package/qextserialport/0002-main-include.patch

Patches 1 and 2 applied to master. I'm keeping Patch 3 on the side to apply once next has been merged back into master.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com