Bug#940960: ITP: linenoise -- Minimal replacement for readline

2024-05-22 Thread Blair Noctis

On 2024-05-05 07:33, Maytham Alsudany wrote:
Hi, Any progress on getting linenoise packaged? This is urgently 
needed to devendor linenoise in the redict package (a new fork of 
redis). If you've lost interest, I'm happy to take over this ITP. Kind 
regards, Maytham 


Hi, sorry for the delay. Please feel free to take over.

--
Sdrager,
Blair Noctis



Bug#940960: ITP: linenoise -- Minimal replacement for readline

2024-05-11 Thread Jeremy Sowden
On 2024-05-05, at 07:33:30 +0800, Maytham Alsudany wrote:
> Any progress on getting linenoise packaged? This is urgently needed to
> devendor linenoise in the redict package (a new fork of redis).
> 
> If you've lost interest, I'm happy to take over this ITP.

I can't speak for Blair, but I transferred ownership of the ITP bug to
him, because I didn't have a use-case for linenoise, so if you want to
take it on, that's fine by me.

I've had a quick look at the upstream project and it doesn't seem
entirely dead, which had been a concern.  There isn't a lot of activity,
but some commits are being made.  No response to my PR, however. :) I've
updated my Salsa repo to the latest upstream snapshot and given the
packaging a polish:

  https://salsa.debian.org/azazel/linenoise

HTH,

J.


signature.asc
Description: PGP signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2024-05-04 Thread Maytham Alsudany
Hi,

Any progress on getting linenoise packaged? This is urgently needed to devendor
linenoise in the redict package (a new fork of redis).

If you've lost interest, I'm happy to take over this ITP.

Kind regards,
Maytham


signature.asc
Description: This is a digitally signed message part


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-06-28 Thread Blair Noctis
On 2023-06-18 05:10, Jeremy Sowden wrote:
>>> Yes, absolutely.  Apologies for taking three weeks to reply.
>>>
>>> J.
>>
>> And I took two days ;)

This time took literally two weeks, haha. Dragged away by $work.

> You've gone a for a less elaborate build process for the shared library
> than I did:
> 
>   
> https://github.com/antirez/linenoise/pull/174/commits/ab860406520ad7fc5e7e8e91fcf60cdc43a786f0
> 
> but that's probably fine.  I do have one observation, however.  The
> shared library should be liblinenoise.so.0.0.0 and there should be two
> sym-links: liblinenoise.so.0, which is needed by the library's
> dependencies at run-time, and liblinenoise.so which is needed by its
> dependencies at build-time.
> 
> I've attached a patch-series with some suggested changes.
> 
> J.

I've applied the patches after reading them. It's great to learn from code.

OTOH I saw your salsa repo. Since you've done that much I think it's probably
better to let you finish it?

-- 
Sdrager,
Blair Noctis



OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-06-18 Thread Jeremy Sowden
On 2023-06-14, at 19:55:01 +0800, Blair Noctis wrote:
> On 2023-06-12 05:55, Jeremy Sowden wrote:
> > On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
> >> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden wrote:
> >>> It occurs to me that it might make more sense for you to take the lead
> >>> in packaging linenoise since you have an interest in getting it into
> >>> Debian.  Would you like me to transfer ownership of the ITP bug to you?
> >>> Happy to lend a hand if you need one.
> >>
> >> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
> >> sure I did it right.
> > 
> > Yes, absolutely.  Apologies for taking three weeks to reply.
> > 
> > J.
> 
> And I took two days ;)
> 
> Here it goes: https://mentors.debian.net/package/linenoise/

You've gone a for a less elaborate build process for the shared library
than I did:

  
https://github.com/antirez/linenoise/pull/174/commits/ab860406520ad7fc5e7e8e91fcf60cdc43a786f0

but that's probably fine.  I do have one observation, however.  The
shared library should be liblinenoise.so.0.0.0 and there should be two
sym-links: liblinenoise.so.0, which is needed by the library's
dependencies at run-time, and liblinenoise.so which is needed by its
dependencies at build-time.

I've attached a patch-series with some suggested changes.

