Skip Menu |

This queue is for tickets about the Encode-Detect CPAN distribution.

Report information
The Basics
Id: 16250
Status: resolved
Priority: 0/
Queue: Encode-Detect

People
Owner: JGMYERS [...] cpan.org
Requestors: steve [...] purkis.ca
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: CPAN install fails
Hiya, I've had several problems installing Encode-Detect on Mac OS X; I imagine the same problems will be found on other systems. Hopefully this feedback will help: 1. 'Your' Makefile.PL does not work. You have a stub Makefile.PL that was auto-generated by CPAN.pm. As you're using Module::Build, you probably don't want this to happen. Instead, you can use this parameter for M::B->new: create_makefile_pl => 'passthrough', This will create a Makefile.PL that uses your Build.PL when you run a './Build dist'. 2. You have un-documented dependencies. Your tests require: Test::More Data::Dump These should go into Build.PL: build_requires => { 'Test::More' => '0.01', 'Data::Dump' => 0.01 } See the patch attached. If you've got any questions, I'm happy to help, otherwise check out the Module-Build list: http://lists.sourceforge.net/lists/listinfo/module-build-general hth, -Steve
use Module::Build; my $build = Module::Build->new ( module_name => 'Encode::Detect', create_makefile_pl => 'passthrough', license => 'mozilla', c_source => 'src', build_requires => { 'Test::More' => '0.01', 'Data::Dump' => 0.01 }, pm_files => { 'Detect.pm' => 'lib/Encode/Detect.pm', 'Detector.pm' => 'lib/Encode/Detect/Detector.pm', }, xs_files => { 'Detector.xs' => 'lib/Encode/Detect/Detector.xs' }, dist_version_from => 'Detect.pm', extra_compiler_flags => ['-x', 'c++', '-Iinclude'], extra_linker_flags => ['-lstdc++'], ); $build->create_build_script;
Subject: for ActivePerl & VC++ users
From: ishigaki
At the moment, attached Makefile.PL would solve the problem for ActivePerl and VC++ users. If you use VC++98, edit Detector.xs to remove 'extern "C" {' and corresponding '}' at the top (do not remove #define and #include lines), though this may not be good practice for others.
use strict; use ExtUtils::MakeMaker; use File::Copy; use File::Path; unlink "MANIFEST"; mkpath('lib/Encode/Detect'); move('Detect.pm', 'lib/Encode/Detect.pm'); move('Detector.pm', 'lib/Encode/Detect/Detector.pm'); move('Detector.xs', 'src/Detector.xs'); move('typemap', 'src/typemap'); open my $fh, '>', './src/Makefile.PL'; print $fh <<'_END_OF_MAKEFILE_'; use strict; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Encode::Detect::Detector', VERSION_FROM => '..\lib\Encode\Detect\Detector.pm', INC => '-I..\include -I.', XS => { 'Detector.xs' => 'Detector.cpp' }, OBJECT => '$(O_FILES)', ); sub MY::xs_c { return <<'_EOT_'; .xs.cpp: $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && $(MV) xstmp.c $*.cpp _EOT_ } _END_OF_MAKEFILE_ WriteMakefile( NAME => 'Encode::Detect', VERSION_FROM => 'lib\Encode\Detect.pm', PREREQ_PM => {'Data::Dump' => 0, 'Test::More' => 0}, DIR => ['src'], );
In 1.01, Added passthrough option and removed reference to Data::Dump. I was under the impression that the Test::More was considered an implicit dependency. If it isn't please open a separate bug.