databases/pyspatialite: some updates

- Remove amalgamation
- Link with spatialite 4.x

PR:		196387
Submitted by:	coder@tuxfamily.org (maintainer)
This commit is contained in:
Kurt Jaeger 2015-02-14 18:52:05 +00:00
parent dcd76ca2a8
commit ecc14c2825
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=378991
7 changed files with 80 additions and 147 deletions

View File

@ -3,37 +3,38 @@
PORTNAME= pyspatialite
PORTVERSION= 3.0.1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= databases python
MASTER_SITES= CHEESESHOP:pyspatialite \
http://www.gaia-gis.it/gaia-sins/libspatialite-sources/:amalgam
MASTER_SITES= CHEESESHOP:pyspatialite
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:pyspatialite \
${AMALGAMATION_NAME}${EXTRACT_SUFX}:amalgam
DISTFILES= ${PORTNAME}-${PORTVERSION}-alpha-0${EXTRACT_SUFX}:pyspatialite
MAINTAINER= coder@tuxfamily.org
COMMENT= DB-API 2.0 interface for SQLite 3.x with Spatialite 3.x
COMMENT= DB-API 2.0 interface for SQLite 3.x with Spatialite
LIB_DEPENDS= libspatialite.so:${PORTSDIR}/databases/spatialite
LIB_DEPENDS= libspatialite.so:${PORTSDIR}/databases/spatialite \
libgeos_c.so:${PORTSDIR}/graphics/geos \
libproj.so:${PORTSDIR}/graphics/proj \
libfreexl.so:${PORTSDIR}/textproc/freexl
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-alpha-0
USES= iconv python
USE_PYTHON= distutils
PYDISTUTILS_PKGNAME= pyspatialite
AMALGAMATION_NAME= libspatialite-amalgamation-${PORTVERSION}
.include <bsd.port.pre.mk>
.if empty(ICONV_LIB)
ICONV_APPEND=
.else
ICONV_APPEND= ,'iconv'
ICONV_APPEND= ,iconv
.endif
post-patch:
@${REINPLACE_CMD} -e "s|pyspatialite-doc|${DOCSDIR}|g" \
-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
-e "s|%%ICONV%%|${ICONV_APPEND}|" ${WRKSRC}/setup.py
@${MV} ${WRKDIR}/${AMALGAMATION_NAME} ${WRKSRC}/amalgamation
@${REINPLACE_CMD} -e "s|pyspatialite-doc|${DOCSDIR}|g" ${WRKSRC}/setup.py
@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
-e "s|%%ICONV%%|${ICONV_APPEND}|" ${WRKSRC}/setup.cfg
.include <bsd.port.post.mk>

View File

@ -1,4 +1,2 @@
SHA256 (pyspatialite-3.0.1.tar.gz) = 81a3e4966fb6348802a985486cbf62e019a0fcb0a1e006b9522e8b02dc08f238
SIZE (pyspatialite-3.0.1.tar.gz) = 75099
SHA256 (libspatialite-amalgamation-3.0.1.tar.gz) = 51f08c6c9180b1f8979d0469960a5c20a79a574c08fe032ae292042245ad46b6
SIZE (libspatialite-amalgamation-3.0.1.tar.gz) = 2485779
SHA256 (pyspatialite-3.0.1-alpha-0.tar.gz) = f7e135cd5e592b3a0d6627863b46442cb4407ab5a05c6004e73453e078274478
SIZE (pyspatialite-3.0.1-alpha-0.tar.gz) = 2562257

View File

@ -0,0 +1,11 @@
--- setup.cfg.orig 2014-12-30 18:37:55.696294687 +0100
+++ setup.cfg 2014-12-30 18:37:30.988798563 +0100
@@ -2,3 +2,8 @@
tag_build =
tag_date = 0
tag_svn_revision = 0
+[build_ext]
+libraries = spatialite,geos,geos_c,proj%%ICONV%%
+library-dirs = %%LOCALBASE%%/lib/
+include-dirs = %%LOCALBASE%%/include/
+with-freexl = True

View File

