0

I am trying to use the library libspatialite to extend sqlite on a NetBSD platform. I've taken the first step of creating a package for libspatialite in pkgsrc (libspatialite-4.1.1). The package appears to work; pkg_info says it's installed and I've verified that the files from PLIST (in code chunk below) have been installed in /usr/pkg/. However, when I try to install the package I built for spatialite-tools, configure says that libspatialite isn't installed. Also I can't figure out how to load the library in sqlite3 with load_extenstion(X,Y); what is the library file referred to in the documentation?

pkgsrc/databases/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
Gregory
  • 4,147
  • 7
  • 33
  • 44

1 Answers1

0

Do you have a buildlink3.mk file in the libspatialite package?

If not:

In order to avoid a package building against implicit dependencies pkgsrc only makes libraries which have been explicitly listed visible to the building package.

This stop the issue of a package picking up an optional dependency which just happens to be installed, then building a binary package which uses that library but does not have it listed in the package metadata. The resultant binary package will work fine on that system... until the optional dependency is removed, and will fail on any other system without that hidden dependency.

Anyway... buildlink3.mk files are used in pkgsrc to make the necessary files visible during a build. A libspatialite buildlink3.mk might look like the below (adjust 1.0 to the current lib version)

# $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

Then in the depending package add something like:

.include "../../devel/libspatialite/buildlink3.mk"
abs
  • 111
  • 1
  • 3