与 ExtUils::MakeMaker INST_SCRIPT 等效的 Module::Build 是什么?

发布于 2024-11-30 02:59:29 字数 2176 浏览 0 评论 0原文

我想将使用 ExtUtils::MakeMaker 的项目转换为 模块::构建。 由于 Makefile.PL 大部分是默认的,Module::Build::Convert< /a> 对我不起作用(见下文)我想手动转换它,但没有找到 INST_SCRIPT 的等效项来将可执行文件放在 Perl 的 bin/ 目录中。

我的 WriteMakefile 看起来像这样。

WriteMakefile(
    NAME                => 'Project',
    AUTHOR              => q{Mugen Kenichi <[email protected]>},
    VERSION_FROM        => 'lib/Project.pm',
    INST_SCRIPT         => 'script/',
    ($ExtUtils::MakeMaker::VERSION >= 6.3002
      ? ('LICENSE'=> 'perl')
      : ()),
    PL_FILES            => {},
    PREREQ_PM => {
        'JSON' => 0,
        'Log::Log4perl' => 0,
        'Proc::Daemon'  => 0,
        'Term::ANSIColor' => 0,
        'MooseX::Declare' => 0.34,
        'MooseX::Log::Log4perl' => 0,
        'Moose::Util::TypeConstraints' => 0,
        'MooseX::Templated::Role' => 0,
        'Template' => 0,
        # for testing
        'Test::More' => 0,
        'MooseX::Params::Validate' => 0,
        'File::Temp' => 0,
        'Sub::Exporter::ForMethods' => 0,
        'Data::Section' => 0,
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Project-*' },
);

我尝试使用 Module::Build::Convert 但 make2build抛出我无法解决的错误:

Variable "$regex" will not stay shared at (re_eval 32) line 1.
Use of uninitialized value $lines[0] in pattern match (m//) at /home/mak/perl5/lib/perl5/Module/Build/Convert.pm line 1305, <DATA> line 1.

perl 版本:

perl -v

This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux

I want to convert a project from use of ExtUtils::MakeMaker to Module::Build.
As the Makefile.PL is mostly default and Module::Build::Convert did not work for me (see below) I want to convert it manually but did not find the equivalent of INST_SCRIPT to place the executables in Perl's bin/ directory.

My WriteMakefile looks like this.

WriteMakefile(
    NAME                => 'Project',
    AUTHOR              => q{Mugen Kenichi <[email protected]>},
    VERSION_FROM        => 'lib/Project.pm',
    INST_SCRIPT         => 'script/',
    ($ExtUtils::MakeMaker::VERSION >= 6.3002
      ? ('LICENSE'=> 'perl')
      : ()),
    PL_FILES            => {},
    PREREQ_PM => {
        'JSON' => 0,
        'Log::Log4perl' => 0,
        'Proc::Daemon'  => 0,
        'Term::ANSIColor' => 0,
        'MooseX::Declare' => 0.34,
        'MooseX::Log::Log4perl' => 0,
        'Moose::Util::TypeConstraints' => 0,
        'MooseX::Templated::Role' => 0,
        'Template' => 0,
        # for testing
        'Test::More' => 0,
        'MooseX::Params::Validate' => 0,
        'File::Temp' => 0,
        'Sub::Exporter::ForMethods' => 0,
        'Data::Section' => 0,
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Project-*' },
);

I tried to use Module::Build::Convert but make2build throws errors i could not resolve:

Variable "$regex" will not stay shared at (re_eval 32) line 1.
Use of uninitialized value $lines[0] in pattern match (m//) at /home/mak/perl5/lib/perl5/Module/Build/Convert.pm line 1305, <DATA> line 1.

perl version:

perl -v

This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌无敌 2024-12-07 02:59:29

如果这就是您的 Makefile.PL 的样子,请保持原样。不要切换到 Module::Build,它似乎是一个被废弃的构建系统。没有人再维护 Module::Build,并且在 Leon Timmermans 推出下一个产品之前,除非 Module::Build 中有一些您绝对必须拥有的功能,否则没有理由转换为它。

尽管如此,我还是创建了脚本文件列表并将其用作 script_files 的值。没那么好。请参阅我的Build.PL for Unicode::Tussle

If that's what your Makefile.PL looks like, leave it like that. Don't switch to Module::Build, which appears to be an abandoneed build system. No one maintains Module::Build anymore, and until Leon Timmermans comes out with the next thing, unless there's some feature in Module::Build you absolutely must have, there's no reason to convert to it.

Having said that though, I create the list of script files and use it as the value for script_files. It's not as nice. See my Build.PL for Unicode::Tussle.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文