git: 9275f87e84ae - main - lang/mujs: Add SONAME to the shared library

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 27 Mar 2023 18:26:02 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9275f87e84ae04f7dac34d926dde23ce9d76d8a2

commit 9275f87e84ae04f7dac34d926dde23ce9d76d8a2
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-03-27 15:02:03 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-03-27 18:25:49 +0000

    lang/mujs: Add SONAME to the shared library
    
    PR:             269960
    Reported by:    fuz@
---
 lang/mujs/Makefile             |  3 +++
 lang/mujs/files/patch-Makefile | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/lang/mujs/Makefile b/lang/mujs/Makefile
index df024e4ab89b..14c8973a093d 100644
--- a/lang/mujs/Makefile
+++ b/lang/mujs/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	mujs
 DISTVERSION=	1.3.3
+PORTREVISION=	1
 CATEGORIES=	lang devel
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -18,6 +19,8 @@ USE_LDCONFIG=	yes
 USE_GITHUB=	yes
 GH_ACCOUNT=	ccxvii
 
+LDFLAGS=	-Wl,-soname=libmujs.so
+
 ALL_TARGET=	build/release/mujs \
 		build/release/libmujs.so \
 		build/release/libmujs.a
diff --git a/lang/mujs/files/patch-Makefile b/lang/mujs/files/patch-Makefile
index 4a93632fa784..91d877f0829a 100644
--- a/lang/mujs/files/patch-Makefile
+++ b/lang/mujs/files/patch-Makefile
@@ -14,3 +14,21 @@ Patch contains 2 changes:
  
  OPTIM = -O3
  
+@@ -79,7 +80,7 @@ build/sanitize/mujs: main.c one.c $(SRCS) $(HDRS)
+ 
+ build/debug/libmujs.$(SO): one.c $(SRCS) $(HDRS)
+ 	@mkdir -p $(@D)
+-	$(CC) $(CFLAGS) -g -fPIC -shared -o $@ one.c -lm
++	$(CC) $(CFLAGS) -g -fPIC -shared $(LDFLAGS) -o $@ one.c -lm
+ build/debug/libmujs.o: one.c $(SRCS) $(HDRS)
+ 	@mkdir -p $(@D)
+ 	$(CC) $(CFLAGS) -g -c -o $@ one.c
+@@ -92,7 +93,7 @@ build/debug/mujs-pp: pp.c build/debug/libmujs.o
+ 
+ build/release/libmujs.$(SO): one.c $(SRCS) $(HDRS)
+ 	@mkdir -p $(@D)
+-	$(CC) $(CFLAGS) $(OPTIM) -fPIC -shared -o $@ one.c -lm
++	$(CC) $(CFLAGS) $(OPTIM) -fPIC -shared $(LDFLAGS) -o $@ one.c -lm
+ build/release/libmujs.o: one.c $(SRCS) $(HDRS)
+ 	@mkdir -p $(@D)
+ 	$(CC) $(CFLAGS) $(OPTIM) -c -o $@ one.c