Skip to contentSkip to conversation

New package: QSerialDevice

RFC In review Yegor Yefremov 3 participants 4 messages Oct 25, 2011

lore
Share & tools
lore
#0 lore raw

RFC 1/1 New package: QSerialDevice

I have some questions regarding inclusion of this package:

1. I fetch it from git branch, how can I specify revision?
2. how do I handle symlinking for libraries? If I just copy all 4 files, I get 4 same files and not one library and 3 symlinks
3. what about creating some kind of folders/menu (in package/Config.in) for Qt, python etc. add-ons?

Yegor

---
 package/Config.in                      |    4 ++++
 package/qserialdevice/Config.in        |    7 +++++++
 package/qserialdevice/qserialdevice.mk |   26 ++++++++++++++++++++++++++
 3 files changed, 37 insertions(+)
package/Config.in +4 -0
Index: b/package/Config.in
===================================================================
@@ -316,6 +316,7 @@
 source "package/libusb/Config.in"
 source "package/libusb-compat/Config.in"
 source "package/python-serial/Config.in"
+source "package/qserialdevice/Config.in"
 endmenu
 
 if BROKEN
@@ -556,4 +557,7 @@
 endif
 endmenu
 
+menu "VScom"
+source "package/vscom/vsguitest/Config.in"
+endmenu
 endmenu
package/qserialdevice/Config.in new file +7 -0
Index: b/package/qserialdevice/Config.in
===================================================================
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_QSERIALDEVICE
+	bool "QSerialDevice"
+	depends on BR2_PACKAGE_QT
+	depends on BR2_PACKAGE_UDEV
+	select BR2_PACKAGE_QT_STL
+	help
+	  Qt serial port implementation.
package/qserialdevice/qserialdevice.mk new file +26 -0
Index: b/package/qserialdevice/qserialdevice.mk
===================================================================
@@ -0,0 +1,26 @@
+QSERIALDEVICE_VERSION = 2.0
+QSERIALDEVICE_SITE = git://gitorious.org/qserialdevice/qserialdevice.git
+QSERIALDEVICE_INSTALL_STAGING = YES
+QSERIALDEVICE_DEPENDENCIES = qt udev
+
+define QSERIALDEVICE_CONFIGURE_CMDS
+	$(QT_QMAKE) $(@D)/serialport.pro
+endef
+
+define QSERIALDEVICE_BUILD_CMDS
+	$(MAKE) -C $(@D) all
+endef
+
+define QSERIALDEVICE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/src/libSerialPort.so* \
+		$(TARGET_DIR)/usr/lib
+endef
+
+define QSERIALDEVICE_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 0755 $(@D)/src/libSerialPort.so* \
+		$(STAGING_DIR)/usr/lib
+	$(INSTALL) -m 0644 $(@D)/include/serial* \
+		$(STAGING_DIR)/usr/include
+endef
+
+$(eval $(call GENTARGETS))
#1 lore raw

Le Tue, 25 Oct 2011 09:22:34 +0200,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 1 line

1. I fetch it from git branch, how can I specify revision?

pkg_VERSION = ...

You can specify a git branch, a git commit, whatever commit identifier that is valid for git.

Quoted 2 lines

2. how do I handle symlinking for libraries? If I just copy all 4 files, I get 4 same files and not one library and 3 symlinks

Either use the "make install" of the package (or implement it), or use ln to create the symlinks.

Quoted 3 lines

3. what
about creating some kind of folders/menu (in package/Config.in) for Qt, python etc. add-ons?

I don't know. qserialdevice should go in Libraries -> Hardware handling. I don't see why it would need to end up in a qt-specific submenu.

package/qserialdevice/qserialdevice.mk line 8

Quoted 3 lines
package/qserialdevice/qserialdevice.mk new file +3 -0
+define QSERIALDEVICE_CONFIGURE_CMDS
+	$(QT_QMAKE) $(@D)/serialport.pro
+endef

Should be:

	(cd $(@D); $(QT_QMAKE) serialport.pro)

Does it *absolutely* require udev ? I have never used QSerialDevice, but QExtSerialPort instead, and udev wasn't necessary.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

Am 25.10.2011 10:17, schrieb Thomas Petazzoni:

Quoted 8 lines

