All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vim: put xxd in its own package
@ 2022-06-08  7:42 Rasmus Villemoes
  2022-06-08 11:58 ` Paulo Neves
  2022-06-08 13:54 ` Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Rasmus Villemoes @ 2022-06-08  7:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie, Ross Burton, Rasmus Villemoes

The xxd tool can be quite handy by itself, and doesn't have anything
to do with vim per se. Make it possible to include the rather tiny xxd
in a rootfs without pulling in the several MB vim binary and
associated data.

For backwards compatibility, add an RDEPENDS from the main package to
the new vim-xxd package.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 meta/recipes-support/vim/vim_8.2.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-support/vim/vim_8.2.bb b/meta/recipes-support/vim/vim_8.2.bb
index f358e61132b..fee9f055e9a 100644
--- a/meta/recipes-support/vim/vim_8.2.bb
+++ b/meta/recipes-support/vim/vim_8.2.bb
@@ -2,14 +2,18 @@ require vim.inc
 
 PROVIDES = "xxd"
 
-RDEPENDS:${PN} = "ncurses-terminfo-base"
+RDEPENDS:${PN} = "ncurses-terminfo-base ${PN}-xxd"
 # Recommend that runtime data is installed along with vim
 RRECOMMENDS:${PN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
 
 PACKAGECONFIG:class-native = ""
 BBCLASSEXTEND = "native nativesdk"
 
-ALTERNATIVE:${PN}:append = " xxd"
+PACKAGES =+ "${PN}-xxd"
+FILES:${PN}-xxd = "${bindir}/xxd"
+RPROVIDES:${PN}-xxd = "xxd"
+
+ALTERNATIVE:${PN}-xxd = "xxd"
 ALTERNATIVE_TARGET[xxd] = "${bindir}/xxd"
 ALTERNATIVE_LINK_NAME[xxd] = "${bindir}/xxd"
 
-- 
2.31.1



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

* Re: [PATCH] vim: put xxd in its own package
  2022-06-08  7:42 [PATCH] vim: put xxd in its own package Rasmus Villemoes
@ 2022-06-08 11:58 ` Paulo Neves
  2022-06-08 12:13   ` [OE-core] " Rasmus Villemoes
  2022-06-08 13:54 ` Tom Rini
  1 sibling, 1 reply; 7+ messages in thread
From: Paulo Neves @ 2022-06-08 11:58 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

Forgive me if it is a stupid question, but does xxd not rdepend on ncurses-terminfo-base as well? I ask because before your patch it could was implied it that it did, s part of PN.

[-- Attachment #2: Type: text/html, Size: 182 bytes --]

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

* Re: [OE-core] [PATCH] vim: put xxd in its own package
  2022-06-08 11:58 ` Paulo Neves
@ 2022-06-08 12:13   ` Rasmus Villemoes
  2022-06-08 12:30     ` Paulo Neves
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Villemoes @ 2022-06-08 12:13 UTC (permalink / raw)
  To: ptsneves, openembedded-core

On 08/06/2022 13.58, Paulo Neves via lists.openembedded.org wrote:
> Forgive me if it is a stupid question, but does xxd not rdepend on
> ncurses-terminfo-base as well?

No, it does not, it's a trivial standalone utility whose only dynamic
dependency is libc.

> I ask because before your patch it could
> was implied it that it did, s part of PN.

I don't understand what you're trying to say. I just put the extra
RDEPENDS from vim to vim-xxd into the existing RDEPENDS:vim line. That
doesn't imply any dependency either way between the two items listed on
the RHS.

Rasmus


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

* Re: [OE-core] [PATCH] vim: put xxd in its own package
  2022-06-08 12:13   ` [OE-core] " Rasmus Villemoes
@ 2022-06-08 12:30     ` Paulo Neves
  2022-06-08 12:36       ` Rasmus Villemoes
  0 siblings, 1 reply; 7+ messages in thread
From: Paulo Neves @ 2022-06-08 12:30 UTC (permalink / raw)
  To: Rasmus Villemoes, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

On 6/8/22 14:13, Rasmus Villemoes wrote:

> On 08/06/2022 13.58, Paulo Neves via lists.openembedded.org wrote:
>> Forgive me if it is a stupid question, but does xxd not rdepend on
>> ncurses-terminfo-base as well?
> No, it does not, it's a trivial standalone utility whose only dynamic
> dependency is libc.

The original RDEPENDS on ncurses-terminfo-base is not about dynamic
libraries but about terminfo files that are used for describing capabilities
of terminals. They are usually in /etc/terminfo directory.
There are programs that load these files and without them will
display broken output our refuse to run. vim seemed to be one of those programs.
Have you tested that xxd works without these files?

>> I ask because before your patch it could
>> was implied it that it did, s part of PN.
> I don't understand what you're trying to say. I just put the extra
> RDEPENDS from vim to vim-xxd into the existing RDEPENDS:vim line. That
> doesn't imply any dependency either way between the two items listed on
> the RHS.

I mean that your patch allows for a new standalone package ${PN}-xxd.
Were somebody to use this package standalone, meaning without installing vim,
the ncurses-terminfo-base would not be installed, possibly breaking xxd.

Before your patch this risk did not occur due to xxd being include in the ${PN}
which had an RDEPENDS to ncurses-terminfo-base.

> Rasmus

Paulo Neves

[-- Attachment #2: Type: text/html, Size: 2286 bytes --]

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

* Re: [OE-core] [PATCH] vim: put xxd in its own package
  2022-06-08 12:30     ` Paulo Neves
@ 2022-06-08 12:36       ` Rasmus Villemoes
  2022-06-08 13:34         ` Paulo Neves
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Villemoes @ 2022-06-08 12:36 UTC (permalink / raw)
  To: Paulo Neves, openembedded-core

On 08/06/2022 14.30, Paulo Neves wrote:
> On 6/8/22 14:13, Rasmus Villemoes wrote:
> 
>> On 08/06/2022 13.58, Paulo Neves via lists.openembedded.org wrote:
> I mean that your patch allows for a new standalone package ${PN}-xxd.
> Were somebody to use this package standalone, meaning without installing vim,
> the ncurses-terminfo-base would not be installed, possibly breaking xxd.
> 
> Before your patch this risk did not occur due to xxd being include in the ${PN}
> which had an RDEPENDS to ncurses-terminfo-base.

Thanks, now I understand what you were saying. And no, xxd does not in
any way depend on those terminfo files; it's a simple utility for
converting binary files to hex (or the reverse, which is what I happen
to need, taking input in the form of ascii hex chars and producing
binary output). Yes, I've tested it on target as well.

Rasmus


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

* Re: [OE-core] [PATCH] vim: put xxd in its own package
  2022-06-08 12:36       ` Rasmus Villemoes
@ 2022-06-08 13:34         ` Paulo Neves
  0 siblings, 0 replies; 7+ messages in thread
From: Paulo Neves @ 2022-06-08 13:34 UTC (permalink / raw)
  To: Rasmus Villemoes, openembedded-core

Looks good to me then ;) Had a look at the code [1] and indeed it is a 
very minimal standalone binary.