J.
From f240c33394c7d387bc678b81eb0b75af8ee2ac18 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden 
Date: Sat, 17 Jun 2023 20:54:33 +0100
Subject: [PATCH 1/5] d/p/build-in-makefile.patch: get rid of phony `shlib`
 target

We are making the shared library, so use that as the target.
---
 debian/patches/build-in-makefile.patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/patches/build-in-makefile.patch b/debian/patches/build-in-makefile.patch
index bc1a71598ec2..70e2a3d77b14 100644
--- a/debian/patches/build-in-makefile.patch
+++ b/debian/patches/build-in-makefile.patch
@@ -6,8 +6,8 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/Makefile
 +++ b/Makefile
 @@ -1,3 +1,6 @@
-+shlib: linenoise.c
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wall -g -fPIC -shared -Wl,-soname,liblinenoise.so.0 -o liblinenoise.so.0 linenoise.c
++liblinenoise.so.0: linenoise.c
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wall -g -fPIC -shared -Wl,-soname,liblinenoise.so.0 -o $@ $<
 +
  linenoise_example: linenoise.h linenoise.c
  
-- 
2.39.2

From fa8c5a2b8ea7b3a14b0a207b52b8c958848e73cc Mon Sep 17 00:00:00 2001
From: Jeremy Sowden 
Date: Sat, 17 Jun 2023 20:28:23 +0100
Subject: [PATCH 2/5] d/p/build-in-makefile.patch: use full version number in
 library file-name

A shared library file-name is usually qualified with a major, minor and
patch version.

  * Updating the patch version indicates internal changes.
  * Updating the minor version indicates the addition of new interfaces
to the ABI.
  * Updating the major version indicates the modification or removal of
existing interfaces in the ABI.

The SONAME only contains the major version, since this will be embedded
in the binaries that depend on the library and updating the major
version implies backwardly-incompatible changes.
---
 debian/patches/build-in-makefile.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/patches/build-in-makefile.patch b/debian/patches/build-in-makefile.patch
index 70e2a3d77b14..392014e3e8ac 100644
--- a/debian/patches/build-in-makefile.patch
+++ b/debian/patches/build-in-makefile.patch
@@ -6,7 +6,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/Makefile
 +++ b/Makefile
 @@ -1,3 +1,6 @@
-+liblinenoise.so.0: linenoise.c
++liblinenoise.so.0.0.0: linenoise.c
 +	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wall -g -fPIC -shared -Wl,-soname,liblinenoise.so.0 -o $@ $<
 +
  linenoise_example: linenoise.h linenoise.c
-- 
2.39.2

From 9d0286cac79852d7c0477ef5d36a7d4cc4ad185f Mon Sep 17 00:00:00 2001
From: Jeremy Sowden 
Date: Sat, 17 Jun 2023 21:09:47 +0100
Subject: [PATCH 3/5] d/p/build-in-makefile.patch: put `*FLAGS` variables last

The variables should override any defaults.
---
 debian/patches/build-in-makefile.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/patches/build-in-makefile.patch b/debian/patches/build-in-makefile.patch
index 392014e3e8ac..a82b73e7b514 100644
--- a/debian/patches/build-in-makefile.patch
+++ b/debian/patches/build-in-makefile.patch
@@ -7,7 +7,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 +++ b/Makefile
 @@ -1,3 +1,6 @@
 +liblinenoise.so.0.0.0: linenoise.c
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wall -g -fPIC -shared -Wl,-soname,liblinenoise.so.0 -o $@ $<
++	$(CC) -Wall -g -fPIC -shared -Wl,-soname,liblinenoise.so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
 +
  linenoise_example: linenoise.h linenoise.c
  
-- 
2.39.2

From ac840a36645bb37a172ca8d9a2fa66efbc8199f2 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden 
Date: Sat, 17 Jun 2023 20:55:17 +0100
Subject: [PATCH 4/5] 

Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-06-14 Thread Blair Noctis
On 2023-06-12 05:55, Jeremy Sowden wrote:
> On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
>> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden  wrote:
>>> It occurs to me that it might make more sense for you to take the lead
>>> in packaging linenoise since you have an interest in getting it into
>>> Debian.  Would you like me to transfer ownership of the ITP bug to you?
>>> Happy to lend a hand if you need one.
>>
>> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
>> sure I did it right.
> 
> Yes, absolutely.  Apologies for taking three weeks to reply.
> 
> J.

