[PATCH] Add libsndio.so.${MAJ} symlink and use it as SONAME on linux

From: Duncan Overbruck <mail_at_duncano.de>
Date: Mon, 31 Aug 2020 22:36:58 +0200
This avoids having to rebuild a lot of packages even if the
ABI did not break. cubeb used by firefox currently dlopen's
either libsndio.so.7.1 or libsndio.so, with the major link
this would also avoid having to patch this as long as the
ABI doesn't break without having to ship the libsndio.so
symlink outside of -dev/-devel packages.
---
 configure            | 4 +++-
 libsndio/Makefile.in | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 94829c4..eb2ea9e 100755
--- a/configure
+++ b/configure
_at_@ -60,8 +60,9 @@ case `uname` in
 		alsa=yes
 		ldadd="-lrt"
 		user=sndiod
-		so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
 		so_link="libsndio.so"
+		so_link_maj="libsndio.so.\${MAJ}"
+		so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}"
 		defs='-D_GNU_SOURCE -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
 		;;
 	NetBSD)
_at_@ -268,6 +269,7 @@ do
 	-e "s:_at_ldadd@:$ldadd:" \
 	-e "s:_at_so@:$so:" \
 	-e "s:_at_so_link@:$so_link:" \
+	-e "s:_at_so_link_maj@:$so_link_maj:" \
 	-e "s:_at_so_ldflags@:$so_ldflags:" \
 	-e "s:_at_vars@:${vars}:" \
 	-e "s:_at_precision@:$precision:" \
diff --git a/libsndio/Makefile.in b/libsndio/Makefile.in
index 58ec1e7..36f1fd9 100644
--- a/libsndio/Makefile.in
+++ b/libsndio/Makefile.in
_at_@ -49,8 +49,9 @@ MAJ = 7
 MIN = 1
 SO = _at_so@
 SO_LINK = _at_so_link@
+SO_LINK_MAJ = _at_so_link_maj@
 
-all:		${SO} ${SO_LINK}
+all:		${SO} ${SO_LINK} ${SO_LINK_MAJ}
 
 
 install:
_at_@ -59,7 +60,7 @@ install:
 		mkdir -p ${DESTDIR}${MAN3_DIR}
 		mkdir -p ${DESTDIR}${MAN7_DIR}
 		cp sndio.h ${DESTDIR}${INCLUDE_DIR}
-		cp -R ${SO} ${SO_LINK} ${DESTDIR}${LIB_DIR}
+		cp -R ${SO} ${SO_LINK} ${SO_LINK_MAJ} ${DESTDIR}${LIB_DIR}
 		cp sio_open.3 ${DESTDIR}${MAN3_DIR}
 		ln -sf sio_open.3 ${DESTDIR}${MAN3_DIR}/sio_close.3
 		ln -sf sio_open.3 ${DESTDIR}${MAN3_DIR}/sio_setpar.3
_at_@ -126,6 +127,9 @@ ${SO}:		${OBJS}
 ${SO_LINK}:
 		ln -sf ${SO} ${SO_LINK}
 
+${SO_LINK_MAJ}:
+		ln -sf ${SO} ${SO_LINK_MAJ}
+
 issetugid.o:	../bsd-compat/issetugid.c
 		${CC} ${CFLAGS} ${SO_CFLAGS} ${INCLUDE} ${DEFS} -c -o issetugid.o ../bsd-compat/issetugid.c
 
-- 
2.28.0
Received on Mon Aug 31 2020 - 22:36:58 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2020 - 01:34:06 CEST