pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/math/R



Something like this?

Tried porting as many fixes for configure to configure.ac as it seemed useful, hopefully didn't miss anything important.

On Sun, Sep 10, 2017 at 11:21 PM, Joerg Sonnenberger <joerg%bec.de@localhost> wrote:
On Sun, Sep 10, 2017 at 11:16:38PM +0200, Rumko wrote:
> Would this be better?
> It does seem the necessary tests fail with this on at least my machine and
> the package still builds after applying it.

Try the generic fix as attached. Needs autoconf afterwards.

Joerg

From c406dd0d3ff6c50dbbd0ea1d88deb7072afe41e1 Mon Sep 17 00:00:00 2001
From: Rumko <rumko%netbsd.org@localhost>
Date: Sun, 17 Sep 2017 22:07:45 +0200
Subject: [PATCH] math/R: better fix for fbsd

Also move fixes from configure to configure.ac
m4/R.m4 fix by @joerg
---
 math/R/Makefile                   |   8 +--
 math/R/distinfo                   |   4 +-
 math/R/patches/patch-configure.ac | 114 ++++++++++++++++++++++++++++++++++++++
 math/R/patches/patch-m4_R.m4      |  48 ++++++++++++++++
 4 files changed, 169 insertions(+), 5 deletions(-)
 create mode 100644 math/R/patches/patch-configure.ac
 create mode 100644 math/R/patches/patch-m4_R.m4

diff --git a/math/R/Makefile b/math/R/Makefile
index 32002455ac0..8e053ce2831 100644
--- a/math/R/Makefile
+++ b/math/R/Makefile
@@ -21,6 +21,7 @@ INSTALL_TARGET=               install install-info
 TEST_TARGET=           check
 USE_TOOLS+=            gmake gzip:run makeinfo perl:run sed unzip:run xmkmf
 USE_TOOLS+=            pkg-config
+USE_TOOLS+=            aclocal autoconf autoreconf automake
 USE_LANGUAGES=         c c++ fortran
 USE_LIBTOOL=           yes
 TEXINFO_REQD=          5.1
@@ -46,10 +47,6 @@ CONFIGURE_ARGS+=     --with-system-xz
 CONFIGURE_ARGS+=       --enable-long-double=no
 .endif
 
-# cpow and clog are not implemented on FreeBSD
-CONFIGURE_ENV.FreeBSD+=        ac_cv_have_decl_clog=no
-CONFIGURE_ENV.FreeBSD+=        ac_cv_have_decl_cpow=no
-
 .if ${OPSYS} != "Linux"
 USE_GNU_ICONV=         yes             # latin1 support, iconvlist
 .endif
@@ -141,6 +138,9 @@ BUILDLINK_API_DEPENDS.bzip2+=       bzip2>=1.0.5
 CONFIGURE_ARGS+=       --enable-mbcs=no
 .endif
 
+pre-configure:
+       ${RUN} cd ${WRKSRC} && autoreconf -fvi
+
 # Fix library names.  Relies on build system using -headerpad_max_install_names.
 .if ${OPSYS} == "Darwin"
 .PHONY: fix-darwin-install-name
diff --git a/math/R/distinfo b/math/R/distinfo
index 18837d41151..9fcd63346b8 100644
--- a/math/R/distinfo
+++ b/math/R/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.75 2017/03/11 09:50:34 wen Exp $
+$NetBSD$
 
 SHA1 (R-3.3.3.tar.gz) = 9e205a817970578ecd80384f397bae35b46f13b9
 RMD160 (R-3.3.3.tar.gz) = 5f0d3aa3cf26132ac8774d2589083a12493c18ad
@@ -6,6 +6,8 @@ SHA512 (R-3.3.3.tar.gz) = bcb0d92fc0b22c13e345a2f660e3b3cc5810f6a07c8f2e37949c81
 Size (R-3.3.3.tar.gz) = 29804326 bytes
 SHA1 (patch-ac) = 68c1943a352e6f8b2842331578ed746b1ac27bea
 SHA1 (patch-ad) = a43b4875a2ee4677b5f762abf3f9a623fd12cbb5
+SHA1 (patch-configure.ac) = c3e77e8f7bf784a269d09c937ab1997ef701aa81
+SHA1 (patch-m4_R.m4) = 704d5514e10adf0b5217bb71b06f44a612eca6e0
 SHA1 (patch-src_include_GraphicsBase.h) = eed25eaca982ca76bf75d199dd8bf48be2a99ac5
 SHA1 (patch-src_library_stats_src_Makefile.in) = 4eb93292858392792c37a706399e2cef91821bbe
 SHA1 (patch-src_main_character.c) = 1271cbd68ec57e28cf6a394398d21d6a18b6760b
diff --git a/math/R/patches/patch-configure.ac b/math/R/patches/patch-configure.ac
new file mode 100644
index 00000000000..cf3f904b373
--- /dev/null
+++ b/math/R/patches/patch-configure.ac
@@ -0,0 +1,114 @@
+$NetBSD$
+
+Do not include system paths in R_LD_LIBRARY_PATH.
+NetBSD, FreeBSD, DragonFly, Darwin and Solaris fixes
+
+--- configure.ac.orig  2016-10-04 09:15:04.000000000 +0000
++++ configure.ac
+@@ -33,6 +33,7 @@ m4_define([R_VERSION],
+ AC_INIT([R],[R_VERSION],[https://bugs.r-project.org],[R],[https://www.r-project.org])
+ AC_CONFIG_SRCDIR([src/include/Defn.h])
+ AC_CONFIG_AUX_DIR([tools])
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ ### * Information on the package.
+ 
+@@ -290,7 +291,7 @@ AC_ARG_ENABLE([BLAS-shlib],
+ 
+ ## As from R 3.2.0 split up -L... and -lR
+ if test "${want_R_shlib}" = yes; then
+-  LIBR0="-L\$(R_HOME)/lib\$(R_ARCH)"
++  LIBR0="-Wl,-R${prefix}/lib/R/lib\$(R_ARCH) -L\$(R_HOME)/lib\$(R_ARCH)"
+   LIBR1=-lR
+ else
+   LIBR0=
+@@ -689,7 +690,7 @@ case "${host_os}" in
+     ## Not so bad in later versions of Darwin, 
+     ## where DYLD_FALLBACK_LIBRARY_PATH is used (see below).
+     ;;
+-  *)
++  donotuse*)
+     for arg in ${LDFLAGS}; do
+       case "${arg}" in
+         -L*)
+@@ -1376,7 +1377,7 @@ rm -f libconftest${DYLIB_EXT} conftest.c
+     fpicflags="${darwin_pic}"
+     shlib_cxxldflags="${shlib_ldflags}"
+     ;;
+-  freebsd*)
++  freebsd*|dragonfly*)
+     ## maybe this needs to depend on the compiler:
+     ## -export-dynamic used to work, but does not with clang.
+     ## Seems FreeBSD has used the GNU linker since at least 3.0 (Oct 1998)
+@@ -1472,6 +1473,12 @@ rm -f libconftest${DYLIB_EXT} conftest.c
+     ;;
+   netbsd*)
+     ## See the comments about FreeBSD
++    fpicflags="-fPIC"
++    case "${host_cpu}" in
++      powerpc*)
++      cpicflags="-fPIC"
++      ;;
++    esac
+     if ${CPP} - -dM < /dev/null | grep __ELF__ >/dev/null ; then
+       main_ldflags="-Wl,--export-dynamic"
+       shlib_ldflags="-shared"
+@@ -1514,22 +1521,22 @@ rm -f libconftest${DYLIB_EXT} conftest.c
+   solaris*)
+ ## SPARC has only an 8k global object table, 1024 entries on 64-bit,
+ ## so need PIC not pic.  They are the same on other Solaris platforms.
+-    shlib_ldflags="-G"
+-    shlib_cxxldflags="-G"
+    if test "${GCC}" = yes; then
++      shlib_ldflags="-shared"
++      shlib_cxxldflags="-shared"
+       cpicflags="-fPIC"
+       ld=`${CC} -print-prog-name=ld`
+       ldoutput=`${ld} -v 2>&1 | grep GNU`
+       if test -n "${ldoutput}"; then
+       main_ldflags="-Wl,-export-dynamic"
+-      shlib_ldflags="-shared"
+-        shlib_cxxldflags="-shared"
+       else
+         ## it seems gcc c 4.6.2 needs this with Solaris linker
+       shlib_ldflags="-shared"
+         shlib_cxxldflags="-shared"
+       fi
+     else
++      shlib_ldflags="-G"
++      shlib_cxxldflags="-G"
+       cpicflags="-KPIC"
+       if test "`basename ${CXX}`" = "CC" ; then
+         ## Forte version 7 needs -lCstd: Forte 6 does not.    
+@@ -1584,7 +1591,7 @@ R_SH_VAR_ADD(MAIN_LDFLAGS, [${main_ldfla
+ : ${CPICFLAGS="${cpicflags}"}
+ if test -z "${CPICFLAGS}"; then
+   case "${host_os}" in
+-    aix*|irix*|mingw*|osf*)
++    aix*|irix*|mingw*|osf*|darwin*)
+       ;;
+     *)
+       AC_MSG_WARN([I could not determine CPICFLAGS.])
+@@ -1667,10 +1674,10 @@ case "${host_os}" in
+     DYLIB_EXT=".dylib"
+     dylib_ldflags="${darwin_dylib_ldflags}"
+     MAJR_VERSION=`echo "${PACKAGE_VERSION}" | sed  -e "s/[[\.]][[1-9]]$/.0/"` 
+-    LIBR_LDFLAGS="-install_name libR.dylib -compatibility_version ${MAJR_VERSION}  -current_version ${PACKAGE_VERSION}  -headerpad_max_install_names"
+-    RLAPACK_LDFLAGS="-install_name libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION}  -headerpad_max_install_names"
++    LIBR_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libR.dylib -compatibility_version ${MAJR_VERSION}  -current_version ${PACKAGE_VERSION}  -headerpad_max_install_names"
++    RLAPACK_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION}  -headerpad_max_install_names"
+     ## don't use version in libRblas so we can replace it with any BLAS implementation
+-    RBLAS_LDFLAGS="-install_name libRblas.dylib -headerpad_max_install_names"
++    RBLAS_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRblas.dylib -headerpad_max_install_names"
+     ;;
+   hpux*)
+     ## Needs to avoid embedding a relative path ../../../bin.
+@@ -2582,7 +2589,7 @@ case "${host_os}" in
+     r_ld_library_defaults="/usr/lib64:/lib64:/usr/lib:/lib"
+     ;;
+   solaris*)
+-    r_ld_library_defaults="/usr/lib:/lib"
++    r_ld_library_defaults="/usr/lib:/lib:/usr/lib/amd64:/lib/amd64:/usr/lib/64:/lib/64"
+     ;;
+   *)
+     r_ld_library_defaults=
diff --git a/math/R/patches/patch-m4_R.m4 b/math/R/patches/patch-m4_R.m4
new file mode 100644
index 00000000000..8f1a1ac8df6
--- /dev/null
+++ b/math/R/patches/patch-m4_R.m4
@@ -0,0 +1,48 @@
+$NetBSD$
+
+Ensure tests for clog & co. fail, not just emit warning
+
+--- m4/R.m4.orig       2017-01-05 23:15:05.000000000 +0000
++++ m4/R.m4
+@@ -226,7 +226,7 @@ if test -z "${texi2any_version_maj}" \
+ elif test ${texi2any_version_maj} -gt 5; then
+   r_cv_prog_texi2any_v5=yes
+ elif test ${texi2any_version_maj} -lt 5 \
+-     || test ${texi2any_version_min} -lt 1; then
++     || test ${texi2any_version_maj} = 5 -a ${texi2any_version_min} -lt 1; then
+   r_cv_prog_texi2any_v5=no
+ else
+   r_cv_prog_texi2any_v5=yes
+@@ -1015,6 +1015,9 @@ ${F77} ${FFLAGS} -c conftestf.f 1>&AS_ME
+ 
+ extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y);
+ 
++int MAIN_ () { return 0; }
++int MAIN__ () { return 0; }
++
+ int main () {
+   int a[3] = {17, 237, 2000000000}, b[2], res = 0;
+   double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3];
+@@ -1107,6 +1110,9 @@ typedef struct {
+ 
+ extern void F77_SYMBOL(cftest)(Rcomplex *x);
+ 
++int MAIN_ () { return 0; }
++int MAIN__ () { return 0; }
++
+ int main () {
+     Rcomplex z[3];
+ 
+@@ -3639,9 +3645,9 @@ R_CHECK_FUNCS([cabs carg cexp clog csqrt
+ AC_DEFUN([R_CHECK_DECL],
+ [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
+ AC_CACHE_CHECK([whether $1 exists and is declared], ac_Symbol,
+-[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
+-[#ifndef $1
+-  char *p = (char *) $1;
++[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
++#ifndef $1
++char *p = (char *) $1;
+ #endif
+ ])],
+                    [AS_VAR_SET(ac_Symbol, yes)],
-- 
2.14.1



Home | Main Index | Thread Index | Old Index