Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Build.PL picks up libcdio's CFLAGS now. Correct 07.iso.t test. These …

…changes from Jerry G Geiger.

Remove code for pre libcdio 0.77. Versions this far back are hopeless.
  • Loading branch information...
commit 7bbe2cbbfbc9d5d32315b92e857869481a452e3c 1 parent 40bd065
R. Bernstein authored

Showing 4 changed files with 55 additions and 72 deletions. Show diff stats Hide diff stats

  1. +24 24 Build.PL
  2. +16 18 META.yml
  3. +4 10 t/06.bincue.t
  4. +11 20 t/07.iso.t
48 Build.PL
@@ -76,8 +76,9 @@ my $class = Module::Build->subclass( class => 'MyModuleBuild',
76 76 my $pmfile = File::Spec->catfile($lib,"$basename.pm");
77 77 if($self->up_to_date($swigdeps->{$file}, $cfile)) {
78 78 next if $self->up_to_date($file, $cfile) &&
79   - $self->up_to_date($cfile, $pmfile);
  79 + $self->up_to_date($cfile, $pmfile);
80 80 }
  81 + print "swig: $file -> $cfile\n" if $verb;
81 82 $self->do_system('swig', '-o', $cfile, '-perl', '-outdir',
82 83 $lib, @swig_flags, $file);
83 84 $self->copy_if_modified(from => $pmfile, to_dir => 'blib');
@@ -120,8 +121,7 @@ my $class = Module::Build->subclass( class => 'MyModuleBuild',
120 121
121 122 my $builder = $class->new(
122 123 module_name => 'Device::Cdio',
123   - add_to_cleanup => [ 'Device-Cdio-*', 'tmp*', 'cover_db',
124   - 'lib/perl*.pm', '*.so', '*.c', '*.o' ],
  124 + add_to_cleanup => [ 'Device-Cdio-*', 'tmp*', 'cover_db'],
125 125 create_makefile_pl => 'passthrough',
126 126 dist_abstract =>
127 127 'Perl bindings for CD Input and control library (libcdio)',
@@ -131,13 +131,14 @@ my $builder = $class->new(
131 131 needs_compiler => 1,
132 132 release_status => 'testing',
133 133 requires => {
134   - 'ExtUtils::PkgConfig' => '1.03',
  134 + 'ExtUtils::PkgConfig' => '1.03',
135 135 'Test::More' => 0,
136 136 'version' => 0,
137 137 'ExtUtils::CBuilder' => '0.28',
138 138 },
139   - sign => 1,
140   - swig_files => ['./']);
  139 + sign => 1);
  140 +
  141 +$builder->config(swig_files => './');
141 142 $builder->config(swig_source => { # with dependencies as hash value
142 143 'swig/perlcdio.swg' =>
143 144 ['swig/audio.swg', 'swig/device.swg',
@@ -159,15 +160,16 @@ if($builder->have_c_compiler()) {
159 160 verbose => $builder->config('verbose'));
160 161 $builder->notes(swig_installed => $swig_installed);
161 162 my ($ccflags, $ldflags,$swig_flags) = check_c_compiler(
162   - $builder->config('cc'));
  163 + $builder->config('cc'), $builder->config('ccflags'));
163 164 $builder->config(extra_linker_flags => $ldflags);
164   - $builder->config(extra_compiler_flags=> $ccflags);
  165 + $builder->config(extra_compiler_flags => $ccflags);
165 166 if($swig_installed) {
166   - $builder->config(swig_flags => $swig_flags);
  167 + $builder->config(swig_flags => $swig_flags);
167 168 $builder->add_build_element('swig');
  169 + $builder->add_to_cleanup('lib/perl*.pm','*.c');
168 170 }
169 171 $builder->add_build_element('c');
170   - $builder->add_to_cleanup('*.o','*_wrap.so','tmp*');
  172 + $builder->add_to_cleanup('*.o','*.so','tmp*',);
171 173 # better: $builder->config('dlext') $builder->config('obj_ext')
172 174 #add a cleanup build_element ??
173 175 #rearrange order of the build process
@@ -177,12 +179,12 @@ if($builder->have_c_compiler()) {
177 179 @el = @{$builder->build_elements};
178 180 $i = grep {$el[$_] eq 'swig'} 0..$#el;
179 181 unshift @el, splice @el, $i, 1;
180   - if ($builder->config('verbose')) {
181   - foreach my $i (@el) {
182   - print " $i ";
183   - }
184   - print "\n";
185   - }
  182 + #if ($builder->config('verbose')) {
  183 + # foreach my $i (@el) {
  184 + # print " $i ";
  185 + # }
  186 + # print "\n";
  187 + #}
186 188 }
187 189 #distclean : unlink lib/perliso9660.pm, lib/perlmmc.pm lib/perlcdio.pm
188 190 # c files?
@@ -273,11 +275,8 @@ if ($?) {
273 275
274 276 sub check_c_compiler {
275 277 my $cc= shift;
276   -
277   - my $ccflags = $libcdio_pkgcfg{cflags}; #this doesn't wokt at all??
278   - #FIXME
279   - $ccflags = "-fPIC -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ";
280   -$ccflags = "-I/usr/include -D_GNU_SOURCE "; #that seems enough
  278 + my $ccflags = shift;
  279 + $ccflags .= ' '. $libcdio_pkgcfg{cflags};
281 280 ## Swig produces a number of GCC warnings. Turn them off if we can.
282 281 $ccflags .= try_cflags("-Wno-strict-aliasing");
283 282 $ccflags .= try_cflags("-Wno-unused-function");
@@ -285,9 +284,10 @@ $ccflags = "-I/usr/include -D_GNU_SOURCE "; #that seems enough
285 284 $ccflags .= try_cflags("-Wno-unused-function");
286 285 $ccflags .= try_cflags("-Wno-unused-variable");
287 286
288   -my %libiso9660_pkgcfg = ExtUtils::PkgConfig->find ('libiso9660');
289   -my $ldflags = "$libcdio_pkgcfg{libs} $libiso9660_pkgcfg{libs} -lcdio";
290   -my $swig_flags='';
  287 + my %libiso9660_pkgcfg = ExtUtils::PkgConfig->find ('libiso9660');
  288 + my $ldflags = "$libcdio_pkgcfg{libs} $libiso9660_pkgcfg{libs} -lcdio";
  289 + my $swig_flags='';
  290 +
291 291 if ('cygwin' eq $Config{osname} &&
292 292 $Config{shrpenv} =~ m{\Aenv LD_RUN_PATH=(.*)\Z} ) {
293 293 $ldflags .= " -L$1 -lperl";
34 META.yml
... ... @@ -1,17 +1,19 @@
1 1 ---
2   -abstract: 'Perl bindings for CD Input and control library (libcdio)'
  2 +name: Device-Cdio
  3 +version: v0.3.0
3 4 author:
4 5 - 'Rocky Bernstein <rocky@cpan.org>'
5   -build_requires:
6   - ExtUtils::CBuilder: 0
7   -configure_requires:
8   - Module::Build: 0.36
9   -generated_by: 'Module::Build version 0.3607'
  6 +abstract: Perl bindings for CD Input and control library (libcdio)
10 7 license: gpl
11   -meta-spec:
12   - url: http://module-build.sourceforge.net/META-spec-v1.4.html
13   - version: 1.4
14   -name: Device-Cdio
  8 +resources:
  9 + license: http://opensource.org/licenses/gpl-license.php
  10 +requires:
  11 + ExtUtils::CBuilder: 0.28
  12 + ExtUtils::PkgConfig: 1.03
  13 + Test::More: 0
  14 + version: 0
  15 +configure_requires:
  16 + Module::Build: 0.340201
15 17 provides:
16 18 Device::Cdio:
17 19 file: lib/Device/Cdio.pm
@@ -48,11 +50,7 @@ provides:
48 50 version: 0
49 51 perlmmcc:
50 52 file: lib/perlmmc.pm
51   -requires:
52   - ExtUtils::CBuilder: 0.28
53   - ExtUtils::PkgConfig: 1.03
54   - Test::More: 0
55   - version: 0
56   -resources:
57   - license: http://opensource.org/licenses/gpl-license.php
58   -version: v0.3.0
  53 +generated_by: Module::Build version 0.340201
  54 +meta-spec:
  55 + url: http://module-build.sourceforge.net/META-spec-v1.4.html
  56 + version: 1.4
14 t/06.bincue.t
@@ -47,14 +47,8 @@ $result = Device::Cdio::is_device($cuefile);
47 47 ok(!$result, "is_device(tocfile)");
48 48 $result = $device->get_media_changed();
49 49 ok(!$result, "bincue: get_media_changed");
50   -if ($perlcdio::VERSION_NUM >= 77) {
51   - # There's a bug in libcdio 0.76 that causes these to crash
52   - $drc = $device->set_blocksize(2048);
53   - ok($perlcdio::DRIVER_OP_UNSUPPORTED == $drc, "set blocksize");
54   - $drc = $device->set_speed(5);
55   - ok($perlcdio::DRIVER_OP_UNSUPPORTED == $drc, "set speed");
56   -} else {
57   - ok(1, "skip set blocksize");
58   - ok(1, "skip set speed");
59   -}
  50 +$drc = $device->set_blocksize(2048);
  51 +ok($perlcdio::DRIVER_OP_UNSUPPORTED == $drc, "set blocksize");
  52 +$drc = $device->set_speed(5);
  53 +ok($perlcdio::DRIVER_OP_UNSUPPORTED == $drc, "set speed");
60 54 $device->close();
31 t/07.iso.t
@@ -9,7 +9,7 @@ use lib '../lib';
9 9 use blib;
10 10
11 11 use perliso9660;
12   -use Test::More tests => 14;
  12 +use Test::More tests => 15;
13 13 note 'Test low-level ISO9660 routines';
14 14
15 15 sub is_eq($$) {
@@ -159,25 +159,7 @@ ok($bad==0, 'perliso9660::pathname_isofy');
159 159 my @tm = localtime(0);
160 160 my $dtime = perliso9660::set_dtime($tm[0], $tm[1], $tm[2], $tm[3], $tm[4],
161 161 $tm[5]);
162   -my ($bool, @new_tm) = perliso9660::get_dtime($dtime, 1);
163   -
164   -### FIXME Don't know why the discrepancy, but there is an hour
165   -### difference, perhaps daylight savings time.
166   -### Versions before 0.77 have other bugs.
167   -## if ($perliso9660::VERSION_NUM < 77) {
168   - $new_tm[2] = $tm[2];
169   -## }
170   -
171   -# print "tm: \n";
172   -# foreach my $tm_i (@tm) {
173   -# print $tm_i, " ";
174   -# }
175   -# print "\n";
176   -# print "new tm: \n";
177   -# foreach my $tm_i (@new_tm) {
178   -# print $tm_i, " ";
179   -# }
180   -# print "\n";
  162 +my ($bool, @new_tm) = perliso9660::get_dtime($dtime, 0);
181 163
182 164 ok(is_eq(\@new_tm, \@tm), 'get_dtime(set_dtime())');
183 165
@@ -187,4 +169,13 @@ ok(is_eq(\@new_tm, \@tm), 'get_dtime(set_dtime())');
187 169 # ($bool, @new_tm) = perliso9660::get_ltime($ltime);
188 170 # ok(is_eq(\@new_tm, \@tm), 'get_ltime(set_ltime())');
189 171
  172 +@tm = gmtime();
  173 +my $ltime = perliso9660::set_ltime($tm[0], $tm[1], $tm[2], $tm[3], $tm[4],
  174 + $tm[5]);
  175 +($bool, @new_tm) = perliso9660::get_ltime($ltime);
  176 +if($new_tm[8] =! $tm[8]) { #isdst flag
  177 + diag(' isdst flags differ '. $new_tm[8]. ' '.$tm[8]);
  178 + $new_tm[8] = $tm[8];
  179 +}
  180 +ok(is_eq(\@new_tm, \@tm), 'get_ltime(set_ltime())');
190 181

0 comments on commit 7bbe2cb

Please sign in to comment.
Something went wrong with that request. Please try again.