Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rlwrap: new package
@ 2024-01-26  2:49 Matt Silva
  2024-02-06  9:44 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Silva @ 2024-01-26  2:49 UTC (permalink / raw)
  To: buildroot; +Cc: Matt Silva, Thomas Petazzoni

Signed-off-by: Matt Silva <dev@matt-silva.com>
---
 package/Config.in          |  1 +
 package/rlwrap/Config.in   | 58 ++++++++++++++++++++++++++++++++++++++
 package/rlwrap/rlwrap.hash |  6 ++++
 package/rlwrap/rlwrap.mk   | 48 +++++++++++++++++++++++++++++++
 4 files changed, 113 insertions(+)
 create mode 100644 package/rlwrap/Config.in
 create mode 100644 package/rlwrap/rlwrap.hash
 create mode 100644 package/rlwrap/rlwrap.mk

diff --git a/package/Config.in b/package/Config.in
index 5b8b15fa54..0df3f49781 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2688,6 +2688,7 @@ comment "Utilities"
 	source "package/pinentry/Config.in"
 	source "package/qprint/Config.in"
 	source "package/ranger/Config.in"
+	source "package/rlwrap/Config.in"
 	source "package/rtty/Config.in"
 	source "package/screen/Config.in"
 	source "package/screenfetch/Config.in"
