[libpdl-io-matlab-perl] 02/02: added debian patches

Dima Kogan dima at secretsauce.net
Fri Nov 22 05:19:50 UTC 2013


This is an automated email from the git hooks/post-receive script.

dkogan-guest pushed a commit to branch master
in repository libpdl-io-matlab-perl.

commit 811386f2749409963491e45c48e6505c1e1e7d74
Author: Dima Kogan <dima at secretsauce.net>
Date:   Sat Nov 16 20:31:25 2013 -0800

    added debian patches
---
 ...01-PDL-IO-Matlab-now-works-with-PDL-2.007.patch |  103 ++++++++++++++++++++
 ...ibmatio-in-Debian-so-I-don-t-build-the-on.patch |   82 ++++++++++++++++
 ...at-types-now-use-z-when-printing-size_t-d.patch |   33 +++++++
 ...ows-about-a-source-dependency-and-can-reb.patch |   29 ++++++
 ...-coverage-tests.-these-fail.-I-notified-u.patch |   33 +++++++
 debian/patches/series                              |    5 +
 6 files changed, 285 insertions(+)

diff --git a/debian/patches/0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch b/debian/patches/0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch
new file mode 100644
index 0000000..4e64e7c
--- /dev/null
+++ b/debian/patches/0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch
@@ -0,0 +1,103 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Sat, 16 Nov 2013 20:30:18 -0800
+Subject: PDL::IO::Matlab now works with PDL >= 2.007
+
+PDL 2.007 introduced a new type used for dimension sizes. This patch uses that
+new type. This is a required change to work with newer PDLs. This patch does NOT
+preserve backwards compatibility with older PDLs.
+---
+ convert_matvar_pdl.c | 57 ++++++++++++++++++----------------------------------
+ 1 file changed, 20 insertions(+), 37 deletions(-)
+
+diff --git a/convert_matvar_pdl.c b/convert_matvar_pdl.c
+index 6cf968a..8f172f8 100644
+--- a/convert_matvar_pdl.c
++++ b/convert_matvar_pdl.c
+@@ -1,19 +1,4 @@
+-/*
+-
+-Following taken from pdl.h.
+-This is platform dependent, so I need something more sophisticated.
+-
+-enum pdl_datatypes { PDL_B, PDL_S, PDL_US, PDL_L, PDL_LL, PDL_F, PDL_D };
+-
+-typedef unsigned char      PDL_Byte;
+-typedef short              PDL_Short;
+-typedef unsigned short     PDL_Ushort;
+-typedef int                PDL_Long;
+-typedef long               PDL_LongLong;
+-typedef float              PDL_Float;
+-typedef double             PDL_Double;
+-
+-*/
++#include <pdl.h>
+ 
+ static char *matvar_class_type_desc[16] = 
+   {"Undefined","Cell Array","Structure",
+@@ -62,28 +47,26 @@ static int  matvar_class_to_pdl_type[16] =
+   };
+ 
+ 
+-/* enum pdl_datatypes { PDL_B, PDL_S, PDL_US, PDL_L, PDL_LL, PDL_F, PDL_D }; */
+-
+-static int  pdl_type_to_matvar_type[7] = 
++static int  pdl_type_to_matvar_type[] =
+   {
+-       MAT_T_INT8, /* PDL_B */
+-      MAT_T_INT16, /* PDL_S */
+-     MAT_T_UINT16, /* PDL_US */
+-      MAT_T_INT32, /* PDL_L */
+-      MAT_T_INT32, /* PDL_LL */
+-     MAT_T_SINGLE, /* PDL_F */
+-     MAT_T_DOUBLE, /* PDL_D */
++    [PDL_B]  = MAT_T_INT8,
++    [PDL_S]  = MAT_T_INT16,
++    [PDL_US] = MAT_T_UINT16,
++    [PDL_L]  = MAT_T_INT32,
++    [PDL_LL] = MAT_T_INT32,
++    [PDL_F]  = MAT_T_SINGLE,
++    [PDL_D]  = MAT_T_DOUBLE,
+   };
+ 
+-static int  pdl_type_to_matvar_class[7] = 
++static int  pdl_type_to_matvar_class[] =
+   {
+-       MAT_C_INT8, /* PDL_B */
+-      MAT_C_INT16, /* PDL_S */
+-     MAT_C_UINT16, /* PDL_US */
+-      MAT_C_INT32, /* PDL_L */
+-      MAT_C_INT32, /* PDL_LL */
+-     MAT_C_SINGLE, /* PDL_F */
+-     MAT_C_DOUBLE, /* PDL_D */
++    [PDL_B]  = MAT_C_INT8,
++    [PDL_S]  = MAT_C_INT16,
++    [PDL_US] = MAT_C_UINT16,
++    [PDL_L]  = MAT_C_INT32,
++    [PDL_LL] = MAT_C_INT32,
++    [PDL_F]  = MAT_C_SINGLE,
++    [PDL_D]  = MAT_C_DOUBLE,
+   };
+ 
+ 
+@@ -96,7 +79,7 @@ static void delete_matvar_to_pdl_data(pdl* p, size_t param)
+ 
+ typedef void (*DelMagic)(pdl *, size_t param);
+ static void default_magic(pdl *p, size_t  pa) { p->data = 0; }
+-static pdl* my_pdl_wrap(void *data, int datatype, PDL_Long dims[],
++static pdl* my_pdl_wrap(void *data, int datatype, PDL_Indx dims[],
+                         int ndims, DelMagic delete_magic, int delparam)
+ {
+   pdl* npdl = PDL->pdlnew();
+@@ -115,10 +98,10 @@ static pdl* matvar_to_pdl (matvar_t * matvar, int onedr) {
+   int ndims = matvar->rank;
+   pdl * piddle;
+   int i, pdl_data_type;
+-  PDL_Long * dims;
++  PDL_Indx * dims;
+   if ( matvar->isComplex )
+     barf("matvar_to_pdl: Complex matlab variables not supported.");
+-  dims = (PDL_Long *)malloc(sizeof(PDL_Long) * ndims);
++  dims = (PDL_Indx *)malloc(sizeof(PDL_Indx) * ndims);
+   //  fprintf(stderr, "ONEDR %d\n", onedr);
+   if (ndims == 2 && onedr != 0 ) {
+     if (matvar->dims[0] == 1) {
diff --git a/debian/patches/0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch b/debian/patches/0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch
new file mode 100644
index 0000000..c2998ee
--- /dev/null
+++ b/debian/patches/0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch
@@ -0,0 +1,82 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Sat, 16 Nov 2013 20:30:41 -0800
+Subject: I use the libmatio in Debian, so I don't build the one here
+
+---
+ Makefile.PL | 33 ++++-----------------------------
+ matlab.pd   |  2 +-
+ 2 files changed, 5 insertions(+), 30 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 5feb67e..b765d42 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -5,15 +5,7 @@ use ExtUtils::MakeMaker;
+ use PDL::Core::Dev;
+ 
+ # Makefile has targets 'cleanall' and 'distcleanall'.
+-# These do clean and distclean in both module distribution
+-# toplevel and in $matio_top_level.
+-
+-my $matio_top_level = './matio-1.5.0';
+-
+-if ( not -e "$matio_top_level/src/matio_pubconf.h" ) {
+-    print "Makefile.PL: running configure in $matio_top_level\n";
+-    system "cd $matio_top_level; ./configure";
+-}
++# These do clean and distclean in module distribution
+ 
+ my $matlab_package = ['matlab.pd', 'Matlab', 'PDL::IO::Matlab'];
+ my %hash = pdlpp_stdargs($matlab_package);
+@@ -24,35 +16,18 @@ my %more_items = (
+     VERSION_FROM        => 'matlab.pd',
+     ABSTRACT_FROM       => 'matlab.pd',
+     PL_FILES            => {},
+-    OBJECT  =>  ' Matlab.o matio_obj.o ' ,
+-    LIBS => [ ' -lz -lhdf5 ' ],
++    LIBS => [ '-lmatio' ],
+     PREREQ_PM => {
+         'Test::More' => 0,
+         'PDL' => 0,
+     },
+     dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+-    # note the file below that matio Makefile fails to clean.
+-    clean               => { FILES => ' PDL-IO-Matlab-* Matlab.* tst.mat testf.mat ' . 
+-                                 $matio_top_level . '/test/atconfig' },
++    clean               => { FILES => ' PDL-IO-Matlab-* Matlab.* tst.mat testf.mat ' },
+ );
+ 
+ map { $hash{$_} = $more_items{$_} } keys %more_items;
+ 
+-#	cd $matio_top_level; ./configure
+-
+-sub MY::postamble {   qq{
+-
+-matio_obj.o:
+-	cd $matio_top_level; cd src; \$(MAKE)
+-	ld -r -o matio_obj.o $matio_top_level/src/.libs/*.o
+-
+-cleanall: clean
+-	cd $matio_top_level; \$(MAKE) clean
+-
+-distcleanall: distclean
+-	cd $matio_top_level; \$(MAKE) distclean
+-
+-}  . pdlpp_postamble($matlab_package)};
++sub MY::postamble {  pdlpp_postamble($matlab_package)};
+ 
+ 
+ WriteMakefile( %hash );
+diff --git a/matlab.pd b/matlab.pd
+index 386774a..d816156 100644
+--- a/matlab.pd
++++ b/matlab.pd
+@@ -5,7 +5,7 @@ use warnings;
+ our $VERSION = '0.005';
+ pp_setversion("'$VERSION'");
+ 
+-my $Matio_src = 'matio-1.5.0/src';
++my $Matio_src = '/usr/include';
+ 
+ # This works nicely, but I am not using it for anything
+ my ($MAT_FT_MAT73,$MAT_FT_MAT5,$MAT_FT_MAT4) = (0,1,2);
diff --git a/debian/patches/0003-printf-format-types-now-use-z-when-printing-size_t-d.patch b/debian/patches/0003-printf-format-types-now-use-z-when-printing-size_t-d.patch
new file mode 100644
index 0000000..2dd933d
--- /dev/null
+++ b/debian/patches/0003-printf-format-types-now-use-z-when-printing-size_t-d.patch
@@ -0,0 +1,33 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Sat, 16 Nov 2013 20:56:24 -0800
+Subject: printf format types now use 'z' when printing size_t data
+
+---
+ extra_matio.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/extra_matio.c b/extra_matio.c
+index bd305c4..673cb0c 100644
+--- a/extra_matio.c
++++ b/extra_matio.c
+@@ -16,17 +16,17 @@ void extra_matio_print_all_var_info_clumsy(mat_t * matfp) {
+     printf("%-20s", matvar->name);
+     if ( matvar->rank > 0 ) {
+       int cnt = 0;
+-      printf("%8d", matvar->dims[0]);
++      printf("%8zd", matvar->dims[0]);
+       for ( i = 1; i < matvar->rank; i++ ) {
+         if ( ceil(log10(matvar->dims[i]))+1 < 32 )
+-          cnt += sprintf(size+cnt,"x%d", matvar->dims[i]);
++          cnt += sprintf(size+cnt,"x%zd", matvar->dims[i]);
+       }
+       printf("%-10s",size);
+     } else {
+       printf("                    ");
+     }
+     nbytes = Mat_VarGetSize(matvar);
+-    printf("  %8d",nbytes);
++    printf("  %8zd",nbytes);
+     printf("         %-18s\n",mxclass[matvar->class_type-1]);
+     Mat_VarPrint(matvar,0);
+     Mat_VarFree(matvar);
diff --git a/debian/patches/0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch b/debian/patches/0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch
new file mode 100644
index 0000000..4ce05b8
--- /dev/null
+++ b/debian/patches/0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch
@@ -0,0 +1,29 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Sat, 16 Nov 2013 21:52:51 -0800
+Subject: Make now knows about a source dependency and can rebuild
+ intelligently
+
+---
+ Makefile.PL | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index b765d42..2f1c35f 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -27,7 +27,14 @@ my %more_items = (
+ 
+ map { $hash{$_} = $more_items{$_} } keys %more_items;
+ 
+-sub MY::postamble {  pdlpp_postamble($matlab_package)};
++sub MY::postamble {
++  # These are #included, so make now knows to rebuild the .o when these .c
++  # change
++  "Matlab.o: extra_matio.c convert_matvar_pdl.c\n" .
++    pdlpp_postamble($matlab_package)
++  }
++
++
+ 
+ 
+ WriteMakefile( %hash );
diff --git a/debian/patches/0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch b/debian/patches/0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch
new file mode 100644
index 0000000..cc7269e
--- /dev/null
+++ b/debian/patches/0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch
@@ -0,0 +1,33 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Sat, 16 Nov 2013 22:05:42 -0800
+Subject: removed POD coverage tests. these fail. I notified upstream
+
+---
+ t/pod-coverage.t | 18 ------------------
+ 1 file changed, 18 deletions(-)
+ delete mode 100644 t/pod-coverage.t
+
+diff --git a/t/pod-coverage.t b/t/pod-coverage.t
+deleted file mode 100644
+index fc40a57..0000000
+--- a/t/pod-coverage.t
++++ /dev/null
+@@ -1,18 +0,0 @@
+-use strict;
+-use warnings;
+-use Test::More;
+-
+-# Ensure a recent version of Test::Pod::Coverage
+-my $min_tpc = 1.08;
+-eval "use Test::Pod::Coverage $min_tpc";
+-plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
+-    if $@;
+-
+-# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
+-# but older versions don't recognize some common documentation styles
+-my $min_pc = 0.18;
+-eval "use Pod::Coverage $min_pc";
+-plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
+-    if $@;
+-
+-all_pod_coverage_ok();
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2abc802
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch
+0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch
+0003-printf-format-types-now-use-z-when-printing-size_t-d.patch
+0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch
+0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libpdl-io-matlab-perl.git



More information about the Pkg-perl-cvs-commits mailing list