@ -1,85 +1,37 @@
--- setup.py.orig 2012-01-11 23:54:57.000000000 +0100
+++ setup.py 2013-03-24 09:52:46.000000000 +0100
@@ -44,7 +44,7 @@
--- setup.py.orig 2014-12-30 18:38:25.823292562 +0100
+++ setup.py 2014-12-30 18:39:43.418635165 +0100
@@ -65,7 +65,7 @@
if rc != 0:
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
include_dirs = []
library_dirs = []
-libraries = ['geos','geos_c','proj']
+libraries = ['geos','geos_c','proj'%%ICONV%%]
runtime_library_dirs = []
extra_objects = []
define_macros = []
@@ -86,29 +86,30 @@
-AMALGAMATION_ROOT = "amalgamation/libspatialite-amalgamation-3.0.1"
+#AMALGAMATION_ROOT = "amalgamation/libspatialite-amalgamation-3.0.1"
def get_amalgamation():
"""Download the Spatialite amalgamation if it isn't there, already."""
- if os.path.exists(AMALGAMATION_ROOT):
- return
- os.mkdir(AMALGAMATION_ROOT)
- print "Downloading amalgation."
-
- # find out what's current amalgamation ZIP file
- download_page = urllib.urlopen("https://www.gaia-gis.it/fossil/libspatialite/index").read()
- pattern = re.compile("(libspatialite-amalgamation.*?\.zip)")
- download_file = pattern.findall(download_page)[0]
- amalgamation_url = "http://www.gaia-gis.it/gaia-sins/" + download_file
- zip_dir = string.replace(download_file,'.zip','')
- # and download it
- urllib.urlretrieve(amalgamation_url, "tmp.zip")
-
- zf = zipfile.ZipFile("tmp.zip")
- files = ["sqlite3.c", "headers/spatialite/sqlite3.h", "spatialite.c", "headers/spatialite/sqlite3ext.h","headers/spatialite/spatialite.h","headers/spatialite/gaiaaux.h","headers/spatialite/gaiaexif.h","headers/spatialite/gaiageo.h"]
- for fn in files:
- print "Extracting", fn
- outf = open(AMALGAMATION_ROOT + os.sep + string.split(fn,'/')[-1], "wb")
- outf.write(zf.read(zip_dir + '/' + fn))
- outf.close()
- zf.close()
- os.unlink("tmp.zip")
+# into ${FILESDIR} for FreeBSD
+# if os.path.exists(AMALGAMATION_ROOT):
+# return
+# os.mkdir(AMALGAMATION_ROOT)
+# print "Downloading amalgation."
+#
+# # find out what's current amalgamation ZIP file
+# download_page = urllib.urlopen("http://www.gaia-gis.it/gaia-sins/libspatialite-sources/").read()
+# pattern = re.compile("(libspatialite-amalgamation.*?\.zip)")
+# download_file = pattern.findall(download_page)[-1]
+# amalgamation_url = "http://www.gaia-gis.it/gaia-sins/libspatialite-sources/" + download_file
+# zip_dir = string.replace(download_file,'.zip','')
+# # and download it
+# urllib.urlretrieve(amalgamation_url, "tmp.zip")
+#
+# zf = zipfile.ZipFile("tmp.zip")
+# files = ["sqlite3.c", "headers/spatialite/sqlite3.h", "spatialite.c", "headers/spatialite/sqlite3ext.h","headers/spatialite/spatialite.h","headers/spatialite/gaiaaux.h","headers/spatialite/gaiaexif.h","headers/spatialite/gaiageo.h"]
+# for fn in files:
+# print "Extracting", fn
+# outf = open(AMALGAMATION_ROOT + os.sep + string.split(fn,'/')[-1], "wb")
+# outf.write(zf.read(zip_dir + '/' + fn))
+# outf.close()
+# zf.close()
+# os.unlink("tmp.zip")
TRUTHY = ("yes", "true", "t", "1")
class MyBuildExt(build_ext):
@@ -119,8 +120,10 @@
ext.libraries.append("iconv")
#Default locations for Mac
+ ext.include_dirs.append("%%LOCALBASE%%/include/")
ext.include_dirs.append("/Library/Frameworks/GEOS.framework/unix/include/")
ext.include_dirs.append("/Library/Frameworks/PROJ.framework/unix/include/")
+ ext.library_dirs.append("%%LOCALBASE%%/lib")
ext.library_dirs.append("/Library/Frameworks/GEOS.framework/unix/lib")
ext.library_dirs.append("/Library/Frameworks/PROJ.framework/unix/lib")
@@ -132,7 +135,7 @@
ext.sources.append(os.path.join(AMALGAMATION_ROOT, "spatialite.c"))
ext.include_dirs.append(AMALGAMATION_ROOT)
build_ext.build_extension(self, ext)
-
+
# def __setattr__(self, k, v):
# # Make sure we don't link against the SQLite library, no matter what setup.cfg says
@@ -258,12 +258,12 @@
"src/prepare_protocol.c",
"src/statement.c",
"src/util.c",
- "src/row.c",
- os.path.join(AMALGAMATION_ROOT, "sqlite3.c"),
- os.path.join(AMALGAMATION_ROOT, "spatialite.c")
+ "src/row.c"
+# os.path.join(AMALGAMATION_ROOT, "sqlite3.c"),
+# os.path.join(AMALGAMATION_ROOT, "spatialite.c")
],
include_dirs = [
- os.path.join(AMALGAMATION_ROOT,"headers")
+# os.path.join(AMALGAMATION_ROOT,"headers")
],
library_dirs = [],
runtime_library_dirs = [],
@@ -272,7 +272,7 @@
("VERSION",'"%s"' % PYSPATIALITE_VERSION),
("SQLITE_ENABLE_RTREE", "1"), # build with fulltext search enabled
("NDEBUG","1"),
- ("SPL_AMALGAMATION","1"),
+# ("SPL_AMALGAMATION","1"),
('MODULE_NAME', '\\"spatialite.dbapi2\\"') if sys.platform == "win32" else ('MODULE_NAME', '"spatialite.dbapi2"')
],
)

View File

@ -1,11 +1,11 @@
--- src/connection.h.bak 2012-10-25 19:40:06.000000000 +0200
+++ src/connection.h 2012-10-25 19:40:25.000000000 +0200
@@ -33,8 +33,6 @@
#include "sqlite3.h"
--- src/connection.h.orig 2014-12-30 18:40:27.628284595 +0100
+++ src/connection.h 2014-12-30 18:40:37.947283409 +0100
@@ -30,7 +30,7 @@
#include "cache.h"
#include "module.h"
-#include "spatialite/sqlite3.h"
+#include "spatialite/sqlite.h"
#include "spatialite.h"
-int spatialite_init(int verbose);
-
typedef struct
{
PyObject_HEAD
SPATIALITE_DECLARE void spatialite_init(int verbose);

View File

@ -3,4 +3,4 @@ engine with spatialite extensions.
It is almost fully compliant with the Python database API version 2.0 also
exposes the unique features of SQLite and spatialite.
WWW: https://code.google.com/p/pyspatialite/
WWW: https://github.com/lokkju/pyspatialite

View File

@ -1,3 +1,7 @@
%%PYTHON_SITELIBDIR%%/pyspatialite-3.0.1_alpha_0-py%%PYTHON_VER%%.egg-info/PKG-INFO
%%PYTHON_SITELIBDIR%%/pyspatialite-3.0.1_alpha_0-py%%PYTHON_VER%%.egg-info/SOURCES.txt
%%PYTHON_SITELIBDIR%%/pyspatialite-3.0.1_alpha_0-py%%PYTHON_VER%%.egg-info/dependency_links.txt
%%PYTHON_SITELIBDIR%%/pyspatialite-3.0.1_alpha_0-py%%PYTHON_VER%%.egg-info/top_level.txt
%%PYTHON_SITELIBDIR%%/pyspatialite/__init__.py
%%PYTHON_SITELIBDIR%%/pyspatialite/__init__.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/__init__.pyo
@ -8,40 +12,7 @@
%%PYTHON_SITELIBDIR%%/pyspatialite/dump.py
%%PYTHON_SITELIBDIR%%/pyspatialite/dump.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/dump.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/__init__.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/__init__.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/__init__.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dbapi.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dbapi.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dbapi.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dump.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dump.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/dump.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/factory.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/factory.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/factory.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/hooks.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/hooks.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/hooks.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/__init__.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/__init__.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/__init__.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/py25tests.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/py25tests.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/py25/py25tests.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/regression.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/regression.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/regression.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/spatial.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/spatial.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/spatial.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/transactions.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/transactions.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/transactions.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/types.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/types.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/types.pyo
%%PYTHON_SITELIBDIR%%/pyspatialite/test/userfunctions.py
%%PYTHON_SITELIBDIR%%/pyspatialite/test/userfunctions.pyc
%%PYTHON_SITELIBDIR%%/pyspatialite/test/userfunctions.pyo
%%DOCSDIR%%/install-source.txt
%%PORTDOCS%%%%DOCSDIR%%/default.css
%%PORTDOCS%%%%DOCSDIR%%/docutils.css
%%PORTDOCS%%%%DOCSDIR%%/install-source.txt
%%PORTDOCS%%@dir %%DOCSDIR%%/code