diff --git a/package/rlwrap/Config.in b/package/rlwrap/Config.in
new file mode 100644
index 0000000000..b4a7f7fe3e
--- /dev/null
+++ b/package/rlwrap/Config.in
@@ -0,0 +1,58 @@
+config BR2_PACKAGE_RLWRAP
+	bool "rlwrap"
+	select BR2_PACKAGE_READLINE
+	help
+	  rlwrap is a 'readline wrapper', a small utility that uses the
+	  GNU Readline library to allow the editing of keyboard input
+	  for any command.
+
+	  https://github.com/hanslub42/rlwrap
+
+if BR2_PACKAGE_RLWRAP
+
+config BR2_PACKAGE_RLWRAP_SPY_ON_READLINE
+	bool "spy on readline"
+	default y
+	help
+	  If we want to keep the display tidy when re-sizing the
+	  terminal window or printing multi-line prompts, we have to
+	  know whether or not readline is in horizontal-scroll-mode
+	  (i.e. wheter long lines are scrolled or wrapped). At present,
+	  this involves a look at a private readline variable - if you
+	  feel guilty about that, disable this option
+
+config BR2_PACKAGE_RLWRAP_HOMEGROWN_REDISPLAY
+	bool "homegrown redisplay"
+	default n
+	help
+	  Some people report double echoing of user input. Enabling this
+	  option will cure the problem - though the display will then
+	  flicker over slow connections (cf. BUGS)
+
+config BR2_PACKAGE_RLWRAP_DEBUG
+	bool "enable debug"
+	default n
+	help
+	  Adds a --debug option to rlwrap's repertoire. This will make
+	  rlwrap write debug information to a file /tmp/rlwrap.debug
+	  (cf. the output of rlwrap --help for more info)
+
+config BR2_PACKAGE_RLWRAP_PROC_MOUNTPOINT
+	string "proc mountpoint"
+	default "/proc"
+	help
+	  Mountpoint for Linux-style procfs, used for determination of
+	  slave command's working directory
+
+config BR2_PACKAGE_RLWRAP_MULTIBYTE_AWARE
+	bool "multibyte awareness"
+	default y
+	depends on BR2_USE_WCHAR
+	help
+	  Prevent rlwrap from seeing multibyte characters as multiple
+	  characters
+
+comment "rlwrap multibyte awareness needs a toolchain w/ wchar"
+	depends on !BR2_USE_WCHAR
+
+endif
diff --git a/package/rlwrap/rlwrap.hash b/package/rlwrap/rlwrap.hash
new file mode 100644
index 0000000000..b7005e860e
--- /dev/null
+++ b/package/rlwrap/rlwrap.hash
@@ -0,0 +1,6 @@
+# from https://github.com/hanslub42/rlwrap/releases/tag/0.46.1
+sha256  2711986a1248f6ac59e2aecf5586205835970040d300a42b4bf8014397e73e37  rlwrap-0.46.1.tar.gz
+
+# license files, locally calculated
+sha256  656d25fab58016ac6ac11bb126709e4f860ea063d11795232eb55987172f78ff  AUTHORS
+sha256  32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670  COPYING
diff --git a/package/rlwrap/rlwrap.mk b/package/rlwrap/rlwrap.mk
new file mode 100644
index 0000000000..6f9de8281c
--- /dev/null
+++ b/package/rlwrap/rlwrap.mk
@@ -0,0 +1,48 @@
+################################################################################
+#
+# rlwrap
+#
+################################################################################
+
+# https://github.com/hanslub42/rlwrap/releases/download/0.46.1/rlwrap-0.46.1.tar.gz
+
+RLWRAP_VERSION = 0.46.1
+RLWRAP_SOURCE = rlwrap-$(RLWRAP_VERSION).tar.gz
+RLWRAP_SITE = https://github.com/hanslub42/rlwrap/releases/download/$(RLWRAP_VERSION)
+RLWRAP_LICENSE = GPL-2.0
+RLWRAP_LICENSE_FILES = AUTHORS COPYING
+
+RLWRAP_DEPENDENCIES = readline
+
+# --enable-spy-on-readline
+ifeq ($(BR2_PACKAGE_RLWRAP_SPY_ON_READLINE),y)
+RLWRAP_CONF_OPTS += --enable-spy-on-readline
+else
+RLWRAP_CONF_OPTS += --disable-spy-on-readline
+endif
+
+# --enable-homegrown-redisplay
+ifeq ($(BR2_PACKAGE_RLWRAP_HOMEGROWN_REDISPLAY),y)
+RLWRAP_CONF_OPTS += --enable-homegrown-redisplay
+else
+RLWRAP_CONF_OPTS += --disable-homegrown-redisplay
+endif
+
+# --enable-debug
+ifeq ($(BR2_PACKAGE_RLWRAP_DEBUG),y)
+RLWRAP_CONF_OPTS += --enable-debug
+else
+RLWRAP_CONF_OPTS += --disable-debug
+endif
+
+# --enable-proc-mountpoint
+RLWRAP_CONF_OPTS += --enable-proc-mountpoint=$(BR2_PACKAGE_RLWRAP_PROC_MOUNTPOINT)
+
+# --enable-multibyte-aware
+ifeq ($(BR2_PACKAGE_RLWRAP_MULTIBYTE_AWARE),y)
+RLWRAP_CONF_OPTS += --enable-multibyte-aware
+else
+RLWRAP_CONF_OPTS += --disable-multibyte-aware
+endif
+
+$(eval $(autotools-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/rlwrap: new package
  2024-01-26  2:49 [Buildroot] [PATCH 1/1] package/rlwrap: new package Matt Silva
@ 2024-02-06  9:44 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-02-06  9:44 UTC (permalink / raw)
  To: Matt Silva; +Cc: buildroot

Hello Matt,

On Thu, 25 Jan 2024 21:49:14 -0500
Matt Silva <dev@matt-silva.com> wrote:

> Signed-off-by: Matt Silva <dev@matt-silva.com>

Thanks a lot for your contribution! I applied your patch to our master
branch, after doing a number of changes, see below for the details.

>  package/Config.in          |  1 +
>  package/rlwrap/Config.in   | 58 ++++++++++++++++++++++++++++++++++++++
>  package/rlwrap/rlwrap.hash |  6 ++++
>  package/rlwrap/rlwrap.mk   | 48 +++++++++++++++++++++++++++++++
>  4 files changed, 113 insertions(+)

For all new packages, we require to have an entry in the DEVELOPERS
file, so that you get notified if there are build failures for this
package, or if the package needs to be update for security issues, or
when there's a new release upstream.

> +config BR2_PACKAGE_RLWRAP_DEBUG
> +	bool "enable debug"

This option is not needed, it should be controlled by
BR2_ENABLE_RUNTIME_DEBUG. Actually, I thought BR2_ENABLE_RUNTIME_DEBUG
was automatically passing --enable-debug to all packages, but it's not
the case. So if you care about debugging, we would need a follow-up
patch that passes --enable-debug when BR2_ENABLE_RUNTIME_DEBUG is set.

> +config BR2_PACKAGE_RLWRAP_PROC_MOUNTPOINT
> +	string "proc mountpoint"
> +	default "/proc"

This option is not needed: Buildroot will always mount proc in /proc,
and things will anyway break in all sorts of ways if proc is mounted
elsewhere.

> diff --git a/package/rlwrap/rlwrap.mk b/package/rlwrap/rlwrap.mk
> new file mode 100644
> index 0000000000..6f9de8281c
> --- /dev/null
> +++ b/package/rlwrap/rlwrap.mk
> @@ -0,0 +1,48 @@
> +################################################################################
> +#
> +# rlwrap
> +#
> +################################################################################
> +
> +# https://github.com/hanslub42/rlwrap/releases/download/0.46.1/rlwrap-0.46.1.tar.gz

This comment is not needed.

> +
> +RLWRAP_VERSION = 0.46.1
> +RLWRAP_SOURCE = rlwrap-$(RLWRAP_VERSION).tar.gz

This line is not needed, and actually triggers a "make check-package"
warning.

> +RLWRAP_SITE = https://github.com/hanslub42/rlwrap/releases/download/$(RLWRAP_VERSION)
> +RLWRAP_LICENSE = GPL-2.0

The license really is GPL-2.0+.

> +RLWRAP_LICENSE_FILES = AUTHORS COPYING
> +
> +RLWRAP_DEPENDENCIES = readline
> +
> +# --enable-spy-on-readline
> +ifeq ($(BR2_PACKAGE_RLWRAP_SPY_ON_READLINE),y)
> +RLWRAP_CONF_OPTS += --enable-spy-on-readline
> +else
> +RLWRAP_CONF_OPTS += --disable-spy-on-readline
> +endif
> +
> +# --enable-homegrown-redisplay
> +ifeq ($(BR2_PACKAGE_RLWRAP_HOMEGROWN_REDISPLAY),y)
> +RLWRAP_CONF_OPTS += --enable-homegrown-redisplay
> +else
> +RLWRAP_CONF_OPTS += --disable-homegrown-redisplay
> +endif
> +
> +# --enable-debug
> +ifeq ($(BR2_PACKAGE_RLWRAP_DEBUG),y)
> +RLWRAP_CONF_OPTS += --enable-debug
> +else
> +RLWRAP_CONF_OPTS += --disable-debug
> +endif

I dropped this part.

> +# --enable-proc-mountpoint
> +RLWRAP_CONF_OPTS += --enable-proc-mountpoint=$(BR2_PACKAGE_RLWRAP_PROC_MOUNTPOINT)

And this part.

Also, I added this:

+define RLWRAP_REMOVE_FILTERS
+       $(RM) -rf $(TARGET_DIR)/usr/share/rlwrap/filters
+endef
+RLWRAP_POST_INSTALL_TARGET_HOOKS += RLWRAP_REMOVE_FILTERS

Indeed, those filters are written in Python or Perl, and your package
does not depend on them. In addition, the documentation says:

   Filters are `perl` or `python` plugins that enable complete (albeit
   somewhat fragile) control over `rlwrap`'s input and output, echo,
   prompt, history and completion. They aren't used a lot, and remain
   therefore somewhat untested. `rlwrap -z listing` lists the installed
   filters, `rlwrap -z <somefilter>` displays a short help text for
   `<somefilter>`

"They aren't used a lot". So for now, we drop them unconditionally. We
can always revisit if someone needs them later.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-06  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26  2:49 [Buildroot] [PATCH 1/1] package/rlwrap: new package Matt Silva
2024-02-06  9:44 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox