From 9bbea19b367b53aa09bd49dc8ec4cfb35ff7f989 Mon Sep 17 00:00:00 2001 From: Souji Thenria Date: Tue, 18 Feb 2025 04:24:36 +0300 Subject: [PATCH] net-im/concord: Add SONAME for libdiscord.so An error indicates that the SONAME is missing when used from another port PR: 284870 --- net-im/concord/Makefile | 4 +++- net-im/concord/files/patch-Makefile | 16 ++++++++++++++++ net-im/concord/files/patch-src_Makefile | 11 ++++++++++- net-im/concord/pkg-plist | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/net-im/concord/Makefile b/net-im/concord/Makefile index 91919838e58a..a1d74c3fc4d8 100644 --- a/net-im/concord/Makefile +++ b/net-im/concord/Makefile @@ -1,6 +1,7 @@ PORTNAME= concord DISTVERSIONPREFIX= v DISTVERSION= 2.3.0 +PORTREVISION= 1 CATEGORIES= net-im devel MAINTAINER= mail@souji-thenria.net @@ -17,7 +18,8 @@ GH_ACCOUNT= Cogmasters USE_LDCONFIG= yes MAKE_ARGS= DESTINCLUDE_DIR=${STAGEDIR}${PREFIX}/include/concord \ - DESTLIBDIR=${STAGEDIR}${PREFIX}/lib + DESTLIBDIR=${STAGEDIR}${PREFIX}/lib \ + ABIVERSION=1 # This is for the soname value MAKE_JOBS_UNSAFE= yes OPTIONS_DEFINE= DEBUG DEBUG_HTTP DEBUG_WEBSOCKETS EXAMPLES SIGINTCATCH diff --git a/net-im/concord/files/patch-Makefile b/net-im/concord/files/patch-Makefile index eff7f8b40ecd..fdfeb8eb25eb 100644 --- a/net-im/concord/files/patch-Makefile +++ b/net-im/concord/files/patch-Makefile @@ -9,3 +9,19 @@ static: @ CFLAGS="$(CFLAGS)" $(MAKE) -C $(CORE_DIR) +@@ -40,6 +40,7 @@ install: + @ mkdir -p $(DESTINCLUDE_DIR) + install -d $(DESTLIBDIR) + install -m 644 $(LIBDIR)/* $(DESTLIBDIR) ++ ln -fs libdiscord.so.$(ABIVERSION) $(DESTLIBDIR)/libdiscord.so + install -d $(DESTINCLUDE_DIR) + install -m 644 $(INCLUDE_DIR)/*.h $(CORE_DIR)/*.h $(GENCODECS_DIR)/*.h \ + $(DESTINCLUDE_DIR) +@@ -48,6 +49,7 @@ uninstall: + rm -rf $(PREFIX)/include/concord + rm -rf $(PREFIX)/lib/libdiscord.a + rm -rf $(PREFIX)/lib/libdiscord.so ++ rm -rf $(PREFIX)/lib/libdiscord.so.$(ABIVERSION) + rm -rf $(PREFIX)/lib/libdiscord.dylib + + docs: diff --git a/net-im/concord/files/patch-src_Makefile b/net-im/concord/files/patch-src_Makefile index 5eb202b4c985..88597041132f 100644 --- a/net-im/concord/files/patch-src_Makefile +++ b/net-im/concord/files/patch-src_Makefile @@ -1,11 +1,20 @@ --- src/Makefile.orig 2024-05-06 23:04:41 UTC +++ src/Makefile +@@ -60,7 +60,7 @@ ARLIB = $(LIBDIR)/libdiscord.a + -I$(INCLUDE_DIR) -I$(CORE_DIR) -I$(GENCODECS_DIR) -I$(PREFIX)/include + + ARLIB = $(LIBDIR)/libdiscord.a +-SOLIB = $(LIBDIR)/libdiscord.so ++SOLIB = $(LIBDIR)/libdiscord.so.$(ABIVERSION) + DYLIB = $(LIBDIR)/libdiscord.dylib + + ARFLAGS = -cqsv @@ -82,7 +82,7 @@ $(SOLIB): deps $(ARLIB): deps $(AR) $(ARFLAGS) $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) $(SOLIB): deps - $(CC) -shared -lcurl -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) -+ $(CC) -shared -L$(PREFIX)/lib -lcurl -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) ++ $(CC) -shared -Wl,-soname,libdiscord.so.$(ABIVERSION) -L$(PREFIX)/lib -lcurl -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) $(DYLIB): deps $(CC) -dynamiclib $(DYFLAGS) -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) diff --git a/net-im/concord/pkg-plist b/net-im/concord/pkg-plist index 596c4b40d1d6..3ff60e7ffb56 100644 --- a/net-im/concord/pkg-plist +++ b/net-im/concord/pkg-plist @@ -54,6 +54,7 @@ include/concord/webhook.h include/concord/websockets.h lib/libdiscord.a lib/libdiscord.so +lib/libdiscord.so.1 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/8ball %%PORTEXAMPLES%%%%EXAMPLESDIR%%/8ball.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile @@ -102,7 +103,6 @@ lib/libdiscord.so %%PORTEXAMPLES%%%%EXAMPLESDIR%%/spam.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/timers %%PORTEXAMPLES%%%%EXAMPLESDIR%%/timers.c -@comment %%PORTEXAMPLES%%%%EXAMPLESDIR%%/voice-join %%PORTEXAMPLES%%%%EXAMPLESDIR%%/voice-join.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/webhook %%PORTEXAMPLES%%%%EXAMPLESDIR%%/webhook.c