Skip to contentSkip to conversation

package/log4qt: new package

PATCH Superseded Bartosz Bilas 2 participants 3 messages Feb 17, 2021 – Mar 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/log4qt: new package

Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the Qt Framework.

---
Changes v2 -> v3:
- use cmake pkg infra
- rework database logging support

Changes v1 -> v2:
- bump version to 1.5.1
- use qmake pkg infra
- propagate dependencies from qt5 package
- improve commit message

 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/log4qt/Config.in   | 19 +++++++++++++++++++
 package/log4qt/log4qt.hash |  3 +++
 package/log4qt/log4qt.mk   | 23 +++++++++++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 package/log4qt/Config.in
 create mode 100644 package/log4qt/log4qt.hash
 create mode 100644 package/log4qt/log4qt.mk
DEVELOPERS +1 -0
index 12e1f83cf7..3f122d436b 100644
@@ -261,6 +261,7 @@ F:	package/python-canopen/
 N:	Bartosz Bilas <[email protected]>
 F:	board/stmicroelectronics/stm32mp157a-dk1/
 F:	configs/stm32mp157a_dk1_defconfig
+F:	package/log4qt/
 F:	package/python-esptool/
 F:	package/python-pyaes/
 F:	package/ttyd/
package/Config.in +1 -0
index 5304ab141c..54102e0509 100644
@@ -1659,6 +1659,7 @@ menu "Logging"
 	source "package/log4cplus/Config.in"
 	source "package/log4cpp/Config.in"
 	source "package/log4cxx/Config.in"
+	source "package/log4qt/Config.in"
 	source "package/opentracing-cpp/Config.in"
 	source "package/spdlog/Config.in"
 	source "package/zlog/Config.in"
package/log4qt/Config.in new file +19 -0
new file mode 100644
index 0000000000..1b716bbc51
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_LOG4QT
+	bool "log4qt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_QT5
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # c++11 qt5base
+	depends on !BR2_STATIC_LIBS
+	help
+	  Log4Qt is a C++ port of the Apache Software Foundation
+	  Log4j package using the Qt Framework. It is intended to be
+	  used by open source and commercial Qt projects.
+
+	  https://github.com/MEONMedical/Log4Qt
+
+comment "Log4Qt needs qt5, a toolchain w/ gcc >= 5.0, wchar, NPTL, C++, dynamic library"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_PACKAGE_QT5
package/log4qt/log4qt.hash new file +3 -0
new file mode 100644
index 0000000000..757bab1a25
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  ff17b794ca7d5290a150a53f6272e6a30a7f4d942aa58298a8328bf10a65858a  log4qt-1.5.1.tar.gz
+sha256  c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08  LICENSE
package/log4qt/log4qt.mk new file +23 -0
new file mode 100644
index 0000000000..57bf5c9ab0
@@ -0,0 +1,23 @@
+################################################################################
+#
+# log4qt
+#
+################################################################################
+
+LOG4QT_VERSION = 1.5.1
+LOG4QT_SITE = $(call github,MEONMedical,Log4Qt,v$(LOG4QT_VERSION))
+LOG4QT_DEPENDENCIES += qt5base
+LOG4QT_LICENSE = Apache-2.0
+LOG4QT_LICENSE_FILES = LICENSE
+LOG4QT_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_QT5BASE_SQLITE_QT),y)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+else ifeq ($(BR2_PACKAGE_SQLITE)$(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),yy)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+LOG4QT_DEPENDENCIES += sqlite
+else
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=OFF
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.30.1
#1 lore raw

PATCH v3 1/1 package/log4qt: new package

Hello,

Quoted 4 lines · On Wed, 17 Feb 2021 20:49:59 +0100 Bartosz Bilas <[email protected]>…

Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the Qt Framework.

Thanks for this contribution! I have applied, with a number of changes. See below.

Quoted 4 lines

Changes v1 -> v2:
- bump version to 1.5.1
- use qmake pkg infra
- propagate dependencies from qt5 package

Actually, this was not needed. Propagating "depends on" is needed if you "select" something. But if you "depends on" that something, then it's not needed.

Quoted 6 lines
package/log4qt/Config.in new file +0 -0
new file mode 100644
index 0000000000..1b716bbc51

package/log4qt/Config.in line 8

