Lines 1-85
Link Here
|
1 |
--- setup.py.orig 2012-01-11 23:54:57.000000000 +0100 |
1 |
--- setup.py.orig 2014-12-30 18:38:25.823292562 +0100 |
2 |
+++ setup.py 2013-03-24 09:52:46.000000000 +0100 |
2 |
+++ setup.py 2014-12-30 18:39:43.418635165 +0100 |
3 |
@@ -44,7 +44,7 @@ |
3 |
@@ -65,7 +65,7 @@ |
|
|
4 |
if rc != 0: |
5 |
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'." |
4 |
|
6 |
|
5 |
include_dirs = [] |
7 |
-AMALGAMATION_ROOT = "amalgamation/libspatialite-amalgamation-3.0.1" |
6 |
library_dirs = [] |
8 |
+#AMALGAMATION_ROOT = "amalgamation/libspatialite-amalgamation-3.0.1" |
7 |
-libraries = ['geos','geos_c','proj'] |
|
|
8 |
+libraries = ['geos','geos_c','proj'%%ICONV%%] |
9 |
runtime_library_dirs = [] |
10 |
extra_objects = [] |
11 |
define_macros = [] |
12 |
@@ -86,29 +86,30 @@ |
13 |
|
9 |
|
14 |
def get_amalgamation(): |
10 |
TRUTHY = ("yes", "true", "t", "1") |
15 |
"""Download the Spatialite amalgamation if it isn't there, already.""" |
|
|
16 |
- if os.path.exists(AMALGAMATION_ROOT): |
17 |
- return |
18 |
- os.mkdir(AMALGAMATION_ROOT) |
19 |
- print "Downloading amalgation." |
20 |
- |
21 |
- # find out what's current amalgamation ZIP file |
22 |
- download_page = urllib.urlopen("https://www.gaia-gis.it/fossil/libspatialite/index").read() |
23 |
- pattern = re.compile("(libspatialite-amalgamation.*?\.zip)") |
24 |
- download_file = pattern.findall(download_page)[0] |
25 |
- amalgamation_url = "http://www.gaia-gis.it/gaia-sins/" + download_file |
26 |
- zip_dir = string.replace(download_file,'.zip','') |
27 |
- # and download it |
28 |
- urllib.urlretrieve(amalgamation_url, "tmp.zip") |
29 |
- |
30 |
- zf = zipfile.ZipFile("tmp.zip") |
31 |
- 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"] |
32 |
- for fn in files: |
33 |
- print "Extracting", fn |
34 |
- outf = open(AMALGAMATION_ROOT + os.sep + string.split(fn,'/')[-1], "wb") |
35 |
- outf.write(zf.read(zip_dir + '/' + fn)) |
36 |
- outf.close() |
37 |
- zf.close() |
38 |
- os.unlink("tmp.zip") |
39 |
+# into ${FILESDIR} for FreeBSD |
40 |
+# if os.path.exists(AMALGAMATION_ROOT): |
41 |
+# return |
42 |
+# os.mkdir(AMALGAMATION_ROOT) |
43 |
+# print "Downloading amalgation." |
44 |
+# |
45 |
+# # find out what's current amalgamation ZIP file |
46 |
+# download_page = urllib.urlopen("http://www.gaia-gis.it/gaia-sins/libspatialite-sources/").read() |
47 |
+# pattern = re.compile("(libspatialite-amalgamation.*?\.zip)") |
48 |
+# download_file = pattern.findall(download_page)[-1] |
49 |
+# amalgamation_url = "http://www.gaia-gis.it/gaia-sins/libspatialite-sources/" + download_file |
50 |
+# zip_dir = string.replace(download_file,'.zip','') |
51 |
+# # and download it |
52 |
+# urllib.urlretrieve(amalgamation_url, "tmp.zip") |
53 |
+# |
54 |
+# zf = zipfile.ZipFile("tmp.zip") |
55 |
+# 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"] |
56 |
+# for fn in files: |
57 |
+# print "Extracting", fn |
58 |
+# outf = open(AMALGAMATION_ROOT + os.sep + string.split(fn,'/')[-1], "wb") |
59 |
+# outf.write(zf.read(zip_dir + '/' + fn)) |
60 |
+# outf.close() |
61 |
+# zf.close() |
62 |
+# os.unlink("tmp.zip") |
63 |
|
11 |
|
64 |
class MyBuildExt(build_ext): |
12 |
@@ -258,12 +258,12 @@ |
65 |
|
13 |
"src/prepare_protocol.c", |
66 |
@@ -119,8 +120,10 @@ |
14 |
"src/statement.c", |
67 |
ext.libraries.append("iconv") |
15 |
"src/util.c", |
68 |
|
16 |
- "src/row.c", |
69 |
#Default locations for Mac |
17 |
- os.path.join(AMALGAMATION_ROOT, "sqlite3.c"), |
70 |
+ ext.include_dirs.append("%%LOCALBASE%%/include/") |
18 |
- os.path.join(AMALGAMATION_ROOT, "spatialite.c") |
71 |
ext.include_dirs.append("/Library/Frameworks/GEOS.framework/unix/include/") |
19 |
+ "src/row.c" |
72 |
ext.include_dirs.append("/Library/Frameworks/PROJ.framework/unix/include/") |
20 |
+# os.path.join(AMALGAMATION_ROOT, "sqlite3.c"), |
73 |
+ ext.library_dirs.append("%%LOCALBASE%%/lib") |
21 |
+# os.path.join(AMALGAMATION_ROOT, "spatialite.c") |
74 |
ext.library_dirs.append("/Library/Frameworks/GEOS.framework/unix/lib") |
22 |
], |
75 |
ext.library_dirs.append("/Library/Frameworks/PROJ.framework/unix/lib") |
23 |
include_dirs = [ |
76 |
|
24 |
- os.path.join(AMALGAMATION_ROOT,"headers") |
77 |
@@ -132,7 +135,7 @@ |
25 |
+# os.path.join(AMALGAMATION_ROOT,"headers") |
78 |
ext.sources.append(os.path.join(AMALGAMATION_ROOT, "spatialite.c")) |
26 |
], |
79 |
ext.include_dirs.append(AMALGAMATION_ROOT) |
27 |
library_dirs = [], |
80 |
build_ext.build_extension(self, ext) |
28 |
runtime_library_dirs = [], |
81 |
- |
29 |
@@ -272,7 +272,7 @@ |
82 |
+ |
30 |
("VERSION",'"%s"' % PYSPATIALITE_VERSION), |
83 |
|
31 |
("SQLITE_ENABLE_RTREE", "1"), # build with fulltext search enabled |
84 |
# def __setattr__(self, k, v): |
32 |
("NDEBUG","1"), |
85 |
# # Make sure we don't link against the SQLite library, no matter what setup.cfg says |
33 |
- ("SPL_AMALGAMATION","1"), |
|
|
34 |
+# ("SPL_AMALGAMATION","1"), |
35 |
('MODULE_NAME', '\\"spatialite.dbapi2\\"') if sys.platform == "win32" else ('MODULE_NAME', '"spatialite.dbapi2"') |
36 |
], |
37 |
) |