From: Dirk Eddelbuettel <edd@debian.org>
Date: Nov, 11 2026 09:22:00 -0600
Subject: [PATCH] Make src/nmath/standalone/Makefile.in reflect soname

Debian bug report #1153736 documents a regression in the binary
package r-mathlib in which the soname for the (external, optional)
libRmath.so is no longer set, and via fine detective works traces this
to a change we made in debian/rules by passing MAKEFLAGS on and down
overriding a value who previously helped here.  One suggested fix was
to actually set this in the upstream Makefile.in so this patch does
that.

--- r-base-4.6.1.orig/src/nmath/standalone/Makefile.in
+++ r-base-4.6.1/src/nmath/standalone/Makefile.in
@@ -67,7 +67,7 @@ libRmath_la = libRmath$(R_DYLIB_EXT)
 Rexeclibdir_LTLIBRARIES = $(libRmath_la)
 libRmath_la_SOURCES = $(SOURCES)
 libRmath_la_OBJECTS = $(OBJECTS:.o=.lo)
-libRmath_la_LDFLAGS =
+libRmath_la_LDFLAGS = -Wl,-soname,libRmath.so
 
 CLEANFILES = Makedeps *.d *.o *.lo test check.log $(SOURCES)
 DISTCLEANFILES = Makefile $(Rexeclibdir_LIBRARIES) $(Rexeclibdir_LTLIBRARIES)
