From 6d7856809ae4cf2d9685230d2a648ce6e7542d74 Mon Sep 17 00:00:00 2001 From: barracuda156 Date: Sat, 1 Jun 2024 23:02:45 +0800 Subject: [PATCH] R-rtmpt: fix path to gsl --- R/R-rtmpt/Portfile | 9 ++++++++- R/R-rtmpt/files/patch-fix-gsl-path.diff | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 R/R-rtmpt/files/patch-fix-gsl-path.diff diff --git a/R/R-rtmpt/Portfile b/R/R-rtmpt/Portfile index 58e7966e51de8..58ed04ce5de01 100644 --- a/R/R-rtmpt/Portfile +++ b/R/R-rtmpt/Portfile @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup R 1.0 R.setup cran raphael.hartmann rtmpt 2.0-1 -revision 2 +revision 3 categories-append math maintainers {@barracuda156 gmail.com:vital.had} openmaintainer license GPL-2+ @@ -26,6 +26,13 @@ depends_lib-append port:gsl \ # error: 'isnan' was not declared in this scope; did you mean 'std::isnan'? patchfiles patch-fix-math.diff +# Avoid brewisms to ensure correct linking. +patchfiles-append patch-fix-gsl-path.diff + +post-patch { + reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/Makevars +} + depends_test-append port:R-knitr \ port:R-rmarkdown diff --git a/R/R-rtmpt/files/patch-fix-gsl-path.diff b/R/R-rtmpt/files/patch-fix-gsl-path.diff new file mode 100644 index 0000000000000..6cd87452b83d7 --- /dev/null +++ b/R/R-rtmpt/files/patch-fix-gsl-path.diff @@ -0,0 +1,11 @@ +--- src/Makevars 2023-12-11 23:53:04.000000000 +0800 ++++ src/Makevars 2024-06-01 22:51:53.000000000 +0800 +@@ -1,6 +1,6 @@ + # copied from sources of R package gsl +-GSL_CFLAGS = -I/usr/local/include +-GSL_LIBS = -L/usr/local/lib -lgsl -lgslcblas ++GSL_CFLAGS = -I@PREFIX@/include ++GSL_LIBS = -L@PREFIX@/lib -lgsl -lgslcblas + + # combine to standard arguments for R + PKG_CFLAGS = $(GSL_CFLAGS)