1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00

math/R: set SONAME for libraries under lib/R/lib

PR:		219776
Submitted by:	pawel
Reviewed by:	pawel, mat
Differential Revision:	https://reviews.freebsd.org/D11615
This commit is contained in:
Joseph Mingrone 2017-07-19 14:19:47 +00:00
parent 05b30a8d06
commit 755b8da41c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=446199
5 changed files with 88 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= R
PORTVERSION= 3.4.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= math lang
MASTER_SITES= CRAN/src/base/R-${PORTVERSION:C|\..*||}
@ -27,6 +27,7 @@ USES= gmake iconv libtool localbase objc:compiler \
pathfix perl5 readline:port
USE_PERL5= build
USE_LDCONFIG= ${PREFIX}/lib/R/lib
OPTIONS_DEFINE= ICU INFO LDOUBLE LETTER LIBR MEMPROF NLS RPROF X11
OPTIONS_GROUP= NEEDGCC NEEDX11
@ -135,8 +136,15 @@ TIFF_CONFIGURE_WITH= libtiff
X11_CONFIGURE_WITH= x
X11_USE= xorg=ice,sm,x11,xext,xmu,xscrnsaver,xt
LIBVER= ${PORTVERSION:R}
PLIST_SUB= LIBVER=${LIBVER}
post-patch:
@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|g" ${WRKSRC}/configure
@${REINPLACE_CMD} "s|%%LIBVER%%|${LIBVER}|" \
${WRKSRC}/src/main/Makefile.in \
${WRKSRC}/src/extra/blas/Makefile.in \
${WRKSRC}/src/modules/lapack/Makefile.in
.include <bsd.port.pre.mk>
.include "compiler.mk"

View File

@ -0,0 +1,27 @@
--- src/extra/blas/Makefile.in.orig 2017-07-16 08:46:49 UTC
+++ src/extra/blas/Makefile.in
@@ -19,7 +19,7 @@ SOURCES = blas00.c blas.f cmplxblas.f
Rblas_la = libRblas$(R_DYLIB_EXT)
## @RBLAS_LDFLAGS@ is used on macOS
## first for internal BLAS
-Rblas_la_LIBADD = @RBLAS_LDFLAGS@ $(FLIBS_IN_SO)
+Rblas_la_LIBADD = -Wl,-soname,libRblas.so.%%LIBVER%% $(FLIBS_IN_SO)
## then external one
Rblas_la_LIBADD0 = @RBLAS_LDFLAGS@
@@ -43,6 +43,7 @@ Rblas_install: $(Rblas_la)
@$(MKINSTALLDIRS) $(DESTDIR)$(Rexeclibdir)
@$(SHELL) $(top_srcdir)/tools/copy-if-change $(Rblas_la) \
$(DESTDIR)$(Rexeclibdir)/$(Rblas_la)
+ @cd $(DESTDIR)$(Rexeclibdir) && ln -s $(Rblas_la) $(Rblas_la).%%LIBVER%%
Rblas_install-strip: $(Rblas_la)
@$(MKINSTALLDIRS) $(DESTDIR)$(Rexeclibdir)
@@ -50,6 +51,7 @@ Rblas_install-strip: $(Rblas_la)
@if test -n "$(STRIP_LIBS)"; then \
$(STRIP_LIBS) "$(DESTDIR)$(Rexeclibdir)/$(Rblas_la)" ;\
fi
+ @cd "$(DESTDIR)$(Rexeclibdir)" && ln -s $(Rblas_la) $(Rblas_la).%%LIBVER%%
mostlyclean: clean
clean:

View File

