Codebase list libpdl-io-matlab-perl / 4f3cc0f
Drop patches, applied/fixed upstream. Bas Couwenberg 3 years ago
8 changed file(s) with 1 addition(s) and 378 deletion(s). Raw diff Collapse all Expand all
44 * Bump Standards-Version to 4.5.1, no changes.
55 * Add libdevel-checklib-perl to build dependencies.
66 * Require at least pdl 2.043.
7 * Drop patches, applied/fixed upstream.
78
89 -- Bas Couwenberg <sebastic@debian.org> Sat, 01 May 2021 12:09:24 +0200
910
+0
-104
debian/patches/0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch less more
0 From: Dima Kogan <dima@secretsauce.net>
1 Date: Sat, 16 Nov 2013 20:30:18 -0800
2 Subject: PDL::IO::Matlab now works with PDL >= 2.007
3 Forwarded: https://github.com/jlapeyre/PDL-IO-Matlab/issues/2
4
5 PDL 2.007 introduced a new type used for dimension sizes. This patch uses that
6 new type. This is a required change to work with newer PDLs. This patch does NOT
7 preserve backwards compatibility with older PDLs.
8 ---
9 convert_matvar_pdl.c | 57 ++++++++++++++++++----------------------------------
10 1 file changed, 20 insertions(+), 37 deletions(-)
11
12 diff --git a/convert_matvar_pdl.c b/convert_matvar_pdl.c
13 index 6cf968a..8f172f8 100644
14 --- a/convert_matvar_pdl.c
15 +++ b/convert_matvar_pdl.c
16 @@ -1,19 +1,4 @@
17 -/*
18 -
19 -Following taken from pdl.h.
20 -This is platform dependent, so I need something more sophisticated.
21 -
22 -enum pdl_datatypes { PDL_B, PDL_S, PDL_US, PDL_L, PDL_LL, PDL_F, PDL_D };
23 -
24 -typedef unsigned char PDL_Byte;
25 -typedef short PDL_Short;
26 -typedef unsigned short PDL_Ushort;
27 -typedef int PDL_Long;
28 -typedef long PDL_LongLong;
29 -typedef float PDL_Float;
30 -typedef double PDL_Double;
31 -
32 -*/
33 +#include <pdl.h>
34
35 static char *matvar_class_type_desc[16] =
36 {"Undefined","Cell Array","Structure",
37 @@ -62,28 +47,26 @@ static int matvar_class_to_pdl_type[16] =
38 };
39
40
41 -/* enum pdl_datatypes { PDL_B, PDL_S, PDL_US, PDL_L, PDL_LL, PDL_F, PDL_D }; */
42 -
43 -static int pdl_type_to_matvar_type[7] =
44 +static int pdl_type_to_matvar_type[] =
45 {
46 - MAT_T_INT8, /* PDL_B */
47 - MAT_T_INT16, /* PDL_S */
48 - MAT_T_UINT16, /* PDL_US */
49 - MAT_T_INT32, /* PDL_L */
50 - MAT_T_INT32, /* PDL_LL */
51 - MAT_T_SINGLE, /* PDL_F */
52 - MAT_T_DOUBLE, /* PDL_D */
53 + [PDL_B] = MAT_T_INT8,
54 + [PDL_S] = MAT_T_INT16,
55 + [PDL_US] = MAT_T_UINT16,
56 + [PDL_L] = MAT_T_INT32,
57 + [PDL_LL] = MAT_T_INT32,
58 + [PDL_F] = MAT_T_SINGLE,
59 + [PDL_D] = MAT_T_DOUBLE,
60 };
61
62 -static int pdl_type_to_matvar_class[7] =
63 +static int pdl_type_to_matvar_class[] =
64 {
65 - MAT_C_INT8, /* PDL_B */
66 - MAT_C_INT16, /* PDL_S */
67 - MAT_C_UINT16, /* PDL_US */
68 - MAT_C_INT32, /* PDL_L */
69 - MAT_C_INT32, /* PDL_LL */
70 - MAT_C_SINGLE, /* PDL_F */
71 - MAT_C_DOUBLE, /* PDL_D */
72 + [PDL_B] = MAT_C_INT8,
73 + [PDL_S] = MAT_C_INT16,
74 + [PDL_US] = MAT_C_UINT16,
75 + [PDL_L] = MAT_C_INT32,
76 + [PDL_LL] = MAT_C_INT32,
77 + [PDL_F] = MAT_C_SINGLE,
78 + [PDL_D] = MAT_C_DOUBLE,
79 };
80
81
82 @@ -96,7 +79,7 @@ static void delete_matvar_to_pdl_data(pdl* p, size_t param)
83
84 typedef void (*DelMagic)(pdl *, size_t param);
85 static void default_magic(pdl *p, size_t pa) { p->data = 0; }
86 -static pdl* my_pdl_wrap(void *data, int datatype, PDL_Long dims[],
87 +static pdl* my_pdl_wrap(void *data, int datatype, PDL_Indx dims[],
88 int ndims, DelMagic delete_magic, int delparam)
89 {
90 pdl* npdl = PDL->pdlnew();
91 @@ -115,10 +98,10 @@ static pdl* matvar_to_pdl (matvar_t * matvar, int onedr) {
92 int ndims = matvar->rank;
93 pdl * piddle;
94 int i, pdl_data_type;
95 - PDL_Long * dims;
96 + PDL_Indx * dims;
97 if ( matvar->isComplex )
98 barf("matvar_to_pdl: Complex matlab variables not supported.");
99 - dims = (PDL_Long *)malloc(sizeof(PDL_Long) * ndims);
100 + dims = (PDL_Indx *)malloc(sizeof(PDL_Indx) * ndims);
101 // fprintf(stderr, "ONEDR %d\n", onedr);
102 if (ndims == 2 && onedr != 0 ) {
103 if (matvar->dims[0] == 1) {
+0
-83
debian/patches/0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch less more
0 From: Dima Kogan <dima@secretsauce.net>
1 Date: Sat, 16 Nov 2013 20:30:41 -0800
2 Subject: I use the libmatio in Debian, so I don't build the one here
3 Forwarded: not-needed
4
5 ---
6 Makefile.PL | 33 ++++-----------------------------
7 matlab.pd | 2 +-
8 2 files changed, 5 insertions(+), 30 deletions(-)
9
10 diff --git a/Makefile.PL b/Makefile.PL
11 index 5feb67e..b765d42 100644
12 --- a/Makefile.PL
13 +++ b/Makefile.PL
14 @@ -5,15 +5,7 @@ use ExtUtils::MakeMaker;
15 use PDL::Core::Dev;
16
17 # Makefile has targets 'cleanall' and 'distcleanall'.
18 -# These do clean and distclean in both module distribution
19 -# toplevel and in $matio_top_level.
20 -
21 -my $matio_top_level = './matio-1.5.0';
22 -
23 -if ( not -e "$matio_top_level/src/matio_pubconf.h" ) {
24 - print "Makefile.PL: running configure in $matio_top_level\n";
25 - system "cd $matio_top_level; ./configure";
26 -}
27 +# These do clean and distclean in module distribution
28
29 my $matlab_package = ['matlab.pd', 'Matlab', 'PDL::IO::Matlab'];
30 my %hash = pdlpp_stdargs($matlab_package);
31 @@ -24,35 +16,18 @@ my %more_items = (
32 VERSION_FROM => 'matlab.pd',
33 ABSTRACT_FROM => 'matlab.pd',
34 PL_FILES => {},
35 - OBJECT => ' Matlab.o matio_obj.o ' ,
36 - LIBS => [ ' -lz -lhdf5 ' ],
37 + LIBS => [ '-lmatio' ],
38 PREREQ_PM => {
39 'Test::More' => 0,
40 'PDL' => 0,
41 },
42 dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
43 - # note the file below that matio Makefile fails to clean.
44 - clean => { FILES => ' PDL-IO-Matlab-* Matlab.* tst.mat testf.mat ' .
45 - $matio_top_level . '/test/atconfig' },
46 + clean => { FILES => ' PDL-IO-Matlab-* Matlab.* tst.mat testf.mat ' },
47 );
48
49 map { $hash{$_} = $more_items{$_} } keys %more_items;
50
51 -# cd $matio_top_level; ./configure
52 -
53 -sub MY::postamble { qq{
54 -
55 -matio_obj.o:
56 - cd $matio_top_level; cd src; \$(MAKE)
57 - ld -r -o matio_obj.o $matio_top_level/src/.libs/*.o
58 -
59 -cleanall: clean
60 - cd $matio_top_level; \$(MAKE) clean
61 -
62 -distcleanall: distclean
63 - cd $matio_top_level; \$(MAKE) distclean
64 -
65 -} . pdlpp_postamble($matlab_package)};
66 +sub MY::postamble { pdlpp_postamble($matlab_package)};
67
68
69 WriteMakefile( %hash );
70 diff --git a/matlab.pd b/matlab.pd
71 index 386774a..d816156 100644
72 --- a/matlab.pd
73 +++ b/matlab.pd
74 @@ -5,7 +5,7 @@ use warnings;
75 our $VERSION = '0.005';
76 pp_setversion("'$VERSION'");
77
78 -my $Matio_src = 'matio-1.5.0/src';
79 +my $Matio_src = '/usr/include';
80
81 # This works nicely, but I am not using it for anything
82 my ($MAT_FT_MAT73,$MAT_FT_MAT5,$MAT_FT_MAT4) = (0,1,2);
+0
-34
debian/patches/0003-printf-format-types-now-use-z-when-printing-size_t-d.patch less more
0 From: Dima Kogan <dima@secretsauce.net>
1 Date: Sat, 16 Nov 2013 20:56:24 -0800
2 Subject: printf format types now use 'z' when printing size_t data
3 Forwarded: https://github.com/jlapeyre/PDL-IO-Matlab/issues/2
4
5 ---
6 extra_matio.c | 6 +++---
7 1 file changed, 3 insertions(+), 3 deletions(-)
8
9 diff --git a/extra_matio.c b/extra_matio.c
10 index bd305c4..673cb0c 100644
11 --- a/extra_matio.c
12 +++ b/extra_matio.c
13 @@ -16,17 +16,17 @@ void extra_matio_print_all_var_info_clumsy(mat_t * matfp) {
14 printf("%-20s", matvar->name);
15 if ( matvar->rank > 0 ) {
16 int cnt = 0;
17 - printf("%8d", matvar->dims[0]);
18 + printf("%8zd", matvar->dims[0]);
19 for ( i = 1; i < matvar->rank; i++ ) {
20 if ( ceil(log10(matvar->dims[i]))+1 < 32 )
21 - cnt += sprintf(size+cnt,"x%d", matvar->dims[i]);
22 + cnt += sprintf(size+cnt,"x%zd", matvar->dims[i]);
23 }
24 printf("%-10s",size);
25 } else {
26 printf(" ");
27 }
28 nbytes = Mat_VarGetSize(matvar);
29 - printf(" %8d",nbytes);
30 + printf(" %8zd",nbytes);
31 printf(" %-18s\n",mxclass[matvar->class_type-1]);
32 Mat_VarPrint(matvar,0);
33 Mat_VarFree(matvar);
+0
-30
debian/patches/0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch less more
0 From: Dima Kogan <dima@secretsauce.net>
1 Date: Sat, 16 Nov 2013 21:52:51 -0800
2 Subject: Make now knows about a source dependency and can rebuild
3 intelligently
4 Forwarded: https://github.com/jlapeyre/PDL-IO-Matlab/issues/2
5
6 ---
7 Makefile.PL | 9 ++++++++-
8 1 file changed, 8 insertions(+), 1 deletion(-)
9
10 diff --git a/Makefile.PL b/Makefile.PL
11 index b765d42..2f1c35f 100644
12 --- a/Makefile.PL
13 +++ b/Makefile.PL
14 @@ -27,7 +27,14 @@ my %more_items = (
15
16 map { $hash{$_} = $more_items{$_} } keys %more_items;
17
18 -sub MY::postamble { pdlpp_postamble($matlab_package)};
19 +sub MY::postamble {
20 + # These are #included, so make now knows to rebuild the .o when these .c
21 + # change
22 + "Matlab.o: extra_matio.c convert_matvar_pdl.c\n" .
23 + pdlpp_postamble($matlab_package)
24 + }
25 +
26 +
27
28
29 WriteMakefile( %hash );
+0
-34
debian/patches/0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch less more
0 From: Dima Kogan <dima@secretsauce.net>
1 Date: Sat, 16 Nov 2013 22:05:42 -0800
2 Subject: removed POD coverage tests. these fail. I notified upstream
3 Forwarded: https://github.com/jlapeyre/PDL-IO-Matlab/issues/2
4
5 ---
6 t/pod-coverage.t | 18 ------------------
7 1 file changed, 18 deletions(-)
8 delete mode 100644 t/pod-coverage.t
9
10 diff --git a/t/pod-coverage.t b/t/pod-coverage.t
11 deleted file mode 100644
12 index fc40a57..0000000
13 --- a/t/pod-coverage.t
14 +++ /dev/null
15 @@ -1,18 +0,0 @@
16 -use strict;
17 -use warnings;
18 -use Test::More;
19 -
20 -# Ensure a recent version of Test::Pod::Coverage
21 -my $min_tpc = 1.08;
22 -eval "use Test::Pod::Coverage $min_tpc";
23 -plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
24 - if $@;
25 -
26 -# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
27 -# but older versions don't recognize some common documentation styles
28 -my $min_pc = 0.18;
29 -eval "use Pod::Coverage $min_pc";
30 -plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
31 - if $@;
32 -
33 -all_pod_coverage_ok();
+0
-87
debian/patches/pod.patch less more
0 Description: Fix FTBFS due to pod sections embedded in pp_addxs commands.
1 Author: Bas Couwenberg <sebastic@debian.org>
2 Bug-Debian: https://bugs.debian.org/952305
3 Forwarded: not-needed
4
5 --- a/matlab.pd
6 +++ b/matlab.pd
7 @@ -869,38 +869,12 @@ if (RETVAL == -1) barf("PDL::IO::Matlab:
8 OUTPUT:
9 RETVAL
10
11 -=pod
12 -
13 -int
14 -_my_mat_feof(mat)
15 -mat_t * mat
16 -CODE:
17 -RETVAL = feof(mat->fp);
18 -OUTPUT:
19 -RETVAL
20 -
21 -=cut
22 -
23 -
24 ');
25
26
27
28 pp_addxs ( '', '
29
30 -=pod
31 -
32 -void
33 -_extra_matio_print_all_var_info_new (matfp,printdata,max_cols,max_rows)
34 -mat_t * matfp
35 -int printdata
36 -int max_cols
37 -int max_rows
38 -CODE:
39 -extra_matio_print_all_var_info (matfp,printdata,max_cols,max_rows);
40 -
41 -=cut
42 -
43 void
44 _extra_matio_print_all_var_info (matfp,printdata)
45 mat_t * matfp
46 @@ -908,17 +882,6 @@ int printdata
47 CODE:
48 extra_matio_print_all_var_info(matfp,printdata);
49
50 -=pod
51 -
52 -following was a PITA. This returns undef if the
53 -reading matvar failed. The library does not seem
54 -to provide any way to detect EOF.
55 -
56 -Important not to use fprintf in this XS code. Can
57 -cause segfault.
58 -
59 -=cut
60 -
61 void
62 _convert_next_matvar_to_pdl(matfp,onedr)
63 mat_t * matfp
64 @@ -938,22 +901,6 @@ XPUSHs(p);
65 XPUSHs(s);
66
67
68 -=pod
69 -
70 -old method
71 -pdl *
72 -disa_convert_next_matvar_to_pdl(matfp)
73 -mat_t * matfp
74 -CODE:
75 -pdl * retval;
76 -matvar_t * matvar;
77 -retval = convert_next_matvar_to_pdl(matfp, &matvar);
78 -Mat_VarFree(matvar);
79 -ST(0) = sv_newmortal();
80 -if (retval != NULL) PDL->SetSV_PDL(ST(0),retval);
81 -
82 -=cut
83 -
84 int
85 _write_pdl_to_matlab_file (mat, piddle, varname, oned, compress)
86 mat_t * mat
+0
-6
debian/patches/series less more
0 0001-PDL-IO-Matlab-now-works-with-PDL-2.007.patch
1 0002-I-use-the-libmatio-in-Debian-so-I-don-t-build-the-on.patch
2 0003-printf-format-types-now-use-z-when-printing-size_t-d.patch
3 0004-Make-now-knows-about-a-source-dependency-and-can-reb.patch
4 0005-removed-POD-coverage-tests.-these-fail.-I-notified-u.patch
5 pod.patch