Skip to contentSkip to conversation

new packages: libzip and sigrok

PATCH Superseded Bartosz Golaszewski 2 participants 6 messages Jan 27, 2015 – Jan 29, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover new packages: libzip and sigrok

This series adds support for building a minimal subset of the sigrok software suite. The motivation for merging these patches is making sigrok-cli available for users of ACME board (http://baylibre.com/acme/).

The first patch adds libzip package - this is required to build libsigrok.

The second patch adds sigrok libraries and sigrok-cli executable in a single package. The sources for sigrok modules are cloned from current git HEADs. This is because ACME driver for sigrok isn't upstream yet and we would like to make it available in buildroot as soon as it's merged.

Bartosz Golaszewski (2):
libzip: new package
sigrok: new package

 package/Config.in                                 |  2 ++
 package/libzip/Config.in                          |  7 +++++
 package/libzip/libzip.mk                          | 15 +++++++++
 package/sigrok/Config.in                          | 37 +++++++++++++++++++++++
 package/sigrok/libserialport/libserialport.mk     | 15 +++++++++
 package/sigrok/libsigrok/libsigrok.mk             | 16 ++++++++++
 package/sigrok/libsigrokdecode/libsigrokdecode.mk | 16 ++++++++++
 package/sigrok/sigrok.mk                          | 10 ++++++
 package/sigrok/sigrokcli/sigrokcli.mk             | 14 +++++++++
 9 files changed, 132 insertions(+)
 create mode 100644 package/libzip/Config.in
 create mode 100644 package/libzip/libzip.mk
 create mode 100644 package/sigrok/Config.in
 create mode 100644 package/sigrok/libserialport/libserialport.mk
 create mode 100644 package/sigrok/libsigrok/libsigrok.mk
 create mode 100644 package/sigrok/libsigrokdecode/libsigrokdecode.mk
 create mode 100644 package/sigrok/sigrok.mk
 create mode 100644 package/sigrok/sigrokcli/sigrokcli.mk
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/2 libzip: new package

---
 package/Config.in        |  1 +
 package/libzip/Config.in |  7 +++++++
 package/libzip/libzip.mk | 15 +++++++++++++++
 3 files changed, 23 insertions(+)
 create mode 100644 package/libzip/Config.in
 create mode 100644 package/libzip/libzip.mk
package/Config.in +1 -0
index 51d4c15..2d0adac 100644
@@ -603,6 +603,7 @@ endmenu
 
 menu "Compression and decompression"
 	source "package/libarchive/Config.in"
+	source "package/libzip/Config.in"
 	source "package/lzo/Config.in"
 	source "package/snappy/Config.in"
 	source "package/szip/Config.in"
package/libzip/Config.in new file +7 -0
new file mode 100644
index 0000000..c07b956
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBZIP
+	bool "libzip"
+	select BR2_PACKAGE_ZLIB
+	help
+	  C library for reading, creating, and modifying zip archives.
+
+	  http://www.nih.at/libzip/
package/libzip/libzip.mk new file +15 -0
new file mode 100644
index 0000000..3a9cdb1
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libzip
+#
+################################################################################
+
+LIBZIP_VERSION = 0.11.2
+LIBZIP_SITE = http://www.nih.at/libzip/
+LIBZIP_SOURCE = libzip-$(LIBZIP_VERSION).tar.xz
+LIBZIP_LICENSE = special libzip license
+LIBZIP_LICENSE_FILES = LICENSE
+LIBZIP_INSTALL_STAGING = YES
+LIBZIP_DEPENDENCIES = zlib
+
+$(eval $(autotools-package))
Signature · 1 line
2.1.4
#2 lore raw

PATCH 1/2 libzip: new package

Quoted 1 line · Bartosz Golaszewski

One small remark below

Quoted 26 lines
---
 package/Config.in        |  1 +
 package/libzip/Config.in |  7 +++++++
 package/libzip/libzip.mk | 15 +++++++++++++++
 3 files changed, 23 insertions(+)
 create mode 100644 package/libzip/Config.in
 create mode 100644 package/libzip/libzip.mk
package/Config.in +1 -0
index 51d4c15..2d0adac 100644
@@ -603,6 +603,7 @@ endmenu
 
 menu "Compression and decompression"
 	source "package/libarchive/Config.in"
+	source "package/libzip/Config.in"
 	source "package/lzo/Config.in"
 	source "package/snappy/Config.in"
 	source "package/szip/Config.in"
package/libzip/Config.in new file +0 -0
new file mode 100644
index 0000000..c07b956

package/libzip/Config.in line 5

Quoted 5 lines
package/libzip/Config.in new file +5 -0
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBZIP
+	bool "libzip"
+	select BR2_PACKAGE_ZLIB
+	help
+	  C library for reading, creating, and modifying zip archives.

Perhaps mention that also zipcmp zipmerge ziptorrent are installed.

Regards,
Arnout

Quoted 24 lines
package/libzip/Config.in new file +2 -0
+
+	  http://www.nih.at/libzip/
package/libzip/libzip.mk new file +15 -0
new file mode 100644
index 0000000..3a9cdb1
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libzip
+#
+################################################################################
+
+LIBZIP_VERSION = 0.11.2
+LIBZIP_SITE = http://www.nih.at/libzip/
+LIBZIP_SOURCE = libzip-$(LIBZIP_VERSION).tar.xz
+LIBZIP_LICENSE = special libzip license
+LIBZIP_LICENSE_FILES = LICENSE
+LIBZIP_INSTALL_STAGING = YES
+LIBZIP_DEPENDENCIES = zlib
+
+$(eval $(autotools-package))
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 2/2 sigrok: new package

In reply to Bartosz Golaszewski

Add sigrok libraries and sigrok-cli executable in a single package.

---
 package/Config.in                                 |  1 +
 package/sigrok/Config.in                          | 37 +++++++++++++++++++++++
 package/sigrok/libserialport/libserialport.mk     | 15 +++++++++
 package/sigrok/libsigrok/libsigrok.mk             | 16 ++++++++++
 package/sigrok/libsigrokdecode/libsigrokdecode.mk | 16 ++++++++++
 package/sigrok/sigrok.mk                          | 10 ++++++
 package/sigrok/sigrokcli/sigrokcli.mk             | 14 +++++++++
 7 files changed, 109 insertions(+)
 create mode 100644 package/sigrok/Config.in
 create mode 100644 package/sigrok/libserialport/libserialport.mk
 create mode 100644 package/sigrok/libsigrok/libsigrok.mk
 create mode 100644 package/sigrok/libsigrokdecode/libsigrokdecode.mk
 create mode 100644 package/sigrok/sigrok.mk
 create mode 100644 package/sigrok/sigrokcli/sigrokcli.mk
package/Config.in +1 -0
index 2d0adac..fe2f417 100644
@@ -364,6 +364,7 @@ endif
 	source "package/sdparm/Config.in"
 	source "package/setserial/Config.in"
 	source "package/sg3_utils/Config.in"
+	source "package/sigrok/Config.in"
 	source "package/sispmctl/Config.in"
 	source "package/smartmontools/Config.in"
 	source "package/smstools3/Config.in"
package/sigrok/Config.in new file +37 -0
new file mode 100644
index 0000000..f5f52ce
@@ -0,0 +1,37 @@
+config BR2_PACKAGE_SIGROK
+	bool "sigrok"
+	select BR2_PACKAGE_LIBSERIALPORT
+	select BR2_PACKAGE_LIBSIGROK
+	select BR2_PACKAGE_LIBSIGROKDECODE
+	select BR2_PACKAGE_SIGROKCLI
+	# libglib2 & python3:
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	help
+	  Signal analysis software suite.
+
+	  This package contains the sigrok software suite: libserialport,
+	  libsigrok, libsigrokdecode libraries and sigrok-cli command-line
+	  utility.
+
+	  http://sigrok.org/
+
+comment "sigrok needs a toolchain w/ wchar, threads
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_LIBSERIALPORT
+	bool
+
+config BR2_PACKAGE_LIBSIGROK
+	bool
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBZIP
+
+config BR2_PACKAGE_LIBSIGROKDECODE
+	bool
+	select BR2_PACKAGE_PYTHON3
+
+config BR2_PACKAGE_SIGROKCLI
+	bool
package/sigrok/libserialport/libserialport.mk new file +15 -0
new file mode 100644
index 0000000..970e1c1
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libserialport
+#
+################################################################################
+
+LIBSERIALPORT_VERSION = HEAD
+LIBSERIALPORT_SITE = git://sigrok.org/libserialport
+LIBSERIALPORT_LICENSE = LGPLv3+
+LIBSERIALPORT_LICENSE_FILES = COPYING
+LIBSERIALPORT_AUTORECONF = YES
+LIBSERIALPORT_INSTALL_STAGING = YES
+LIBSERIALPORT_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING
+
+$(eval $(autotools-package))
package/sigrok/libsigrok/libsigrok.mk new file +16 -0
new file mode 100644
index 0000000..4a61f6c
@@ -0,0 +1,16 @@
+################################################################################
+#
+# libsigrok
+#
+################################################################################
+
+LIBSIGROK_VERSION = HEAD
+LIBSIGROK_SITE = git://sigrok.org/libsigrok
+LIBSIGROK_LICENSE = GPLv3+
+LIBSIGROK_LICENSE = COPYING
+LIBSIGROK_AUTORECONF = YES
+LIBSIGROK_INSTALL_STAGING = YES
+LIBSIGROK_DEPENDENCIES = libglib2 libzip
+LIBSIGROK_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING
+
+$(eval $(autotools-package))
package/sigrok/libsigrokdecode/libsigrokdecode.mk new file +16 -0
new file mode 100644
index 0000000..696f097
@@ -0,0 +1,16 @@
+################################################################################
+#
+# libsigrokdecode
+#
+################################################################################
+
+LIBSIGROKDECODE_VERSION = HEAD
+LIBSIGROKDECODE_SITE = git://sigrok.org/libsigrokdecode
+LIBSIGROKDECODE_LICENSE = GPLv3+
+LIBSIGROKDECODE_LICENSE_FILES = COPYING
+LIBSIGROKDECODE_AUTORECONF = YES
+LIBSIGROKDECODE_INSTALL_STAGING = YES
+LIBSIGROKDECODE_DEPENDENCIES = python3
+LIBSIGROKDECODE_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING
+
+$(eval $(autotools-package))
package/sigrok/sigrok.mk new file +10 -0
new file mode 100644
index 0000000..b287880
@@ -0,0 +1,10 @@
+define SIGROK_ADD_MISSING
+	cd $(@D); \
+	mkdir -p autostuff; \
+	automake --add-missing; \
+	cd -;
+endef
+
+ifeq ($(BR2_PACKAGE_SIGROK),y)
+include $(sort $(wildcard package/sigrok/*/*.mk))
+endif
package/sigrok/sigrokcli/sigrokcli.mk new file +14 -0
new file mode 100644
index 0000000..3d984ef
@@ -0,0 +1,14 @@
+################################################################################
+#
+# sigrok-cli
+#
+################################################################################
+
+SIGROKCLI_VERSION = HEAD
+SIGROKCLI_SITE = git://sigrok.org/sigrok-cli
+SIGROKCLI_LICENSE = GPLv3+
+SIGROKCLI_LICENSE_FILES = COPYING
+SIGROKCLI_AUTORECONF = YES
+SIGROKCLI_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING
+
+$(eval $(autotools-package))
Signature · 1 line
2.1.4
#4 lore raw

PATCH 2/2 sigrok: new package

Hi Bartosz,

Thanks for your contribution. I haven't tested this one yet, but I have some
remarks.

Quoted 1 line · Bartosz Golaszewski

Add sigrok libraries and sigrok-cli executable in a single package.

Is there a good reason to put everything in a single package? We normally make
separate packages for everything. We also don't like putting things in a subdirectory very much. So I'd expect three separate packages:

package/libserialport
package/libsigrok
package/libsigrokdecode
package/sigrok-cli

The first three would go in the Libraries -> Hardware Handling menu, while the
cli would go in the Packages -> Hardware Handling menu.

Quoted 36 lines
---
 package/Config.in                                 |  1 +
 package/sigrok/Config.in                          | 37 +++++++++++++++++++++++
 package/sigrok/libserialport/libserialport.mk     | 15 +++++++++
 package/sigrok/libsigrok/libsigrok.mk             | 16 ++++++++++
 package/sigrok/libsigrokdecode/libsigrokdecode.mk | 16 ++++++++++
 package/sigrok/sigrok.mk                          | 10 ++++++
 package/sigrok/sigrokcli/sigrokcli.mk             | 14 +++++++++
 7 files changed, 109 insertions(+)
 create mode 100644 package/sigrok/Config.in
 create mode 100644 package/sigrok/libserialport/libserialport.mk
 create mode 100644 package/sigrok/libsigrok/libsigrok.mk
 create mode 100644 package/sigrok/libsigrokdecode/libsigrokdecode.mk
 create mode 100644 package/sigrok/sigrok.mk
 create mode 100644 package/sigrok/sigrokcli/sigrokcli.mk
package/Config.in +1 -0
index 2d0adac..fe2f417 100644
@@ -364,6 +364,7 @@ endif
 	source "package/sdparm/Config.in"
 	source "package/setserial/Config.in"
 	source "package/sg3_utils/Config.in"
+	source "package/sigrok/Config.in"
 	source "package/sispmctl/Config.in"
 	source "package/smartmontools/Config.in"
 	source "package/smstools3/Config.in"
package/sigrok/Config.in new file +0 -0
new file mode 100644
index 0000000..f5f52ce

package/sigrok/Config.in line 8

Quoted 8 lines
package/sigrok/Config.in new file +8 -0
@@ -0,0 +1,37 @@
+config BR2_PACKAGE_SIGROK
+	bool "sigrok"
+	select BR2_PACKAGE_LIBSERIALPORT
+	select BR2_PACKAGE_LIBSIGROK
+	select BR2_PACKAGE_LIBSIGROKDECODE
+	select BR2_PACKAGE_SIGROKCLI
+	# libglib2 & python3:
+	depends on BR2_USE_WCHAR

We usually put something like:

	depends on BR2_USE_WCHAR # libsigrok->libglib2, libsigrokdecode->python3
Quoted 35 lines
package/sigrok/Config.in new file +29 -0
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	help
+	  Signal analysis software suite.
+
+	  This package contains the sigrok software suite: libserialport,
+	  libsigrok, libsigrokdecode libraries and sigrok-cli command-line
+	  utility.
+
+	  http://sigrok.org/
+
+comment "sigrok needs a toolchain w/ wchar, threads
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_LIBSERIALPORT
+	bool
+
+config BR2_PACKAGE_LIBSIGROK
+	bool
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBZIP
+
+config BR2_PACKAGE_LIBSIGROKDECODE
+	bool
+	select BR2_PACKAGE_PYTHON3
+
+config BR2_PACKAGE_SIGROKCLI
+	bool
package/sigrok/libserialport/libserialport.mk new file +0 -0
new file mode 100644
index 0000000..970e1c1

package/sigrok/libserialport/libserialport.mk line 7

Quoted 7 lines
package/sigrok/libserialport/libserialport.mk new file +7 -0
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libserialport
+#
+################################################################################
+
+LIBSERIALPORT_VERSION = HEAD

We want a specific version so the build is reproducible. Preferably a tag, but
in this case I guess it would be a full commit ID:
e31f2c6b8b8f2b7e554df911cc9a3482b99632b4

But I understand you plan to do that as soon as the ACME drivers have been
accepted.

Or a tarball is even better. If you can convince upstream to create a release?

Same for the other packages of course.

package/sigrok/libserialport/libserialport.mk line 8

Quoted 1 line
package/sigrok/libserialport/libserialport.mk new file +1 -0
+LIBSERIALPORT_SITE = git://sigrok.org/libserialport

If http is possible, that is preferable, because not all company firewalls
allow git to pass.

package/sigrok/libserialport/libserialport.mk line 11

Quoted 3 lines
package/sigrok/libserialport/libserialport.mk new file +3 -0
+LIBSERIALPORT_LICENSE = LGPLv3+
+LIBSERIALPORT_LICENSE_FILES = COPYING
+LIBSERIALPORT_AUTORECONF = YES

We usually but a comment why autoreconf is needed:

# git checkout has no configure script

package/sigrok/libserialport/libserialport.mk line 13

Quoted 2 lines
package/sigrok/libserialport/libserialport.mk new file +2 -0
+LIBSERIALPORT_INSTALL_STAGING = YES
+LIBSERIALPORT_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

Hm. I like it when code duplication is avoided, but for e.g. phpize we do
duplicate it. Not sure...

Quoted 12 lines
package/sigrok/libserialport/libserialport.mk new file +2 -0
+
+$(eval $(autotools-package))
package/sigrok/libsigrok/libsigrok.mk new file +4 -0
new file mode 100644
index 0000000..4a61f6c
@@ -0,0 +1,16 @@
+################################################################################
+#
+# libsigrok
+#

package/sigrok/libsigrok/libsigrok.mk line 14

Quoted 10 lines
package/sigrok/libsigrok/libsigrok.mk new file +10 -0
+################################################################################
+
+LIBSIGROK_VERSION = HEAD
+LIBSIGROK_SITE = git://sigrok.org/libsigrok
+LIBSIGROK_LICENSE = GPLv3+
+LIBSIGROK_LICENSE = COPYING
+LIBSIGROK_AUTORECONF = YES
+LIBSIGROK_INSTALL_STAGING = YES
+LIBSIGROK_DEPENDENCIES = libglib2 libzip
+LIBSIGROK_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

I see a lot of optional dependencies here. We prefer to handle them explicitly,
either disabling them:

LIBSIGROK_CONF_OPTS = \
	--disable-libftdi \
	--disable-libusb \
	--disable-bindings

or handling them:

ifeq ($(BR2_PACKAGE_LIBFTDI),y)
LIBSIGROK_CONF_OPTS += --enable-libftdi
LIBSIGROK_DEPENDENCIES += libftdi
else
LIBSIGROK_CONF_OPTS += --disable-libftdi
endif

This makes sure that the build result is the same regardless of the order in
which things are built.

Note that there is also an optional dependency on glibmm, but it can't be
disabled. This should be handled like this:

ifeq ($(BR2_PACKAGE_GLIBMM),y)
LIBSIGROK_DEPENDENCIES += glibmm
endif

Same for python-gobject.

Check configure.ac for more.

Quoted 2 lines
package/sigrok/libsigrok/libsigrok.mk new file +2 -0
+
+$(eval $(autotools-package))

[snip]

Quoted 8 lines
package/sigrok/sigrokcli/sigrokcli.mk new file +2 -0
new file mode 100644
index 0000000..3d984ef
@@ -0,0 +1,14 @@
+################################################################################
+#

package/sigrok/sigrokcli/sigrokcli.mk line 12

Quoted 10 lines
package/sigrok/sigrokcli/sigrokcli.mk new file +10 -0
+# sigrok-cli
+#
+################################################################################
+
+SIGROKCLI_VERSION = HEAD
+SIGROKCLI_SITE = git://sigrok.org/sigrok-cli
+SIGROKCLI_LICENSE = GPLv3+
+SIGROKCLI_LICENSE_FILES = COPYING
+SIGROKCLI_AUTORECONF = YES
+SIGROKCLI_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

The optional dependency on libsigrokdecode should definitely be handled here.

Regards,
Arnout

Quoted 3 lines
package/sigrok/sigrokcli/sigrokcli.mk new file +2 -0
+
+$(eval $(autotools-package))
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH 2/2 sigrok: new package

2015-01-29 0:32 GMT+01:00 Arnout Vandecappelle <[email protected]>:

Quoted 230 lines

Hi Bartosz,

Thanks for your contribution. I haven't tested this one yet, but I have some
remarks.

Quoted 1 line · Bartosz Golaszewski

Add sigrok libraries and sigrok-cli executable in a single package.

Is there a good reason to put everything in a single package? We normally make
separate packages for everything. We also don't like putting things in a subdirectory very much. So I'd expect three separate packages:

package/libserialport
package/libsigrok
package/libsigrokdecode
package/sigrok-cli

The first three would go in the Libraries -> Hardware Handling menu, while the
cli would go in the Packages -> Hardware Handling menu.

Quoted 36 lines
---
 package/Config.in                                 |  1 +
 package/sigrok/Config.in                          | 37 +++++++++++++++++++++++
 package/sigrok/libserialport/libserialport.mk     | 15 +++++++++
 package/sigrok/libsigrok/libsigrok.mk             | 16 ++++++++++
 package/sigrok/libsigrokdecode/libsigrokdecode.mk | 16 ++++++++++
 package/sigrok/sigrok.mk                          | 10 ++++++
 package/sigrok/sigrokcli/sigrokcli.mk             | 14 +++++++++
 7 files changed, 109 insertions(+)
 create mode 100644 package/sigrok/Config.in
 create mode 100644 package/sigrok/libserialport/libserialport.mk
 create mode 100644 package/sigrok/libsigrok/libsigrok.mk
 create mode 100644 package/sigrok/libsigrokdecode/libsigrokdecode.mk
 create mode 100644 package/sigrok/sigrok.mk
 create mode 100644 package/sigrok/sigrokcli/sigrokcli.mk
package/Config.in +1 -0
index 2d0adac..fe2f417 100644
@@ -364,6 +364,7 @@ endif
      source "package/sdparm/Config.in"
      source "package/setserial/Config.in"
      source "package/sg3_utils/Config.in"
+     source "package/sigrok/Config.in"
      source "package/sispmctl/Config.in"
      source "package/smartmontools/Config.in"
      source "package/smstools3/Config.in"
package/sigrok/Config.in new file +0 -0
new file mode 100644
index 0000000..f5f52ce

package/sigrok/Config.in line 8

Quoted 8 lines
package/sigrok/Config.in new file +8 -0
@@ -0,0 +1,37 @@
+config BR2_PACKAGE_SIGROK
+     bool "sigrok"
+     select BR2_PACKAGE_LIBSERIALPORT
+     select BR2_PACKAGE_LIBSIGROK
+     select BR2_PACKAGE_LIBSIGROKDECODE
+     select BR2_PACKAGE_SIGROKCLI
+     # libglib2 & python3:
+     depends on BR2_USE_WCHAR

We usually put something like:

        depends on BR2_USE_WCHAR # libsigrok->libglib2, libsigrokdecode->python3
Quoted 35 lines
package/sigrok/Config.in new file +29 -0
+     depends on BR2_TOOLCHAIN_HAS_THREADS
+     depends on BR2_USE_MMU
+     help
+       Signal analysis software suite.
+
+       This package contains the sigrok software suite: libserialport,
+       libsigrok, libsigrokdecode libraries and sigrok-cli command-line
+       utility.
+
+       http://sigrok.org/
+
+comment "sigrok needs a toolchain w/ wchar, threads
+     depends on BR2_USE_MMU
+     depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_LIBSERIALPORT
+     bool
+
+config BR2_PACKAGE_LIBSIGROK
+     bool
+     select BR2_PACKAGE_LIBGLIB2
+     select BR2_PACKAGE_LIBZIP
+
+config BR2_PACKAGE_LIBSIGROKDECODE
+     bool
+     select BR2_PACKAGE_PYTHON3
+
+config BR2_PACKAGE_SIGROKCLI
+     bool
package/sigrok/libserialport/libserialport.mk new file +0 -0
new file mode 100644
index 0000000..970e1c1

package/sigrok/libserialport/libserialport.mk line 7

Quoted 7 lines
package/sigrok/libserialport/libserialport.mk new file +7 -0
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libserialport
+#
+################################################################################
+
+LIBSERIALPORT_VERSION = HEAD

We want a specific version so the build is reproducible. Preferably a tag, but
in this case I guess it would be a full commit ID:
e31f2c6b8b8f2b7e554df911cc9a3482b99632b4

But I understand you plan to do that as soon as the ACME drivers have been
accepted.

Or a tarball is even better. If you can convince upstream to create a release?

Same for the other packages of course.

package/sigrok/libserialport/libserialport.mk line 8

Quoted 1 line
package/sigrok/libserialport/libserialport.mk new file +1 -0
+LIBSERIALPORT_SITE = git://sigrok.org/libserialport

If http is possible, that is preferable, because not all company firewalls
allow git to pass.

package/sigrok/libserialport/libserialport.mk line 11

Quoted 3 lines
package/sigrok/libserialport/libserialport.mk new file +3 -0
+LIBSERIALPORT_LICENSE = LGPLv3+
+LIBSERIALPORT_LICENSE_FILES = COPYING
+LIBSERIALPORT_AUTORECONF = YES

We usually but a comment why autoreconf is needed:

# git checkout has no configure script

package/sigrok/libserialport/libserialport.mk line 13

Quoted 2 lines
package/sigrok/libserialport/libserialport.mk new file +2 -0
+LIBSERIALPORT_INSTALL_STAGING = YES
+LIBSERIALPORT_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

Hm. I like it when code duplication is avoided, but for e.g. phpize we do
duplicate it. Not sure...

Quoted 12 lines
package/sigrok/libserialport/libserialport.mk new file +2 -0
+
+$(eval $(autotools-package))
package/sigrok/libsigrok/libsigrok.mk new file +4 -0
new file mode 100644
index 0000000..4a61f6c
@@ -0,0 +1,16 @@
+################################################################################
+#
+# libsigrok
+#

package/sigrok/libsigrok/libsigrok.mk line 14

Quoted 10 lines
package/sigrok/libsigrok/libsigrok.mk new file +10 -0
+################################################################################
+
+LIBSIGROK_VERSION = HEAD
+LIBSIGROK_SITE = git://sigrok.org/libsigrok
+LIBSIGROK_LICENSE = GPLv3+
+LIBSIGROK_LICENSE = COPYING
+LIBSIGROK_AUTORECONF = YES
+LIBSIGROK_INSTALL_STAGING = YES
+LIBSIGROK_DEPENDENCIES = libglib2 libzip
+LIBSIGROK_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

I see a lot of optional dependencies here. We prefer to handle them explicitly,
either disabling them:

LIBSIGROK_CONF_OPTS = \
        --disable-libftdi \
        --disable-libusb \
        --disable-bindings

or handling them:

ifeq ($(BR2_PACKAGE_LIBFTDI),y)
LIBSIGROK_CONF_OPTS += --enable-libftdi
LIBSIGROK_DEPENDENCIES += libftdi
else
LIBSIGROK_CONF_OPTS += --disable-libftdi
endif

This makes sure that the build result is the same regardless of the order in
which things are built.

Note that there is also an optional dependency on glibmm, but it can't be
disabled. This should be handled like this:

ifeq ($(BR2_PACKAGE_GLIBMM),y)
LIBSIGROK_DEPENDENCIES += glibmm
endif

Same for python-gobject.

Check configure.ac for more.

Quoted 2 lines
package/sigrok/libsigrok/libsigrok.mk new file +2 -0
+
+$(eval $(autotools-package))

[snip]

Quoted 8 lines
package/sigrok/sigrokcli/sigrokcli.mk new file +2 -0
new file mode 100644
index 0000000..3d984ef
@@ -0,0 +1,14 @@
+################################################################################
+#

package/sigrok/sigrokcli/sigrokcli.mk line 12

Quoted 10 lines
package/sigrok/sigrokcli/sigrokcli.mk new file +10 -0
+# sigrok-cli
+#
+################################################################################
+
+SIGROKCLI_VERSION = HEAD
+SIGROKCLI_SITE = git://sigrok.org/sigrok-cli
+SIGROKCLI_LICENSE = GPLv3+
+SIGROKCLI_LICENSE_FILES = COPYING
+SIGROKCLI_AUTORECONF = YES
+SIGROKCLI_PRE_CONFIGURE_HOOKS += SIGROK_ADD_MISSING

The optional dependency on libsigrokdecode should definitely be handled here.

Quoted 2 lines

Regards,
Arnout

Hi Arnout,

thanks for the review! Please check the updated version I've just submitted. Tested on a BeagleBone Black.

Bart