And I took two days ;)

Here it goes: https://mentors.debian.net/package/linenoise/

-- 
Sdrager,
Blair Noctis



OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-06-14 Thread Blair Noctis
On 2023-06-12 05:55, Jeremy Sowden wrote:
> On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
>> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden  wrote:
>>> It occurs to me that it might make more sense for you to take the lead
>>> in packaging linenoise since you have an interest in getting it into
>>> Debian.  Would you like me to transfer ownership of the ITP bug to you?
>>> Happy to lend a hand if you need one.
>>
>> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
>> sure I did it right.
> 
> Yes, absolutely.  Apologies for taking three weeks to reply.
> 
> J.

And I took two days ;)

Here it goes: https://mentors.debian.net/package/linenoise/

-- 
Sdrager,
Blair Noctis




OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-06-11 Thread Jeremy Sowden
On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden  wrote:
> > It occurs to me that it might make more sense for you to take the lead
> > in packaging linenoise since you have an interest in getting it into
> > Debian.  Would you like me to transfer ownership of the ITP bug to you?
> > Happy to lend a hand if you need one.
> 
> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
> sure I did it right.

Yes, absolutely.  Apologies for taking three weeks to reply.

J.


signature.asc
Description: PGP signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-21 Thread Blair Noctis
On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden  wrote:
> It occurs to me that it might make more sense for you to take the lead
> in packaging linenoise since you have an interest in getting it into
> Debian.  Would you like me to transfer ownership of the ITP bug to you?
> Happy to lend a hand if you need one.
> 
> J.

Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make sure I did
it right.

-- 
Sdrager,
Blair Noctis


OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-17 Thread Jeremy Sowden
On 2023-05-14, at 15:00:06 +0800, Blair Noctis wrote:
> On 2023/5/14 03:24, Jeremy Sowden wrote:
> > I came across linenoise because of a request to support it in nftables.
> > The request came from someone who wanted to install nftables in a
> > resource-constrained environment where the existing libreadline support
> > was too heavyweight.  In the case of osquery, would it possible to go
> > the other way?  Do you think that upstream would be open to adding
> > support for libreadline if we offered patches?
> 
> Feasible on the resource level I think, it links to many libraries anyway. But
> for using readline… they actually switched away from it in 2016:
> https://github.com/osquery/osquery/pull/2613
> 
> Considering their rather radical approach of vendoring everything, I don't 
> have
> too much hope for that.

Ah, right.  So much for that idea!

It occurs to me that it might make more sense for you to take the lead
in packaging linenoise since you have an interest in getting it into
Debian.  Would you like me to transfer ownership of the ITP bug to you?
Happy to lend a hand if you need one.

J.


signature.asc
Description: PGP signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-14 Thread Blair Noctis
On 2023/5/14 03:24, Jeremy Sowden wrote:
> I came across linenoise because of a request to support it in nftables.
> The request came from someone who wanted to install nftables in a
> resource-constrained environment where the existing libreadline support
> was too heavyweight.  In the case of osquery, would it possible to go
> the other way?  Do you think that upstream would be open to adding
> support for libreadline if we offered patches?
> 
> J.

Feasible on the resource level I think, it links to many libraries anyway. But
for using readline… they actually switched away from it in 2016:
https://github.com/osquery/osquery/pull/2613

Considering their rather radical approach of vendoring everything, I don't have
too much hope for that.

-- 
Sdrager,
Blair Noctis



OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-13 Thread Jeremy Sowden
I came across linenoise because of a request to support it in nftables.
The request came from someone who wanted to install nftables in a
resource-constrained environment where the existing libreadline support
was too heavyweight.  In the case of osquery, would it possible to go
the other way?  Do you think that upstream would be open to adding
support for libreadline if we offered patches?

J.


signature.asc
Description: PGP signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-09 Thread Blair Noctis
On 2023/5/9 04:20, Jeremy Sowden wrote:
> Thanks for the offer. :) I've cloned the osquery repo and it appears to
> use the C++ Linenoise NG fork:

No problem ;) It uses the -ng fork, but the fork's repo was archived in 2017,
which leads me back to the original. And

> which is what I started packaging.  The reason that I stopped work on it
> was that linenoise is intended to be used by adding the sources to the
> code-base of the application that wants the functionality.  I created a
> PR to add support for building it as a shared library:

is "solved" by adding a make target that builds a .so ("solved" only in my
opinion, of course). But…

> and there has been no response (mind you, there are a lot of open PR's
> going back years), so I wasn't sure whether it was worth adding to
> Debian.

This is indeed a problem, which I overlooked at first. A second check shows 59
open issues vs 24 closed, and as you said 73 open PRs vs 54 closed, an obvious
sign of abandonment, overlooked largely due to its recent commits.

> I've had a quick look at the linenoise-ng repo and it appears to be
> API-compatible with the original and has a [c]make file, so it may be a
> better candidate for packaging -- particularly now that you have
> provided a use-case for it.  I'll take a closer look and see how much of
> my work can be salvaged.
Speaking of API-compatible — I asked in #debian-mentors and someone expressed
strong concern over the lack of versioning of the original, while -ng at least
has a macro that defines its version.

In the compatibility sense I'm now more on the -ng side. Personally I don't like
cmake… but it's fine on this level.

The use case is a big headache, vendoring everything with its various own
compilation tweaks baked in cmake files. linenoise is hardly a problem compared
to that… Still, happy to help ;)

-- 
Sdrager,
Blair Noctis



OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-05-08 Thread Jeremy Sowden
On 2023-05-01, at 04:09:16 +0800, Blair Noctis wrote:
> It's been a few years since this ITP was filed. Do you still plan to
> package it?  I'm packaging osquery which depends on this. Happy to
> help ;)

Thanks for the offer. :) I've cloned the osquery repo and it appears to
use the C++ Linenoise NG fork:

  https://github.com/arangodb/linenoise-ng

not the C original:

  https://github.com/antirez/linenoise

which is what I started packaging.  The reason that I stopped work on it
was that linenoise is intended to be used by adding the sources to the
code-base of the application that wants the functionality.  I created a
PR to add support for building it as a shared library:

  https://github.com/antirez/linenoise/pull/174

and there has been no response (mind you, there are a lot of open PR's
going back years), so I wasn't sure whether it was worth adding to
Debian.

I've had a quick look at the linenoise-ng repo and it appears to be
API-compatible with the original and has a [c]make file, so it may be a
better candidate for packaging -- particularly now that you have
provided a use-case for it.  I'll take a closer look and see how much of
my work can be salvaged.

J.


signature.asc
Description: PGP signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2023-04-30 Thread Blair Noctis
Hi Jeremy,

It's been a few years since this ITP was filed. Do you still plan to package it?
I'm packaging osquery which depends on this. Happy to help ;)

-- 
Sdrager,
Blair Noctis


OpenPGP_signature
Description: OpenPGP digital signature


Bug#940960: ITP: linenoise -- Minimal replacement for readline

2019-09-22 Thread Jeremy Sowden
Package: wnpp
Severity: wishlist
Owner: Jeremy Sowden 

* Package name: linenoise
  Version : 1.0+git20180718.4a961c010872
  Upstream Author : Salvatore Sanfilippo 
* URL : https://github.com/antirez/linenoise
* License : BSD-2-Clause
  Programming Lang: C
  Description : Minimal replacement for readline

A minimal, zero-config, BSD licensed, readline replacement used in Redis,
MongoDB, and Android.

  * Single and multi line editing mode with the usual key bindings implemented.
  * History handling.
  * Completion.
  * Hints (suggestions at the right of the prompt as you type).
  * About 1,100 lines of BSD license source code.
  * Only uses a subset of VT100 escapes (ANSI.SYS compatible).