[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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 <jeremy@azazel.net>
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 <jeremy@azazel.net>
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 <jeremy@azazel.net>
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 <jeremy@azazel.net>
Date: Sat, 17 Jun 2023 20:55:17 +0100
Subject: [PATCH 4/5] d/p/build-in-makefile.patch: don't clean '*.so' 'cause we
 don't build it

---
 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 a82b73e7b514..847e17c6abc1 100644
--- a/debian/patches/build-in-makefile.patch
+++ b/debian/patches/build-in-makefile.patch
@@ -16,4 +16,4 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  clean:
  	rm -f linenoise_example
-+	rm -f *.so *.so.*
++	rm -f *.so.*
-- 
2.39.2

From 09ce0590841a700357379c5a2eae9cb21b2b6541 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <jeremy@azazel.net>
Date: Sat, 17 Jun 2023 20:36:21 +0100
Subject: [PATCH 5/5] d/*.links: install shlib sym-links

The main library package should contain the full-qualified shared library file
and an SONAME sym-link.  The -dev package should contain an unqualified link for
use in building binaries which are linked to the library.
---
 debian/liblinenoise-dev.links | 1 +
 debian/liblinenoise0.links    | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 debian/liblinenoise-dev.links
 create mode 100644 debian/liblinenoise0.links

diff --git a/debian/liblinenoise-dev.links b/debian/liblinenoise-dev.links
new file mode 100644
index 000000000000..e994a06608f3
--- /dev/null
+++ b/debian/liblinenoise-dev.links
@@ -0,0 +1 @@
+/usr/lib/${DEB_HOST_MULTIARCH}/liblinenoise.so.0.0.0 /usr/lib/${DEB_HOST_MULTIARCH}/liblinenoise.so
diff --git a/debian/liblinenoise0.links b/debian/liblinenoise0.links
new file mode 100644
index 000000000000..f7580f92cbeb
--- /dev/null
+++ b/debian/liblinenoise0.links
@@ -0,0 +1 @@
+/usr/lib/${DEB_HOST_MULTIARCH}/liblinenoise.so.0.0.0 /usr/lib/${DEB_HOST_MULTIARCH}/liblinenoise.so.0
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature


Reply to: