pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/math/ruby-gsl Fix build problem with ruby21.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/07fde9267a0f
branches:  trunk
changeset: 632368:07fde9267a0f
user:      taca <taca%pkgsrc.org@localhost>
date:      Wed Mar 26 13:25:26 2014 +0000

description:
Fix build problem with ruby21.

diffstat:

 math/ruby-gsl/PLIST                                   |   3 +-
 math/ruby-gsl/distinfo                                |   8 +-
 math/ruby-gsl/patches/patch-ext_linalg.c              |  89 +++++++++++++++++++
 math/ruby-gsl/patches/patch-ext_linalg__complex.c     |  32 ++++++
 math/ruby-gsl/patches/patch-ext_ool.c                 |  18 +++
 math/ruby-gsl/patches/patch-ext_vector__complex.c     |  29 ++++++
 math/ruby-gsl/patches/patch-ext_vector__source.c      |  49 ++++++++++
 math/ruby-gsl/patches/patch-include_rb__gsl__common.h |  18 +++
 8 files changed, 244 insertions(+), 2 deletions(-)

diffs (288 lines):

diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/PLIST
--- a/math/ruby-gsl/PLIST       Wed Mar 26 13:24:52 2014 +0000
+++ b/math/ruby-gsl/PLIST       Wed Mar 26 13:25:26 2014 +0000
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST,v 1.5 2013/03/11 12:28:46 taca Exp $
+@comment $NetBSD: PLIST,v 1.6 2014/03/26 13:25:26 taca Exp $
 ${GEM_HOME}/cache/${GEM_NAME}.gem
+${GEM_EXTSDIR}/rb_gsl.${RUBY_DLEXT}
 ${GEM_LIBDIR}/AUTHORS
 ${GEM_LIBDIR}/COPYING
 ${GEM_LIBDIR}/ChangeLog
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/distinfo
--- a/math/ruby-gsl/distinfo    Wed Mar 26 13:24:52 2014 +0000
+++ b/math/ruby-gsl/distinfo    Wed Mar 26 13:25:26 2014 +0000
@@ -1,7 +1,13 @@
-$NetBSD: distinfo,v 1.7 2013/08/04 16:42:11 taca Exp $
+$NetBSD: distinfo,v 1.8 2014/03/26 13:25:26 taca Exp $
 
 SHA1 (gsl-1.15.3.gem) = c3e3d8d47d4e456bcc40be9f43f7da2667622ed5
 RMD160 (gsl-1.15.3.gem) = 73d5d601c4ace8c5a0cabd4bab6045191d1a4077
 Size (gsl-1.15.3.gem) = 620032 bytes
 SHA1 (patch-ext_fft.c) = cee5d2d4a9caac1125720ed257c73074d9151be6
+SHA1 (patch-ext_linalg.c) = 57f703d217c1eda3be5e958757a89b9af9804fbb
+SHA1 (patch-ext_linalg__complex.c) = e375a361cf51afb3674288cebe911b58b9d43b6e
+SHA1 (patch-ext_ool.c) = 0b4857278e2496c8f6938d355dd6d9acd24362b6
+SHA1 (patch-ext_vector__complex.c) = 9d9d3140ffb48095d79eccc96a667f216030de20
+SHA1 (patch-ext_vector__source.c) = 3db7be2d542348d407e4f821026cffcd439b0177
 SHA1 (patch-ext_wavelet.c) = f152a903a76a84c1ff86c6917d4c68ce50c4f81e