Quoted 8 lines
package/log4qt/Config.in new file +8 -0
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_LOG4QT
+	bool "log4qt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_QT5
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # c++11 qt5base
+	depends on !BR2_STATIC_LIBS

So I simplified all of this to just:

depends on BR2_PACKAGE_QT5

package/log4qt/Config.in line 19

Quoted 4 lines
package/log4qt/Config.in new file +4 -0
+comment "Log4Qt needs qt5, a toolchain w/ gcc >= 5.0, wchar, NPTL, C++, dynamic library"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_PACKAGE_QT5

And simplified that as well.

package/log4qt/Config.in

Quoted 12 lines
package/log4qt/Config.in new file +12 -0
+LOG4QT_VERSION = 1.5.1
+LOG4QT_SITE = $(call github,MEONMedical,Log4Qt,v$(LOG4QT_VERSION))
+LOG4QT_DEPENDENCIES += qt5base
+LOG4QT_LICENSE = Apache-2.0
+LOG4QT_LICENSE_FILES = LICENSE
+LOG4QT_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_QT5BASE_SQLITE_QT),y)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+else ifeq ($(BR2_PACKAGE_SQLITE)$(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),yy)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+LOG4QT_DEPENDENCIES += sqlite

This dance was not needed. If BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM=y then you know that Qt5 has been built with SQLite support.

So, I simplified this to:

ifeq ($(BR2_PACKAGE_QT5BASE_SQLITE_QT)$(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),y) LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
else
LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=OFF
endif

I'm curious though: is this DB_LOGGING feature only supported with the Sqlite DB backend of Qt, or would it also work with other DB backends ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v3 1/1 package/log4qt: new package

Hello Thomas,

Quoted 12 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · On Wed, 17 Feb 2021 20:49:59 +0100 Bartosz Bilas <[email protected]>…

Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the Qt Framework.

Thanks for this contribution! I have applied, with a number of changes. See below.

Quoted 7 lines
Quoted 4 lines

Changes v1 -> v2:
- bump version to 1.5.1
- use qmake pkg infra
- propagate dependencies from qt5 package

Actually, this was not needed. Propagating "depends on" is needed if you "select" something. But if you "depends on" that something, then it's not needed.

Oh, good to know - I'll keep it in my mind for the future :)

Quoted 39 lines
Quoted 6 lines
package/log4qt/Config.in new file +0 -0
new file mode 100644
index 0000000000..1b716bbc51

package/log4qt/Config.in line 8

Quoted 8 lines
package/log4qt/Config.in new file +8 -0
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_LOG4QT
+	bool "log4qt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_QT5
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # c++11 qt5base
+	depends on !BR2_STATIC_LIBS

So I simplified all of this to just:

depends on BR2_PACKAGE_QT5

package/log4qt/Config.in line 19

Quoted 4 lines
package/log4qt/Config.in new file +4 -0
+comment "Log4Qt needs qt5, a toolchain w/ gcc >= 5.0, wchar, NPTL, C++, dynamic library"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_PACKAGE_QT5

And simplified that as well.

package/log4qt/Config.in

Quoted 12 lines
package/log4qt/Config.in new file +12 -0
+LOG4QT_VERSION = 1.5.1
+LOG4QT_SITE = $(call github,MEONMedical,Log4Qt,v$(LOG4QT_VERSION))
+LOG4QT_DEPENDENCIES += qt5base
+LOG4QT_LICENSE = Apache-2.0
+LOG4QT_LICENSE_FILES = LICENSE
+LOG4QT_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_QT5BASE_SQLITE_QT),y)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+else ifeq ($(BR2_PACKAGE_SQLITE)$(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),yy)
+LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
+LOG4QT_DEPENDENCIES += sqlite

This dance was not needed. If BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM=y then you know that Qt5 has been built with SQLite support.

Quoted 7 lines

So, I simplified this to:

ifeq ($(BR2_PACKAGE_QT5BASE_SQLITE_QT)$(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),y) LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=ON
else
LOG4QT_CONF_OPTS += -DBUILD_WITH_DB_LOGGING=OFF
endif

That looks nicer than my idea.

Quoted 3 lines

I'm curious though: is this DB_LOGGING feature only supported with the Sqlite DB backend of Qt, or would it also work with other DB backends ?

As far as I know and what I've actually used in my projects is sqlite backend only but I'm not up to date with the upstream so I can be outdated ;)

Quoted 4 lines

Thanks!

Thomas

Best
Bartek