aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrm <jrm@FreeBSD.org>2017-07-19 22:19:47 +0800
committerjrm <jrm@FreeBSD.org>2017-07-19 22:19:47 +0800
commit51095d0250c636d58a1353c4d22b56c44322997a (patch)
treefe562c1724254c28fa7d35cbc6a5dcedc58ed0e0
parent5b72b85b7162ce5d93c8b4e4b5dc9325df6506e8 (diff)
downloadfreebsd-ports-gnome-51095d0250c636d58a1353c4d22b56c44322997a.tar.gz
freebsd-ports-gnome-51095d0250c636d58a1353c4d22b56c44322997a.tar.zst
freebsd-ports-gnome-51095d0250c636d58a1353c4d22b56c44322997a.zip
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
-rw-r--r--math/R/Makefile10
-rw-r--r--math/R/files/patch-src_extra_blas_Makefile.in27
-rw-r--r--math/R/files/patch-src_main_Makefile.in19
-rw-r--r--math/R/files/patch-src_modules_lapack_Makefile.in30
-rw-r--r--math/R/pkg-plist3
5 files changed, 88 insertions, 1 deletions
diff --git a/math/R/Makefile b/math/R/Makefile
index cbab2d370882..6644e538217a 100644
--- a/math/R/Makefile
+++ b/math/R/Makefile
@@ -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"
diff --git a/math/R/files/patch-src_extra_blas_Makefile.in b/math/R/files/patch-src_extra_blas_Makefile.in
new file mode 100644
index 000000000000..a2c5e19b4eed
--- /dev/null
+++ b/math/R/files/patch-src_extra_blas_Makefile.in
@@ -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:
diff --git a/math/R/files/patch-src_main_Makefile.in b/math/R/files/patch-src_main_Makefile.in
new file mode 100644
index 000000000000..b922f8c88ff0
--- /dev/null
+++ b/math/R/files/patch-src_main_Makefile.in
@@ -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"
diff --git a/math/R/files/patch-src_modules_lapack_Makefile.in b/math/R/files/patch-src_modules_lapack_Makefile.in
new file mode 100644
index 000000000000..73a9fcf1d2e2
--- /dev/null
+++ b/math/R/files/patch-src_modules_lapack_Makefile.in
@@ -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)"
+
diff --git a/math/R/pkg-plist b/math/R/pkg-plist
index f39ee7267ad9..dc3d3a3f31cb 100644
--- a/math/R/pkg-plist
+++ b/math/R/pkg-plist
@@ -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