使用来自CPAN的稍微修改模块的最佳实践? [英] Best practice for using slightly modifying module from CPAN?

查看:57
本文介绍了使用来自CPAN的稍微修改模块的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DBI和DBD :: SQLite,现在我想使用SQLite的R * Tree功能。由于默认情况下DBD :: SQLite不编译此功能,因此我必须在 @CC_DEFINE -DSQLITE_ENABLE_RTREE = 1 $ c> DBD :: SQLite的Makefile.PL中的变量。如果我执行 perl Makefile.PL&制作&&进行安装,一切都可以在我的计算机上正常运行,但这最终需要部署/分发给最终用户。

I'm using DBI and DBD::SQLite, and now I'd like to use the R*Tree feature of SQLite. Since this feature is not compiled by DBD::SQLite by default, I have to add a -DSQLITE_ENABLE_RTREE=1 to the @CC_DEFINE variable in DBD::SQLite's Makefile.PL. If I do a 'perl Makefile.PL && make && make install', everything works fine locally on my machine, but this ultimately needs to be deployable/distributable to end users.

在这种情况下我该怎么办?我应该复制源代码,grep源代码,然后创建一个DBD :: SQLite :: WithRTree吗?创建DBD :: SQLite 1.31.1的私有版本(1.31是DBD :: SQLite的当前版本)?也许是更好的方法?

What should I do in a case like this? Should I copy the source, grep the source, and create a DBD::SQLite::WithRTree? Create a private version of DBD::SQLite 1.31.1 (Where 1.31 is the current version of DBD::SQLite)? Perhaps a better way altogether?

项目中的所有其他发行版都是通过非公共CPAN :: Mini镜像+ CPAN :: Mini :: Inject部署/分发的。

All other distributions in the project are deployed/distributed via a non-public CPAN::Mini mirror + CPAN::Mini::Inject.

推荐答案


我必须在DBD的@CC_DEFINE变量中添加'-DSQLITE_ENABLE_RTREE = 1' :: SQLite的Makefile.PL

I have to add a '-DSQLITE_ENABLE_RTREE=1' to the @CC_DEFINE variable in DBD::SQLite's Makefile.PL

您这样做有误, perl Makefile.PL DEFINE ='- DSQLITE_ENABLE_RTREE = 1'有效。 ExtUtils :: MakeMaker 中对此进行了说明。现在您已经知道,涉及 Distroprefs 的简单解决方案很可能会就地解决。

You're doing this wrong, perl Makefile.PL DEFINE='-DSQLITE_ENABLE_RTREE=1' works. This is documented in ExtUtils::MakeMaker. Now that you know that, a simple solution involving Distroprefs will likely fall in place.

这篇关于使用来自CPAN的稍微修改模块的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