如何在NetBSD w / pkgsrc上安装和加载libspatialite和spatiality-tools?

时间:2014-03-30 16:33:34

标签: sqlite package packaging spatialite netbsd

我正在尝试使用库libspatialite在NetBSD平台上扩展sqlite。我已经迈出了在pkgsrc(libspatialite-4.1.1)中为libspatialite创建包的第一步。包装似乎有效; pkg_info说已经安装了,我已经验证了PLIST中的文件(在下面的代码块中)已经安装在/ usr / pkg /中。但是,当我尝试安装我为spatialite-tools构建的软件包时,configure表示尚未安装libspatialite。另外,我无法弄清楚如何使用load_extenstion(X,Y)在sqlite3中加载库; documentation中提到的库文件是什么?

的pkgsrc /数据库/ libsqlite / PLIST:

@comment $NetBSD$
include/spatialite.h
include/spatialite/debug.h
include/spatialite/gaiaaux.h
include/spatialite/gaiaexif.h
include/spatialite/gaiageo.h
include/spatialite/geopackage.h
include/spatialite/gg_advanced.h
include/spatialite/gg_const.h
include/spatialite/gg_core.h
include/spatialite/gg_dxf.h
include/spatialite/gg_dynamic.h
include/spatialite/gg_formats.h
include/spatialite/gg_mbr.h
include/spatialite/gg_structs.h
include/spatialite/gg_wfs.h
include/spatialite/gg_xml.h
include/spatialite/spatialite.h
include/spatialite/sqlite.h
lib/libspatialite.la
lib/pkgconfig/spatialite.pc

1 个答案:

答案 0 :(得分:0)

libspatialite包中是否有buildlink3.mk文件?

如果不是:

为了避免构建针对隐式依赖的构建,pkgsrc只使得已明确列出的库对构建包可见。

这样就停止了一个软件包拾取可选依赖项的问题,这个依赖项恰好被安装,然后构建一个使用该库但没有在软件包元数据中列出的二进制包。生成的二进制包在该系统上运行正常......直到删除了可选依赖项,并且在没有隐藏依赖项的任何其他系统上将失败。

无论如何......在pkgsrc中使用了buildlink3.mk文件,以便在构建期间显示必要的文件。 libspatialite buildlink3.mk可能如下所示(将1.0调整为当前的lib版本)

# $NetBSD$

BUILDLINK_TREE+=        libspatialite

.if !defined(LIBSPATIALITE_BUILDLINK3_MK)
LIBSPATIALITE_BUILDLINK3_MK:=

BUILDLINK_API_DEPENDS.libspatialite+=libspatialite>=1.0
BUILDLINK_PKGSRCDIR.libspatialite?=     ../../devel/libspatialite

BUILDLINK_LIBDIRS.libspatialite+=       lib/spatialite
BUILDLINK_RPATHDIRS.libspatialite+=     lib/spatialite
BUILDLINK_INCDIRS.libspatialite+=       include/spatialite

.endif # LIBSPATIALITE_BUILDLINK3_MK

BUILDLINK_TREE+=        -libspatialite

然后在依赖包中添加如下内容:

.include "../../devel/libspatialite/buildlink3.mk"