[v7,3/5] package/isocline: new package

Message ID 20261125161404.859000-4-dario.binacchi@amarulasolutions.com
State New
Headers
Series package: add CANopenterm and dependencies |

Commit Message

Dario Binacchi Nov. 25, 2026, 4:14 p.m. UTC
Isocline is a pure C library that can be used as an alternative to the
GNU readline library.

Project page: https://github.com/daanx/isocline

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...nly-require-CXX-compiler-when-needed.patch | 55 +++++++++++++++++++
 package/isocline/Config.in                    | 13 +++++
 package/isocline/isocline.hash                |  3 +
 package/isocline/isocline.mk                  | 14 +++++
 6 files changed, 87 insertions(+)
 create mode 100644 package/isocline/0001-Only-require-CXX-compiler-when-needed.patch
 create mode 100644 package/isocline/Config.in
 create mode 100644 package/isocline/isocline.hash
 create mode 100644 package/isocline/isocline.mk

-- 
2.43.0
  

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 59fad7f26bbf..b98c85996f97 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -834,6 +834,7 @@  F:	package/drogon/
 F:	package/empty/
 F:	package/iana-assignments/
 F:	package/inih/
+F:	package/isocline/
 F:	package/less/
 F:	package/libgphoto2/
 F:	package/pocketpy/
diff --git a/package/Config.in b/package/Config.in
index 49659b007e36..03267168a667 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2351,6 +2351,7 @@  menu "Text and terminal handling"
 	source "package/icu/Config.in"
 	source "package/inih/Config.in"
 	source "package/iniparser/Config.in"
+	source "package/isocline/Config.in"
 	source "package/libcli/Config.in"
 	source "package/libecoli/Config.in"
 	source "package/libedit/Config.in"
diff --git a/package/isocline/0001-Only-require-CXX-compiler-when-needed.patch b/package/isocline/0001-Only-require-CXX-compiler-when-needed.patch
new file mode 100644
index 000000000000..ddc150b42136
--- /dev/null
+++ b/package/isocline/0001-Only-require-CXX-compiler-when-needed.patch
@@ -0,0 +1,55 @@ 
+From a811b3dc38d296b5e4dc76ab2b932cf196795d47 Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Date: Sat, 22 Aug 2026 16:58:05 +0200
+Subject: [PATCH] Only require CXX compiler when needed
+
+isocline is a pure C library and only requires a C++ compiler when
+IC_USE_CXX=ON.
+
+Unconditionally enabling CXX in project() makes the configure step fail
+for C-only toolchains. This was exposed while integrating isocline into
+Buildroot by running:
+
+  $ utils/test-pkg -p isocline -T br-arm-basic
+
+which fails during the CMake configure step with:
+
+  -- Check for working CXX compiler: /bin/false - broken
+  CMake Error at CMakeTestCXXCompiler.cmake:60 (message):
+    The C++ compiler "/bin/false" is not able to compile a simple test
+    program.
+  Call Stack (most recent call first):
+    CMakeLists.txt:5 (project)
+
+Do not enable CXX in project() unless IC_USE_CXX=ON.
+
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Upstream: https://github.com/daanx/isocline/pull/54
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 11aff09bba58..a679098c97f7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,7 +2,7 @@
+ # Copyright (c) 2021, Daan Leijen
+ # -----------------------------------------------------------------------------
+ cmake_minimum_required(VERSION 3.10)
+-project(libisocline C CXX ASM)
++project(libisocline C ASM)
+ 
+ set(CMAKE_C_STANDARD   99)
+ set(CMAKE_CXX_STANDARD 11)
+@@ -44,6 +44,7 @@ if(IC_SEPARATE_OBJS)
+ endif()
+ 
+ if(IC_USE_CXX)
++  enable_language(CXX)
+   set(IC_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
+   set_source_files_properties(${ic_sources}         PROPERTIES LANGUAGE CXX )
+   set_source_files_properties(${ic_example_sources} PROPERTIES LANGUAGE CXX )
+-- 
+2.43.0
+
diff --git a/package/isocline/Config.in b/package/isocline/Config.in
new file mode 100644
index 000000000000..02684f12dcdb
--- /dev/null
+++ b/package/isocline/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_ISOCLINE
+	bool "isocline"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Isocline is a pure C library that can be used as an
+	  alternative to the GNU readline library. It provides
+	  multi-line editing, history, completion and syntax
+	  highlighting.
+
+	  https://github.com/daanx/isocline
+
+comment "isocline needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
diff --git a/package/isocline/isocline.hash b/package/isocline/isocline.hash
new file mode 100644
index 000000000000..dd77b4cbd4ff
--- /dev/null
+++ b/package/isocline/isocline.hash
@@ -0,0 +1,3 @@ 
+# Locally computed
+sha256  1e5f0efa2b719c3e1d292f501e5329e141a039deefc801099f8bbb9a50255531  isocline-1.1.0.tar.gz
+sha256  60c6b0415a2e0afa8e65630a980b64b4df09cde910e44481a1b0946ebfc840e4  LICENSE
diff --git a/package/isocline/isocline.mk b/package/isocline/isocline.mk
new file mode 100644
index 000000000000..bc5127d1d4c8
--- /dev/null
+++ b/package/isocline/isocline.mk
@@ -0,0 +1,14 @@ 
+################################################################################
+#
+# isocline
+#
+################################################################################
+
+ISOCLINE_VERSION = 1.1.0
+ISOCLINE_SITE = $(call github,daanx,isocline,v$(ISOCLINE_VERSION))
+ISOCLINE_LICENSE = MIT
+ISOCLINE_LICENSE_FILES = LICENSE
+ISOCLINE_INSTALL_STAGING = YES
+ISOCLINE_CONF_OPTS = -DIC_BUILD_TESTS=OFF
+
+$(eval $(cmake-package))