+SHA1 (patch-include_rb__gsl__common.h) = 27b22b77056aead09da74cf284983afd64f89be7
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-ext_linalg.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-ext_linalg.c  Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,89 @@
+$NetBSD: patch-ext_linalg.c,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- ext/linalg.c.orig  2014-03-25 15:47:30.000000000 +0000
++++ ext/linalg.c
+@@ -71,7 +71,11 @@ static VALUE rb_gsl_linalg_LU_decomposit
+   Data_Get_Struct(omatrix, gsl_matrix, mtmp);
+   if (flag == LINALG_DECOMP_BANG) {
+     m = mtmp;
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(omatrix, cgsl_matrix_LU);
++#else
+     RBASIC(omatrix)->klass = cgsl_matrix_LU;
++#endif
+     objm = omatrix;
+   } else {
+     m = make_matrix_clone(mtmp);
+@@ -692,7 +696,11 @@ static VALUE rb_gsl_linalg_QR_LQ_decompo
+     fdecomp = &gsl_linalg_QR_decomp;
+     m = mtmp;
+     mdecomp = omatrix;
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(mdecomp, cgsl_matrix_QR);
++#else
+     RBASIC(mdecomp)->klass = cgsl_matrix_QR;
++#endif
+     break;
+ #ifdef GSL_1_6_LATER
+   case LINALG_LQ_DECOMP:
+@@ -704,7 +712,11 @@ static VALUE rb_gsl_linalg_QR_LQ_decompo
+     fdecomp = &gsl_linalg_LQ_decomp;
+     m = mtmp;
+     mdecomp = omatrix;
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(mdecomp, cgsl_matrix_LQ);
++#else
+     RBASIC(mdecomp)->klass = cgsl_matrix_LQ;
++#endif
+     break;
+ #endif
+   default:
+@@ -731,7 +743,11 @@ static VALUE rb_gsl_linalg_QR_LQ_decompo
+       vtau = Data_Wrap_Struct(cgsl_vector_tau, 0, gsl_vector_free, tau);
+       return rb_ary_new3(2, mdecomp, vtau);
+     } else {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++      rb_obj_reveal(argv[itmp], cgsl_vector_tau);
++#else
+       RBASIC(argv[itmp])->klass = cgsl_vector_tau;
++#endif
+       return mdecomp;
+     }
+     break;
+@@ -740,7 +756,11 @@ static VALUE rb_gsl_linalg_QR_LQ_decompo
+    if (argc == itmp) {
+       return Data_Wrap_Struct(cgsl_vector_tau, 0, gsl_vector_free, tau);
+     } else {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++      rb_obj_reveal(argv[itmp], cgsl_vector_tau);
++#else
+       RBASIC(argv[itmp])->klass = cgsl_vector_tau;
++#endif
+       return INT2FIX(status);
+     }
+     break;
+@@ -1628,14 +1648,22 @@ static VALUE rb_gsl_linalg_QRLQPT_decomp
+   norm = gsl_vector_alloc(size0);
+   switch (flag) {
+   case LINALG_QRPT:
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(vA, cgsl_matrix_QRPT);
++#else
+     RBASIC(vA)->klass = cgsl_matrix_QRPT;
++#endif
+     vtau = Data_Wrap_Struct(cgsl_vector_tau, 0, gsl_vector_free, tau);
+     vp = Data_Wrap_Struct(cgsl_permutation, 0, gsl_permutation_free, p);
+     gsl_linalg_QRPT_decomp(A, tau, p, &signum, norm);
+     break;
+ #ifdef GSL_1_6_LATER
+   case LINALG_PTLQ:
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(vA, cgsl_matrix_PTLQ);
++#else
+     RBASIC(vA)->klass = cgsl_matrix_PTLQ;
++#endif
+     vtau = Data_Wrap_Struct(cgsl_vector_tau, 0, gsl_vector_free, tau);
+     vp = Data_Wrap_Struct(cgsl_permutation, 0, gsl_permutation_free, p);
+     gsl_linalg_PTLQ_decomp(A, tau, p, &signum, norm);
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-ext_linalg__complex.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-ext_linalg__complex.c Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-ext_linalg__complex.c,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- ext/linalg_complex.c.orig  2014-03-25 15:47:30.000000000 +0000
++++ ext/linalg_complex.c
+@@ -51,8 +51,12 @@ VALUE rb_gsl_linalg_complex_LU_decomp(in
+   case 0:
+     p = gsl_permutation_alloc(size);
+     gsl_linalg_complex_LU_decomp(m, p, &signum);
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++      rb_obj_reveal((itmp == 1)? argv[0]: obj, cgsl_matrix_complex_LU);
++#else
+     if (itmp == 1) RBASIC(argv[0])->klass = cgsl_matrix_complex_LU;
+     else RBASIC(obj)->klass = cgsl_matrix_complex_LU;
++#endif
+     obj2 = Data_Wrap_Struct(cgsl_permutation, 0, gsl_permutation_free, p);
+     return rb_ary_new3(2, obj2, INT2FIX(signum));
+     break;
+@@ -60,8 +64,12 @@ VALUE rb_gsl_linalg_complex_LU_decomp(in
+     CHECK_PERMUTATION(argv[itmp]);
+     Data_Get_Struct(argv[itmp], gsl_permutation, p);
+     gsl_linalg_complex_LU_decomp(m, p, &signum);
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal((itmp == 1)? argv[0]: obj, cgsl_matrix_complex_LU);
++#else
+     if (itmp == 1) RBASIC(argv[0])->klass = cgsl_matrix_complex_LU;
+     else RBASIC(obj)->klass = cgsl_matrix_complex_LU;
++#endif
+     return INT2FIX(signum);
+     break;
+   default:
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-ext_ool.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-ext_ool.c     Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-ext_ool.c,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- ext/ool.c.orig     2014-03-25 15:47:30.000000000 +0000
++++ ext/ool.c
+@@ -770,7 +770,11 @@ static VALUE rb_ool_conmin_pgrad_paramet
+       VALUE ary;
+       ool_conmin_parameters_default(ool_conmin_minimizer_pgrad, (void*) &P);
+       ary = create_parameters_ary_pgrad(&P);
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++      rb_obj_reveal(ary, cool_conmin_pgrad_parameters);
++#else
+       RBASIC(ary)->klass = cool_conmin_pgrad_parameters;
++#endif
+       return ary;
+ }
+ 
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-ext_vector__complex.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-ext_vector__complex.c Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-ext_vector__complex.c,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- ext/vector_complex.c.orig  2014-03-25 15:47:30.000000000 +0000
++++ ext/vector_complex.c
+@@ -938,11 +938,19 @@ static VALUE rb_gsl_vector_complex_trans
+ 
+ static VALUE rb_gsl_vector_complex_trans2(VALUE obj)
+ {
+-  if (CLASS_OF(obj) == cgsl_vector_complex) 
++  if (CLASS_OF(obj) == cgsl_vector_complex) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector_complex_col);
++#else
+     RBASIC(obj)->klass = cgsl_vector_complex_col;
+-  else if (CLASS_OF(obj) == cgsl_vector_complex_col) 
++#endif
++  } else if (CLASS_OF(obj) == cgsl_vector_complex_col) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector_complex);
++#else
+     RBASIC(obj)->klass = cgsl_vector_complex;
+-  else {
++#endif
++  } else {
+     rb_raise(rb_eRuntimeError, "method trans! for %s is forbidden",
+            rb_class2name(CLASS_OF(obj)));
+   }
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-ext_vector__source.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-ext_vector__source.c  Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,49 @@
+$NetBSD: patch-ext_vector__source.c,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- ext/vector_source.c.orig   2014-03-25 15:47:30.000000000 +0000
++++ ext/vector_source.c
+@@ -673,16 +673,36 @@ static VALUE FUNCTION(rb_gsl_vector,tran
+ static VALUE FUNCTION(rb_gsl_vector,trans_bang)(VALUE obj)
+ {
+ #ifdef BASE_DOUBLE
+-  if (CLASS_OF(obj) == cgsl_vector) RBASIC(obj)->klass = cgsl_vector_col;
+-  else if (CLASS_OF(obj) == cgsl_vector_col) RBASIC(obj)->klass = cgsl_vector;
+-  else {
++  if (CLASS_OF(obj) == cgsl_vector) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector_col);
++#else
++    RBASIC(obj)->klass = cgsl_vector_col;
++#endif
++  } else if (CLASS_OF(obj) == cgsl_vector_col) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector);
++#else
++    RBASIC(obj)->klass = cgsl_vector;
++#endif
++  } else {
+     rb_raise(rb_eRuntimeError, "method trans! for %s is not permitted.",
+            rb_class2name(CLASS_OF(obj)));
+   }   
+ #elif defined(BASE_INT)
+-  if (CLASS_OF(obj) == cgsl_vector_int) RBASIC(obj)->klass = cgsl_vector_int_col;
+-  else if (CLASS_OF(obj) == cgsl_vector_int_col) RBASIC(obj)->klass = cgsl_vector_int;
+-  else {
++  if (CLASS_OF(obj) == cgsl_vector_int) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector_int_col);
++#else
++    RBASIC(obj)->klass = cgsl_vector_int_col;
++#endif
++  } else if (CLASS_OF(obj) == cgsl_vector_int_col) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++    rb_obj_reveal(obj, cgsl_vector_int);
++#else
++    RBASIC(obj)->klass = cgsl_vector_int;
++#endif
++  } else {
+     rb_raise(rb_eRuntimeError, "method trans! for %s is not permitted.",
+            rb_class2name(CLASS_OF(obj)));
+   }
diff -r 08a6098aa5e8 -r 07fde9267a0f math/ruby-gsl/patches/patch-include_rb__gsl__common.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/ruby-gsl/patches/patch-include_rb__gsl__common.h     Wed Mar 26 13:25:26 2014 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-include_rb__gsl__common.h,v 1.1 2014/03/26 13:25:26 taca Exp $
+
+Fix for Ruby 2.1.
+
+--- include/rb_gsl_common.h.orig       2014-03-25 15:47:30.000000000 +0000
++++ include/rb_gsl_common.h
+@@ -14,6 +14,11 @@
+ 
+ #include "rb_gsl_config.h"
+ #include "ruby.h"
++#ifdef HAVE_RUBY_IO_H
++#include "ruby/version.h"
++#else
++#include "version.h"
++#endif
+ #include <ctype.h>
+ #include <gsl/gsl_errno.h>
+ #include <gsl/gsl_version.h>



Home | Main Index | Thread Index | Old Index