@ -0,0 +1,19 @@
--- src/main/Makefile.in.orig 2017-07-16 08:46:49 UTC
+++ src/main/Makefile.in
@@ -110,7 +110,7 @@ libR_la_LIBADD = $(MAIN_OBJS) $(EXTRA_STATIC_LIBS) $(
libR_la_DEPENDENCIES = $(STATIC_LIBS) $(R_TZONE) @WANT_R_SHLIB_TRUE@ @USE_EXPORTFILES_TRUE@ $(top_builddir)/etc/R.exp
## The next is needed for macOS only at present
-LIBR_LDFLAGS = @LIBR_LDFLAGS@
+LIBR_LDFLAGS = -Wl,-soname,libR.so.%%LIBVER%%
all: R
@@ -200,6 +200,7 @@ install-bin: installdirs
install-lib: installdirs
@$(MKINSTALLDIRS) "$(DESTDIR)$(Rexeclibdir)"
@$(SHELL) $(top_srcdir)/tools/copy-if-change $(libR_la) "$(DESTDIR)$(Rexeclibdir)/$(libR_la)"
+ @cd "$(DESTDIR)$(Rexeclibdir)" && ln -s $(libR_la) $(libR_la).%%LIBVER%%
install-static: installdirs
@$(MKINSTALLDIRS) "$(DESTDIR)$(Rexeclibdir)"
@$(SHELL) $(top_srcdir)/tools/copy-if-change libR.a "$(DESTDIR)$(Rexeclibdir)/libR.a"

View File

@ -0,0 +1,30 @@
--- src/modules/lapack/Makefile.in.orig 2017-07-16 08:46:49 UTC
+++ src/modules/lapack/Makefile.in
@@ -82,16 +82,17 @@ $(lapack_la): $(lapack_la_OBJECTS)
## Include BLAS here, as with (static) ATLAS that pulls all the
## BLAS routines into one place.
$(Rlapack_la): $(LIBOBJECTS)
- $(DYLIB_LINK) -o $@ $(LIBOBJECTS) @RLAPACK_LDFLAGS@ @BLAS_LIBS@ $(Rlapack_la_LIBADD)
+ $(DYLIB_LINK) -o $@ $(LIBOBJECTS) -Wl,-soname,libRlapack.so.%%LIBVER%% @BLAS_LIBS@ $(Rlapack_la_LIBADD)
Rlapack_install: $(Rlapack_la)
@$(MKINSTALLDIRS) "$(DESTDIR)$(Rexeclibdir)"
@$(SHELL) $(top_srcdir)/tools/copy-if-change $(Rlapack_la) \
$(Rexeclibdir)/$(Rlapack_la)
-
+ @cd $(Rexeclibdir) && ln -s $(Rlapack_la) $(Rlapack_la).%%LIBVER%%
install: installdirs
@$(SHELL) $(top_srcdir)/tools/copy-if-change $(lapack_la) "$(DESTDIR)$(Rexecmodulesdir)/$(lapack_la)"
@USE_EXTERNAL_LAPACK_FALSE@ @$(SHELL) $(top_srcdir)/tools/copy-if-change $(Rlapack_la) "$(DESTDIR)$(Rexeclibdir)/$(Rlapack_la)"
+@USE_EXTERNAL_LAPACK_FALSE@ @cd "$(DESTDIR)$(Rexeclibdir)" && ln -sf $(Rlapack_la) $(Rlapack_la).%%LIBVER%%
installdirs:
@$(MKINSTALLDIRS) "$(DESTDIR)$(Rexecmodulesdir)"
install-strip-Rlapack:
@@ -104,6 +105,7 @@ install-strip: @USE_EXTERNAL_LAPACK_FALSE@ install-str
@if test -n "$(STRIP_LIBS)"; then \
$(STRIP_LIBS) "$(DESTDIR)$(Rexecmodulesdir)/$(lapack_la)"; \
fi
+ @cd "$(DESTDIR)$(Rexeclibdir)" && ln -s $(Rlapack_la) $(Rlapack_la).%%LIBVER%%
uninstall:
@rm -f "$(Rexecmodulesdir)/$(lapack_la)"

View File

@ -101,8 +101,11 @@ lib/R/include/Rmath.h
lib/R/include/Rversion.h
lib/R/include/S.h
%%RBLAS%%lib/R/lib/libRblas.so
%%RBLAS%%lib/R/lib/libRblas.so.%%LIBVER%%
%%RBLAS%%lib/R/lib/libRlapack.so
%%RBLAS%%lib/R/lib/libRlapack.so.%%LIBVER%%
%%LIBR%%lib/R/lib/libR.so
%%LIBR%%lib/R/lib/libR.so.%%LIBVER%%
lib/R/library/KernSmooth/DESCRIPTION
lib/R/library/KernSmooth/INDEX
lib/R/library/KernSmooth/Meta/features.rds