Grateful for your patience
Paulo Neves

[1] https://github.com/vim/vim/blob/master/src/xxd/xxd.c

On 6/8/22 14:36, Rasmus Villemoes wrote:
> On 08/06/2022 14.30, Paulo Neves wrote:
>> On 6/8/22 14:13, Rasmus Villemoes wrote:
>>
>>> On 08/06/2022 13.58, Paulo Neves via lists.openembedded.org wrote:
>> I mean that your patch allows for a new standalone package ${PN}-xxd.
>> Were somebody to use this package standalone, meaning without installing vim,
>> the ncurses-terminfo-base would not be installed, possibly breaking xxd.
>>
>> Before your patch this risk did not occur due to xxd being include in the ${PN}
>> which had an RDEPENDS to ncurses-terminfo-base.
> Thanks, now I understand what you were saying. And no, xxd does not in
> any way depend on those terminfo files; it's a simple utility for
> converting binary files to hex (or the reverse, which is what I happen
> to need, taking input in the form of ascii hex chars and producing
> binary output). Yes, I've tested it on target as well.
>
> Rasmus



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

* Re: [PATCH] vim: put xxd in its own package
  2022-06-08  7:42 [PATCH] vim: put xxd in its own package Rasmus Villemoes
  2022-06-08 11:58 ` Paulo Neves
@ 2022-06-08 13:54 ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-06-08 13:54 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: openembedded-core, Richard Purdie, Ross Burton

On Wed, Jun 08, 2022 at 09:42:45AM +0200, Rasmus Villemoes wrote:

> The xxd tool can be quite handy by itself, and doesn't have anything
> to do with vim per se. Make it possible to include the rather tiny xxd
> in a rootfs without pulling in the several MB vim binary and
> associated data.
> 
> For backwards compatibility, add an RDEPENDS from the main package to
> the new vim-xxd package.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom


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

end of thread, other threads:[~2022-06-08 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08  7:42 [PATCH] vim: put xxd in its own package Rasmus Villemoes
2022-06-08 11:58 ` Paulo Neves
2022-06-08 12:13   ` [OE-core] " Rasmus Villemoes
2022-06-08 12:30     ` Paulo Neves
2022-06-08 12:36       ` Rasmus Villemoes
2022-06-08 13:34         ` Paulo Neves
2022-06-08 13:54 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.