Le Tue, 25 Oct 2011 09:22:34 +0200,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 1 line

1. I fetch it from git branch, how can I specify revision?

pkg_VERSION = ...

You can specify a git branch, a git commit, whatever commit identifier that is valid for git.

But how can I combine branch name together with commit? I've already specified branch "2.0" as QSERIALDEVICE_VERSION.

Quoted 4 lines
Quoted 2 lines

2. how do I handle symlinking for libraries? If I just copy all 4 files, I get 4 same files and not one library and 3 symlinks

Either use the "make install" of the package (or implement it), or use ln to create the symlinks.

O.K. I thought there would be some kind of elegant and easy way, like an option that copies only symlink and not it's target if desired :-)

Quoted 6 lines
Quoted 3 lines

3. what
about creating some kind of folders/menu (in package/Config.in) for Qt, python etc. add-ons?

I don't know. qserialdevice should go in Libraries -> Hardware handling. I don't see why it would need to end up in a qt-specific submenu.

O.K.

Quoted 6 lines

package/qserialdevice/qserialdevice.mk line 8

Quoted 3 lines
package/qserialdevice/qserialdevice.mk new file +3 -0
+define QSERIALDEVICE_CONFIGURE_CMDS
+	$(QT_QMAKE) $(@D)/serialport.pro
+endef

Should be:

	(cd $(@D); $(QT_QMAKE) serialport.pro)

You won't believe me, but it worked without cd statement. That's why I was puzzled by my local package not willing to create Makefile in output/build/vsguitest. But I fix it for QSerialDevice for conformance sake.

Quoted 3 lines

Does it *absolutely* require udev ? I have never used QSerialDevice, but QExtSerialPort instead, and udev wasn't necessary.

It requires both build-time and run-time udev. This package provides two classes/interfaces:

1. serial port itself
2. informational class containing all installed serial port sin the system and it uses libudev (I'll send a patch that installs udev in staging)

Yegor

#3 lore raw

Hi Yegor,

Quoted 11 lines · Yegor Yefremov

Am 25.10.2011 10:17, schrieb Thomas Petazzoni:

Quoted 8 lines

Le Tue, 25 Oct 2011 09:22:34 +0200,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 1 line

1. I fetch it from git branch, how can I specify revision?

pkg_VERSION = ...

You can specify a git branch, a git commit, whatever commit identifier that is valid for git.

But how can I combine branch name together with commit? I've already specified branch "2.0" as QSERIALDEVICE_VERSION.

The commit uniquely identifies a particular revision, whatever branch it is on. So once you specify the commit, the branch is automatically known.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

2. how do I handle symlinking for libraries? If I just copy all 4 files, I get 4 same files and not one library and 3 symlinks

Either use the "make install" of the package (or implement it), or use ln to create the symlinks.

O.K. I thought there would be some kind of elegant and easy way, like an option that copies only symlink and not it's target if desired :-)

If you want to copy an existing link and not the link target, you can use 'cp -P' : (from 'man cp')
-P, --no-dereference
never follow symbolic links

Quoted 20 lines
Quoted 7 lines
Quoted 4 lines

3. what
about creating some kind of folders/menu (in package/Config.in) for Qt, python etc. add-ons?

I don't know. qserialdevice should go in Libraries -> Hardware handling. I don't see why it would need to end up in a qt-specific submenu.

O.K.

Quoted 6 lines

package/qserialdevice/qserialdevice.mk line 8

Quoted 3 lines
package/qserialdevice/qserialdevice.mk new file +3 -0
+define QSERIALDEVICE_CONFIGURE_CMDS
+ ? ?$(QT_QMAKE) $(@D)/serialport.pro
+endef

Should be:

? ? ? (cd $(@D); $(QT_QMAKE) serialport.pro)

You won't believe me, but it worked without cd statement. That's why I was puzzled by my local package not willing to create Makefile in output/build/vsguitest. But I fix it for QSerialDevice for conformance sake.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

Does it *absolutely* require udev ? I have never used QSerialDevice, but QExtSerialPort instead, and udev wasn't necessary.

It requires both build-time and run-time udev. This package provides two classes/interfaces:

1. serial port itself
2. informational class containing all installed serial port sin the system and it uses libudev (I'll send a patch that installs udev in staging)

Best regards,
Thomas