package/canopenterm: new package
PATCH v5 1/1 package/canopenterm: new package
CANopenTerm is an open-source tool for developing, testing, and analyzing CANopen CC networks and devices. It provides a technical, no-nonsense solution for professionals working with CAN CC-based networks. Additionally, it supports SAE J1939 and OBD-II protocols, making it versatile for various applications.
Version v1.0.10 was chosen because it is the last one requiring SDL2. Indeed version v1.0.11 depends on SDL3.
Tested on STM32MP257F-EV1
---
Changes v4 -> v5:
- Drop patch 1/2 "package/pocketpy: new package" from the series
because already merged.
- Change 'Upstream:' reference in the 0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch. The patch is now merged.
- Use 'depends on BR2_PACKAGE_LUA' instead of select in Config.in
Changes v2 -> v3:
- Replace depends on with select in Config.in
- Add required depends on based on the depends on of the packages selected.
- Drop CMAKE_VERBOSE_MAKEFILE annd CMAKE_FIND_DEBUG_MODE from canopenterm.mk
DEVELOPERS | 1 + package/Config.in | 1 + ...allation-when-BUILD_YOCTO-is-enabled.patch | 39 +++++++++++++++++++ package/canopenterm/Config.in | 17 ++++++++ package/canopenterm/canopenterm.hash | 3 ++ package/canopenterm/canopenterm.mk | 15 +++++++ 6 files changed, 76 insertions(+) create mode 100644 package/canopenterm/0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch create mode 100644 package/canopenterm/Config.in create mode 100644 package/canopenterm/canopenterm.hash create mode 100644 package/canopenterm/canopenterm.mk
DEVELOPERS +1 -0
@@ -808,6 +808,7 @@ F: configs/stm32f769_disco_sd_defconfig F: package/aespipe/ F: package/armadillo/ F: package/babeld/ +F: package/canopenterm/ F: package/iana-assignments/ F: package/inih/ F: package/pocketpy/
package/Config.in +1 -0
@@ -2469,6 +2469,7 @@ endif source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/cannelloni/Config.in" + source "package/canopenterm/Config.in" source "package/casync/Config.in" source "package/casync-nano/Config.in" source "package/cfm/Config.in"
package/canopenterm/0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch new file +39 -0
@@ -0,0 +1,39 @@ +From fc150187a2e2ce777e757405eb1d67235fc68d75 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi <[email protected]> +Date: Thu, 8 May 2025 15:24:38 +0200 +Subject: [PATCH] Fix exe installation when BUILD_YOCTO is enabled + +While building CanopenTerm in Buildroot, with the BUILD_YOCTO option +enabled (yes, really :)), the following error is raised: + +CMake Error at output/build/canopenterm-1.0.10/cmake_install.cmake:114 (file): + file INSTALL cannot find + "buildroot/output/build/canopenterm-1.0.10/CANopenTerm": + No such file or directory. + +Signed-off-by: Dario Binacchi <[email protected]> +Upstream: https://github.com/CANopenTerm/CANopenTerm/commit/fc150187a2e2ce777e757405eb1d67235fc68d75 +--- + cmake/os_linux.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cmake/os_linux.cmake b/cmake/os_linux.cmake +index 7c1f8185b2a2..f149bd03fe92 100644 +--- a/cmake/os_linux.cmake ++++ b/cmake/os_linux.cmake +@@ -104,10 +104,10 @@ if (BUILD_YOCTO) + DESTINATION /usr/share/CANopenTerm/scripts/utils + FILES_MATCHING PATTERN "*") + +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/CANopenTerm ++ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/export/CANopenTerm + DESTINATION /usr/bin) + +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/codb2json ++ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/export/codb2json + DESTINATION /usr/bin) + + return() +-- +2.43.0 +
package/canopenterm/Config.in new file +17 -0
@@ -0,0 +1,17 @@ +config BR2_PACKAGE_CANOPENTERM + bool "canopenterm" + depends on BR2_INSTALL_LIBSTDCPP # pocketpy + depends on BR2_PACKAGE_LUA + depends on !BR2_STATIC_LIBS # pocketpy and SDL2 + select BR2_PACKAGE_CJSON + select BR2_PACKAGE_INIH + select BR2_PACKAGE_LIBSOCKETCAN + select BR2_PACKAGE_POCKETPY + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_SDL2 + help + CANopenTerm is an open-source tool for developing, + testing, and analyzing CANopen CC networks and + devices. + + https://github.com/CANopenTerm/CANopenTerm
package/canopenterm/canopenterm.hash new file +3 -0
@@ -0,0 +1,3 @@ +# locally computed +sha256 9de6f472b749f08a5ea9a836604507cd56c71f818a4141a2b989423fbb7beb80 canopenterm-1.0.10.tar.gz +sha256 cc555368040b92e77b14289b367ccbebf88344367188862680d40cc885636d3a LICENSE.md
package/canopenterm/canopenterm.mk new file +15 -0
@@ -0,0 +1,15 @@ +################################################################################ +# +# canopenterm +# +################################################################################ + +CANOPENTERM_VERSION = 1.0.10 +CANOPENTERM_SITE = $(call github,CANopenTerm,CANopenTerm,v$(CANOPENTERM_VERSION)) +CANOPENTERM_LICENSE = MIT +CANOPENTERM_LICENSE_FILES = LICENSE.md +CANOPENTERM_DEPENDENCIES = cjson inih libsocketcan lua pocketpy readline sdl2 + +CANOPENTERM_CONF_OPTS = -DBUILD_YOCTO=ON + +$(eval $(cmake-package))
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi all,
just a gentle ping regarding this patch.
It has not received any feedback so far, and I’d really appreciate a review when you have a chance.
Thanks a lot for your time.
Best regards,
Dario
Quoted 167 lines · Dario Binacchi
CANopenTerm is an open-source tool for developing, testing, and analyzing CANopen CC networks and devices. It provides a technical, no-nonsense solution for professionals working with CAN CC-based networks. Additionally, it supports SAE J1939 and OBD-II protocols, making it versatile for various applications.
Version v1.0.10 was chosen because it is the last one requiring SDL2. Indeed version v1.0.11 depends on SDL3.
Tested on STM32MP257F-EV1
Signed-off-by Dario Binacchi <[email protected]>---
Changes v4 -> v5:
- Drop patch 1/2 "package/pocketpy: new package" from the series
because already merged.
- Change 'Upstream:' reference in the 0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch. The patch is now merged.
- Use 'depends onBR2_PACKAGE_LUA' instead of select in Config.inChanges v2 -> v3:
- Replace depends on with select in Config.in
- Add required depends on based on the depends on of the packages selected.
- DropCMAKE_VERBOSE_MAKEFILEanndCMAKE_FIND_DEBUG_MODEfrom canopenterm.mkDEVELOPERS | 1 + package/Config.in | 1 + ...allation-when-BUILD_YOCTO-is-enabled.patch | 39 +++++++++++++++++++ package/canopenterm/Config.in | 17 ++++++++ package/canopenterm/canopenterm.hash | 3 ++ package/canopenterm/canopenterm.mk | 15 +++++++ 6 files changed, 76 insertions(+) create mode 100644 package/canopenterm/0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch create mode 100644 package/canopenterm/Config.in create mode 100644 package/canopenterm/canopenterm.hash create mode 100644 package/canopenterm/canopenterm.mkDEVELOPERS +1
-0@@ -808,6 +808,7 @@ F: configs/stm32f769_disco_sd_defconfig F: package/aespipe/ F: package/armadillo/ F: package/babeld/ +F: package/canopenterm/ F: package/iana-assignments/ F: package/inih/ F: package/pocketpy/package/Config.in +1
-0@@ -2469,6 +2469,7 @@ endif source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/cannelloni/Config.in" + source "package/canopenterm/Config.in" source "package/casync/Config.in" source "package/casync-nano/Config.in" source "package/cfm/Config.in"package/canopenterm/0001-Fix-exe-installation-when-BUILD_YOCTO-is-enabled.patch new file +39
-0@@ -0,0 +1,39 @@ +From fc150187a2e2ce777e757405eb1d67235fc68d75 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi <[email protected]> +Date: Thu, 8 May 2025 15:24:38 +0200 +Subject: [PATCH] Fix exe installation when BUILD_YOCTO is enabled + +While building CanopenTerm in Buildroot, with the BUILD_YOCTO option +enabled (yes, really :)), the following error is raised: + +CMake Error at output/build/canopenterm-1.0.10/cmake_install.cmake:114 (file): + file INSTALL cannot find + "buildroot/output/build/canopenterm-1.0.10/CANopenTerm": + No such file or directory. + +Signed-off-by: Dario Binacchi <[email protected]> +Upstream: https://github.com/CANopenTerm/CANopenTerm/commit/fc150187a2e2ce777e757405eb1d67235fc68d75 +--- + cmake/os_linux.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cmake/os_linux.cmake b/cmake/os_linux.cmake +index 7c1f8185b2a2..f149bd03fe92 100644 +--- a/cmake/os_linux.cmake ++++ b/cmake/os_linux.cmake +@@ -104,10 +104,10 @@ if (BUILD_YOCTO) + DESTINATION /usr/share/CANopenTerm/scripts/utils + FILES_MATCHING PATTERN "*") + +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/CANopenTerm ++ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/export/CANopenTerm + DESTINATION /usr/bin) + +- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/codb2json ++ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/export/codb2json + DESTINATION /usr/bin) + + return() +-- +2.43.0 +package/canopenterm/Config.in new file +17
-0@@ -0,0 +1,17 @@ +config BR2_PACKAGE_CANOPENTERM + bool "canopenterm" + depends on BR2_INSTALL_LIBSTDCPP # pocketpy + depends on BR2_PACKAGE_LUA + depends on !BR2_STATIC_LIBS # pocketpy and SDL2 + select BR2_PACKAGE_CJSON + select BR2_PACKAGE_INIH + select BR2_PACKAGE_LIBSOCKETCAN + select BR2_PACKAGE_POCKETPY + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_SDL2 + help + CANopenTerm is an open-source tool for developing, + testing, and analyzing CANopen CC networks and + devices. + + https://github.com/CANopenTerm/CANopenTermpackage/canopenterm/canopenterm.hash new file +3
-0@@ -0,0 +1,3 @@ +# locally computed +sha256 9de6f472b749f08a5ea9a836604507cd56c71f818a4141a2b989423fbb7beb80 canopenterm-1.0.10.tar.gz +sha256 cc555368040b92e77b14289b367ccbebf88344367188862680d40cc885636d3a LICENSE.mdpackage/canopenterm/canopenterm.mk new file +15
-1@@ -0,0 +1,15 @@ +################################################################################ +# +# canopenterm +# +################################################################################ + +CANOPENTERM_VERSION = 1.0.10 +CANOPENTERM_SITE = $(call github,CANopenTerm,CANopenTerm,v$(CANOPENTERM_VERSION)) +CANOPENTERM_LICENSE = MIT +CANOPENTERM_LICENSE_FILES = LICENSE.md +CANOPENTERM_DEPENDENCIES = cjson inih libsocketcan lua pocketpy readline sdl2 + +CANOPENTERM_CONF_OPTS = -DBUILD_YOCTO=ON + +$(eval $(cmake-package)) --2.43.0
Signature · 21 lines
Dario Binacchi Senior Embedded Linux Developer [email protected] __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 [email protected] www.amarulasolutions.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Dario,
Sorry for the very long delay in getting back to you.
Quoted 8 lines · On Mon, 7 Jul 2025 07:58:24 +0200 Dario Binacchi…
CANopenTerm is an open-source tool for developing, testing, and analyzing CANopen CC networks and devices. It provides a technical, no-nonsense solution for professionals working with CAN CC-based networks. Additionally, it supports SAE J1939 and OBD-II protocols, making it versatile for various applications.
Version v1.0.10 was chosen because it is the last one requiring SDL2. Indeed version v1.0.11 depends on SDL3.
This is unfortunately already a red flag. Merging a brand new package for which we from the start can't use the latest version because we're missing some dependencies to build the latest releases really isn't good. So we need to package SDL3.
BTW, it's weird that it *must* use SDL. This thing is a graphical application? Cannot be built as a command line tool?
package/canopenterm/Config.in line 4
Quoted 10 lines
package/canopenterm/Config.in new file +4
-0@@ -0,0 +1,17 @@ +config BR2_PACKAGE_CANOPENTERM + bool "canopenterm" + depends on BR2_INSTALL_LIBSTDCPP # pocketpy + depends on BR2_PACKAGE_LUA
Can you try using BR2_PACKAGE_HAS_LUAINTERPRETER instead, and check if it builds fine when luajit is selected as a Lua interpret?
package/canopenterm/Config.in line 5
Quoted 1 line
package/canopenterm/Config.in new file +1
-0+ depends on !BR2_STATIC_LIBS # pocketpy and SDL2
# pocketpy, sdl2
package/canopenterm/Config.in line 17
Quoted 12 lines
package/canopenterm/Config.in new file +12
-0+ select BR2_PACKAGE_CJSON + select BR2_PACKAGE_INIH + select BR2_PACKAGE_LIBSOCKETCAN + select BR2_PACKAGE_POCKETPY + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_SDL2 + help + CANopenTerm is an open-source tool for developing, + testing, and analyzing CANopen CC networks and + devices. + + https://github.com/CANopenTerm/CANopenTerm
Missing Config.in comment about the C++, dynamic library and lua dependencies.
package/canopenterm/Config.in
Quoted 7 lines
package/canopenterm/Config.in new file +7
-0+CANOPENTERM_VERSION = 1.0.10 +CANOPENTERM_SITE = $(call github,CANopenTerm,CANopenTerm,v$(CANOPENTERM_VERSION)) +CANOPENTERM_LICENSE = MIT +CANOPENTERM_LICENSE_FILES = LICENSE.md +CANOPENTERM_DEPENDENCIES = cjson inih libsocketcan lua pocketpy readline sdl2 + +CANOPENTERM_CONF_OPTS = -DBUILD_YOCTO=ON
If I understand correctly this BUILD_YOCTO=ON option is about asking the build system to use external libraries instead of bundled ones? If my understanding is correct, then a small comment about this line would be useful, as it's not quite obvious why it's called BUILD_YOCTO=ON.
Thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot