From f9d0b953211c1b47e62185b3cff677164860372c Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:30:33 +0200 Subject: Update gta --- src/gta.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gta.mk b/src/gta.mk index d6ec54f..bd6cba0 100644 --- a/src/gta.mk +++ b/src/gta.mk @@ -3,8 +3,8 @@ PKG := gta $(PKG)_WEBSITE := http://www.nongnu.org/gta/ $(PKG)_IGNORE := -$(PKG)_VERSION := 1.0.7 -$(PKG)_CHECKSUM := 85763f6b1a223d89e4ac000f5048d1d5bcd39b315192bca4e123fd89c24a0db5 +$(PKG)_VERSION := 1.0.8 +$(PKG)_CHECKSUM := 1d2ff713955eee28310de082a8fd8e236403c27dee3716ba1238c56e6643e4fb $(PKG)_SUBDIR := libgta-$($(PKG)_VERSION) $(PKG)_FILE := libgta-$($(PKG)_VERSION).tar.xz $(PKG)_URL := https://download.savannah.gnu.org/releases/gta/$($(PKG)_FILE) @@ -15,6 +15,7 @@ define $(PKG)_UPDATE grep ']*>libgta-\([0-9.]*\)<.*,\1,p' | \ head -1 + endef define $(PKG)_BUILD -- cgit v0.12 From 3aca05268dcd802c1350a17685ecc6d0f404461c Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:32:22 +0200 Subject: Update proj --- src/proj.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proj.mk b/src/proj.mk index 407b268..3504dda 100644 --- a/src/proj.mk +++ b/src/proj.mk @@ -12,7 +12,7 @@ $(PKG)_URL_2 := ftp://ftp.remotesensing.org/proj/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - $(WGET) -q -O- 'https://trac.osgeo.org/proj/' | \ + $(WGET) -q -O- 'http://proj4.org/download.html' | \ $(SED) -n 's,.*proj-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef -- cgit v0.12 From 448c95ea6c8c14bc7cdae3271920e7efbbd98418 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:41:16 +0200 Subject: Update libgeotiff --- src/libgeotiff-1-fixes.patch | 28 ++++++++++++++++++++++++---- src/libgeotiff.mk | 7 +++++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/libgeotiff-1-fixes.patch b/src/libgeotiff-1-fixes.patch index aa831b4..62012d1 100644 --- a/src/libgeotiff-1-fixes.patch +++ b/src/libgeotiff-1-fixes.patch @@ -1,7 +1,18 @@ -diff -burN libgeotiff-1.4.0.orig/configure.ac libgeotiff-1.4.0/configure.ac ---- libgeotiff-1.4.0.orig/configure.ac 2015-06-21 03:50:03.341076086 +0200 -+++ libgeotiff-1.4.0/configure.ac 2015-06-21 03:50:39.741125191 +0200 -@@ -280,7 +280,7 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Tue, 1 Aug 2017 10:20:44 +0200 +Subject: [PATCH] Patch template definitions + + +diff --git a/configure.ac b/configure.ac +index 1111111..2222222 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -281,7 +281,7 @@ elif test "$PROJ_LIB" != "" -a "$PROJ_INC" != "" ; then PROJ_INC=-I$PROJ_INC AC_SUBST(PROJ_INC,$PROJ_INC) @@ -10,3 +21,12 @@ diff -burN libgeotiff-1.4.0.orig/configure.ac libgeotiff-1.4.0/configure.ac AC_DEFINE(HAVE_LIBPROJ) AC_SUBST([HAVE_LIBPROJ]) PROJ_CONFIG="yes" +@@ -317,7 +317,7 @@ fi + AM_CONDITIONAL([CSV_IS_CONFIG], [test ! x$CSV_CONFIG = xno]) + + +-AC_ARG_ENABLE(towgs84, [ --disable-towgs84 Disable WGS84 parameters for binary compatibility with pre-1.4.1], AC_DEFINE(GEO_NORMALIZE_DISABLE_TOWGS84)) ++AC_ARG_ENABLE(towgs84, [ --disable-towgs84 Disable WGS84 parameters for binary compatibility with pre-1.4.1], AC_DEFINE([GEO_NORMALIZE_DISABLE_TOWGS84], [], [Description])) + + dnl ######################################################################### + dnl Doxygen settings diff --git a/src/libgeotiff.mk b/src/libgeotiff.mk index 1d0320a..99af429 100644 --- a/src/libgeotiff.mk +++ b/src/libgeotiff.mk @@ -4,8 +4,8 @@ PKG := libgeotiff $(PKG)_WEBSITE := https://trac.osgeo.org/geotiff/ $(PKG)_DESCR := GeoTiff $(PKG)_IGNORE := -$(PKG)_VERSION := 1.4.0 -$(PKG)_CHECKSUM := d0acb8d341fd6a8f2c673456e09fdb8f50f91e3166ac934719fe05b30d328329 +$(PKG)_VERSION := 1.4.2 +$(PKG)_CHECKSUM := ad87048adb91167b07f34974a8e53e4ec356494c29f1748de95252e8f81a5e6e $(PKG)_SUBDIR := libgeotiff-$($(PKG)_VERSION) $(PKG)_FILE := libgeotiff-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/geotiff/libgeotiff/$($(PKG)_FILE) @@ -18,6 +18,8 @@ define $(PKG)_UPDATE head -1 endef +# Note: towgs84 is set to disabled for binary compatibility to < 1.4.2 +# Enabling towgs84 *may* require some work. define $(PKG)_BUILD $(SED) -i 's,/usr/local,@prefix@,' '$(1)/bin/Makefile.in' touch '$(1)/configure' @@ -26,6 +28,7 @@ define $(PKG)_BUILD $(MXE_CONFIGURE_OPTS) \ --with-jpeg \ --with-zlib \ + --disable-towgs84 \ LIBS="`'$(TARGET)-pkg-config' --libs libtiff-4` -ljpeg -lz" $(MAKE) -C '$(1)' -j 1 all install \ LDFLAGS=-no-undefined \ -- cgit v0.12 From b47d8614e561e06b2639520d1e822be8fbd2e75e Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:43:16 +0200 Subject: Update json-c --- src/json-c.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json-c.mk b/src/json-c.mk index 8413550..74414af 100644 --- a/src/json-c.mk +++ b/src/json-c.mk @@ -3,8 +3,8 @@ PKG := json-c $(PKG)_WEBSITE := https://github.com/json-c/json-c/wiki $(PKG)_IGNORE := -$(PKG)_VERSION := 0.12 -$(PKG)_CHECKSUM := 6fd6d2311d610b279e1bcdd5c6d4f699700159d3e0786de8306af7b4bc94fb35 +$(PKG)_VERSION := 0.12.1 +$(PKG)_CHECKSUM := 5a617da9aade997938197ef0f8aabd7f97b670c216dc173977e1d56eef9e1291 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION)-nodoc.tar.gz $(PKG)_URL := https://s3.amazonaws.com/$(PKG)_releases/releases/$($(PKG)_FILE) -- cgit v0.12 From 956652d9639463cd71e2c7a76a4ec5184367c3f4 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:45:30 +0200 Subject: Update qscintilla2 --- src/qscintilla2.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qscintilla2.mk b/src/qscintilla2.mk index 8871fcf..397670e 100644 --- a/src/qscintilla2.mk +++ b/src/qscintilla2.mk @@ -4,19 +4,19 @@ PKG := qscintilla2 $(PKG)_WEBSITE := https://www.riverbankcomputing.com/software/qscintilla/intro $(PKG)_DESCR := QScintilla2 $(PKG)_IGNORE := -$(PKG)_VERSION := 2.8.4 -$(PKG)_CHECKSUM := 9b7b2d7440cc39736bbe937b853506b3bd218af3b79095d4f710cccb0fabe80f -$(PKG)_SUBDIR := QScintilla-gpl-$($(PKG)_VERSION) -$(PKG)_FILE := QScintilla-gpl-$($(PKG)_VERSION).tar.gz +$(PKG)_VERSION := 2.10.1 +$(PKG)_CHECKSUM := 97f98a9d91f908db6ce37fecc6d241d955b388a1c487173b60726cba9a3dfa64 +$(PKG)_SUBDIR := QScintilla_gpl-$($(PKG)_VERSION) +$(PKG)_FILE := QScintilla_gpl-$($(PKG)_VERSION).tar.gz $(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/pyqt/QScintilla2/QScintilla-$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc qtbase define $(PKG)_UPDATE $(WGET) -q -O- 'https://www.riverbankcomputing.com/software/qscintilla/download' | \ - grep QScintilla-gpl | \ - head -n 1 | \ - $(SED) -n 's,.*QScintilla-gpl-\([0-9][^>]*\)\.zip.*,\1,p' + grep QScintilla_gpl | \ + head -n 1 | \ + $(SED) -n 's,.*QScintilla_gpl-\([0-9][^>]*\)\.tar.*,\1,p' endef define $(PKG)_BUILD @@ -27,6 +27,6 @@ define $(PKG)_BUILD '$(TARGET)-g++' \ -W -Wall -Werror -std=c++0x -pedantic \ `'$(TARGET)-pkg-config' Qt5Widgets --cflags` \ - '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-qscintilla2.exe' -lqscintilla2 \ + '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-qscintilla2.exe' -lqscintilla2_qt5 \ `'$(TARGET)-pkg-config' Qt5Widgets --libs` endef -- cgit v0.12 From a175395e25d5465f326792f8a527fb6daca9db57 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:48:43 +0200 Subject: Update: armadillo --- src/armadillo.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/armadillo.mk b/src/armadillo.mk index 92cc923..402cc04 100644 --- a/src/armadillo.mk +++ b/src/armadillo.mk @@ -4,8 +4,8 @@ PKG := armadillo $(PKG)_WEBSITE := https://arma.sourceforge.io/ $(PKG)_DESCR := Armadillo C++ linear algebra library $(PKG)_IGNORE := -$(PKG)_VERSION := 7.800.1 -$(PKG)_CHECKSUM := 5ada65a5a610301ae188bb34f0ac6e7fdafbdbcd0450b0adb7715349ae14b8db +$(PKG)_VERSION := 7.960.1 +$(PKG)_CHECKSUM := 57de6b9eb547f168e5dd2d2736c75b609bb2d1761120f608ff6530d7247082ff $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz $(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/arma/$($(PKG)_FILE) -- cgit v0.12 From 3f6b2cc041004cb0a15c5371ce3b6c015059e770 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 10:53:43 +0200 Subject: Update host-toolchain make-w32; the old download package was no longer available --- plugins/examples/host-toolchain/make-w32-bin.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/examples/host-toolchain/make-w32-bin.mk b/plugins/examples/host-toolchain/make-w32-bin.mk index e00bfc0..722f856 100644 --- a/plugins/examples/host-toolchain/make-w32-bin.mk +++ b/plugins/examples/host-toolchain/make-w32-bin.mk @@ -2,8 +2,8 @@ PKG := make-w32-bin $(PKG)_IGNORE := -$(PKG)_VERSION := 4.2 -$(PKG)_CHECKSUM := 6cab11301e601996ab0cb7b3b903e5a55d5bd795614946cf6bd025cd61c710c6 +$(PKG)_VERSION := 4.2.1 +$(PKG)_CHECKSUM := 30641be9602712be76212b99df7209f4f8f518ba764cf564262bc9d6e4047cc7 $(PKG)_SUBDIR := . $(PKG)_FILE := make-$($(PKG)_VERSION)-without-guile-w32-bin.zip $(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/ezwinports/$($(PKG)_FILE) -- cgit v0.12 From 60f40b6fac596bb88e128d2896a3f797c7b6e598 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:01:34 +0200 Subject: Added FreeXL, an open-source Excel data extractor --- src/freexl.mk | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/freexl.mk diff --git a/src/freexl.mk b/src/freexl.mk new file mode 100644 index 0000000..c3d00a9 --- /dev/null +++ b/src/freexl.mk @@ -0,0 +1,39 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := freexl +$(PKG)_WEBSITE := https://www.gaia-gis.it/fossil/freexl/index +$(PKG)_DESCR := FreeXL +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.0.3 +$(PKG)_CHECKSUM := f8ed29e03a6155454e538fce621e53991a270fcee31120ded339cff2523650a8 +$(PKG)_SUBDIR := freexl-$($(PKG)_VERSION) +$(PKG)_FILE := freexl-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://www.gaia-gis.it/gaia-sins/freexl-sources/$($(PKG)_FILE) +$(PKG)_DEPS := gcc libiconv + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://www.gaia-gis.it/gaia-sins/freexl-sources/' | \ + $(SED) -n 's,.*freexl-\([0-9][^>]*\)\.tar.*,\1,p' | \ + tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + $(MXE_CONFIGURE_OPTS) + $(MAKE) -C '$(1)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) + $(MAKE) -C '$(1)' -j 1 $(INSTALL_STRIP_LIB) + + # the test program comes from the freexl sources itself (test_xl.c) + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(1)/examples/test_xl.c' -o '$(PREFIX)/$(TARGET)/bin/test-freexl.exe' \ + `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` -liconv + + # create a batch file to run the test program (as the test program requires arguments) + (printf 'REM Run the test program against the provided .xls file.\r\n'; \ + printf 'test-freexl.exe test-freexl.xls\r\n';) \ + > '$(PREFIX)/$(TARGET)/bin/test-freexl.bat' + + # copy a test xls file to the target bin directory + cp -f '$(1)/tests/testdata/testcase1.xls' '$(PREFIX)/$(TARGET)/bin/test-freexl.xls' +endef -- cgit v0.12 From 8aedb2414e6a568eaeb6f8b0009f66801695c85e Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:04:33 +0200 Subject: Added qtkeychain, a platform-independent Qt API for storing passwords securely --- src/qtkeychain.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/qtkeychain.mk diff --git a/src/qtkeychain.mk b/src/qtkeychain.mk new file mode 100644 index 0000000..499dd45 --- /dev/null +++ b/src/qtkeychain.mk @@ -0,0 +1,44 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := qtkeychain +$(PKG)_WEBSITE := https://github.com/frankosterfeld/qtkeychain +$(PKG)_DESCR := QtKeychain +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.8.0 +$(PKG)_CHECKSUM := b492f603197538bc04b2714105b1ab2b327a9a98d400d53d9a7cb70edd2db12f +$(PKG)_FILE := qtkeychain-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := https://github.com/frankosterfeld/qtkeychain/archive/v$($(PKG)_VERSION).tar.gz +$(PKG)_DEPS := gcc qttools + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://github.com/frankosterfeld/qtkeychain/releases' | \ + grep ' '$(PREFIX)/$(TARGET)/bin/test-qt5keychain.bat' +endef -- cgit v0.12 From d1ebe856f1f636fa5e0e4b942486378390f8e3e4 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:17:00 +0200 Subject: Added libspatialindex, a generic C/C++ library for spatial indexing --- src/libspatialindex-1-fixes.patch | 23 +++++++++++++++++++++++ src/libspatialindex.mk | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/libspatialindex-1-fixes.patch create mode 100644 src/libspatialindex.mk diff --git a/src/libspatialindex-1-fixes.patch b/src/libspatialindex-1-fixes.patch new file mode 100644 index 0000000..74f2775 --- /dev/null +++ b/src/libspatialindex-1-fixes.patch @@ -0,0 +1,23 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Thu, 24 Aug 2017 10:53:39 +0200 +Subject: [PATCH] Remove explicit header check - mingw does not ship with this header. + + +diff --git a/configure.ac b/configure.ac +index 1111111..2222222 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -38,7 +38,7 @@ AC_CHECK_HEADERS(pthread.h, [ + LIBS="$LIBS -lpthread" + #endif]) + +-AC_CHECK_HEADERS(sys/resource.h,, [AC_MSG_ERROR([cannot find sys/resource.h, bailing out])]) ++#AC_CHECK_HEADERS(sys/resource.h,, [AC_MSG_ERROR([cannot find sys/resource.h, bailing out])]) + AC_CHECK_HEADERS(sys/time.h,, [AC_MSG_ERROR([cannot find sys/time.h, bailing out])]) + AC_CHECK_HEADERS(stdint.h,, [AC_MSG_ERROR([cannot find stdint.h, bailing out])]) + AC_CHECK_HEADERS(features.h) diff --git a/src/libspatialindex.mk b/src/libspatialindex.mk new file mode 100644 index 0000000..60b168c --- /dev/null +++ b/src/libspatialindex.mk @@ -0,0 +1,32 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := libspatialindex +$(PKG)_WEBSITE := https://libspatialindex.github.io/ +$(PKG)_DESCR := libspatialindex +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.8.5 +$(PKG)_CHECKSUM := 31ec0a9305c3bd6b4ad60a5261cba5402366dd7d1969a8846099717778e9a50a +$(PKG)_SUBDIR := spatialindex-src-$($(PKG)_VERSION) +$(PKG)_FILE := spatialindex-src-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://download.osgeo.org/libspatialindex/$($(PKG)_FILE) +$(PKG)_DEPS := gcc pthreads + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://download.osgeo.org/libspatialindex/' | \ + $(SED) -n 's,.*spatialindex-src-\([0-9][^>]*\)\.tar.*,\1,p' | \ + tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && autoreconf -fi + cd '$(1)' && ./configure $(MXE_CONFIGURE_OPTS) + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 '$(INSTALL_STRIP_LIB)' + + # the test program will return 0 on success; -1 on error (with an error message) + '$(TARGET)-gcc' \ + -W -Wall -ansi -pedantic \ + '$(1)/test/geometry/Intersection.cc' -o '$(PREFIX)/$(TARGET)/bin/test-libspatialindex.exe'\ + `'$(TARGET)-pkg-config' libspatialindex --cflags --libs` \ + -lspatialindex_c -lspatialindex -lstdc++ -pthread +endef -- cgit v0.12 From 9831e728e8aca8adc828aa536b0d73a9a6f7e20b Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:52:28 +0200 Subject: Update geos --- src/geos-1-fixes.patch | 90 ++++++++++++++++++++------------------------------ src/geos.mk | 8 ++--- 2 files changed, 39 insertions(+), 59 deletions(-) diff --git a/src/geos-1-fixes.patch b/src/geos-1-fixes.patch index 7c04169..a5b04c6 100644 --- a/src/geos-1-fixes.patch +++ b/src/geos-1-fixes.patch @@ -1,48 +1,21 @@ This file is part of MXE. See LICENSE.md for licensing information. -From 7966e3a9768f3db85fd93f8e4334ef6b58f0fb92 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sat, 18 Oct 2014 17:28:27 -0400 -Subject: [PATCH 1/2] geos-config: Fix linking to libm and libstdc++ for static +Contains ad hoc patches for cross building. -Signed-off-by: Timothy Gu +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Mon, 7 Aug 2017 15:24:32 +0200 +Subject: [PATCH] Always link as static (based on the previous patch by Timothy Gu) diff --git a/tools/geos-config.in b/tools/geos-config.in -index 9b45b5f..f521772 100644 +index 1111111..2222222 100644 --- a/tools/geos-config.in +++ b/tools/geos-config.in -@@ -52,10 +52,10 @@ case $1 in - echo -L${libdir} -lgeos - ;; - --static-clibs) -- echo -L${libdir} -lgeos_c -lgeos -m -+ echo -L${libdir} -lgeos_c -lgeos -lstdc++ -lm - ;; - --static-cclibs) -- echo -L${libdir} -lgeos -m -+ echo -L${libdir} -lgeos -lstdc++ -lm - ;; - --ldflags) - echo -L${libdir} --- -1.9.1 - - -From 22befe6776025838d876c6f36a789f2ba467fbb6 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sat, 18 Oct 2014 17:29:24 -0400 -Subject: [PATCH 2/2] [MXE] geos-config: Always link as static - -Signed-off-by: Timothy Gu - -diff --git a/tools/geos-config.in b/tools/geos-config.in -index f521772..4c9a72b 100644 ---- a/tools/geos-config.in -+++ b/tools/geos-config.in -@@ -40,21 +40,21 @@ case $1 in +@@ -39,33 +39,22 @@ case $1 in + ;; --cflags) echo -I${prefix}/include - ;; +- ;; - --libs) - # TODO: make an alias for --clibs - # see http://trac.osgeo.org/geos/ticket/497 @@ -55,25 +28,32 @@ index f521772..4c9a72b 100644 - echo -L${libdir} -lgeos - ;; - --static-clibs) -+# --libs) -+# # TODO: make an alias for --clibs -+# # see http://trac.osgeo.org/geos/ticket/497 -+# echo -L${libdir} -lgeos -+# ;; -+# --clibs) -+# echo -L${libdir} -lgeos_c -+# ;; -+# --cclibs) -+# echo -L${libdir} -lgeos -+# ;; -+ --clibs|--static-clibs) - echo -L${libdir} -lgeos_c -lgeos -lstdc++ -lm - ;; +- echo -L${libdir} -lgeos_c -lgeos -lm +- ;; - --static-cclibs) +- echo -L${libdir} -lgeos -lm +- ;; ++ ;; ++ --clibs|--static-clibs) ++ echo -L${libdir} -lgeos_c -lgeos -lstdc++ -lm ++ ;; + --libs|--cclibs|--static-cclibs) - echo -L${libdir} -lgeos -lstdc++ -lm - ;; ++ echo -L${libdir} -lgeos -lstdc++ -lm ++ ;; --ldflags) --- -1.9.1 - +- echo -L${libdir} +- ;; ++ echo -L${libdir} ++ ;; + --includes) +- echo ${prefix}/include +- ;; ++ echo ${prefix}/include ++ ;; + --jtsport) + echo @JTS_PORT@ +- ;; ++ ;; + *) + usage 1 1>&2 + ;; diff --git a/src/geos.mk b/src/geos.mk index 652e960..58b18e0 100644 --- a/src/geos.mk +++ b/src/geos.mk @@ -4,8 +4,8 @@ PKG := geos $(PKG)_WEBSITE := https://trac.osgeo.org/geos/ $(PKG)_DESCR := GEOS $(PKG)_IGNORE := -$(PKG)_VERSION := 3.4.2 -$(PKG)_CHECKSUM := 15e8bfdf7e29087a957b56ac543ea9a80321481cef4d4f63a7b268953ad26c53 +$(PKG)_VERSION := 3.6.2 +$(PKG)_CHECKSUM := 045a13df84d605a866602f6020fc6cbf8bf4c42fb50de237a08926e1d7d7652a $(PKG)_SUBDIR := geos-$($(PKG)_VERSION) $(PKG)_FILE := geos-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://download.osgeo.org/geos/$($(PKG)_FILE) @@ -13,9 +13,9 @@ $(PKG)_URL_2 := ftp://ftp.remotesensing.org/geos/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - $(WGET) -q -O- 'http://geos.refractions.net/' | \ + $(WGET) -q -O- 'http://download.osgeo.org/geos/' | \ $(SED) -n 's,.*geos-\([0-9][^>]*\)\.tar.*,\1,p' | \ - head -1 + tail -1 endef define $(PKG)_BUILD -- cgit v0.12 From 7185fee5884740df0fa421136ebf40bcce402d63 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:54:20 +0200 Subject: Added SpatiaLite, an open-source library to extend SQLite to support Spatial SQL --- src/spatialite-1-fixes.patch | 38 +++++ src/spatialite-test.c | 362 +++++++++++++++++++++++++++++++++++++++++++ src/spatialite.mk | 44 ++++++ 3 files changed, 444 insertions(+) create mode 100644 src/spatialite-1-fixes.patch create mode 100644 src/spatialite-test.c create mode 100644 src/spatialite.mk diff --git a/src/spatialite-1-fixes.patch b/src/spatialite-1-fixes.patch new file mode 100644 index 0000000..d1bd03d --- /dev/null +++ b/src/spatialite-1-fixes.patch @@ -0,0 +1,38 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Wed, 23 Aug 2017 12:51:27 +0200 +Subject: [PATCH] Patch: Makes sure to link against all of geos' libs as well + as the stdc++ lib + + +diff --git a/configure.ac b/configure.ac +index 1111111..2222222 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -293,18 +293,18 @@ if test x"$enable_geos" != "xno"; then + GEOS_LDFLAGS=`$GEOSCONFIG --ldflags` + GEOS_CFLAGS=-I`$GEOSCONFIG --includes` + AC_SUBST([GEOS_LDFLAGS]) +- AC_SUBST([GEOS_CFLAGS]) ++ AC_SUBST([GEOS_CFLAGS]) + # Ensure that we can parse geos_c.h + CPPFLAGS_SAVE="$CPPFLAGS" + CPPFLAGS="$GEOS_CFLAGS" + AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])]) +- CPPFLAGS="$CPPFLAGS_SAVE" ++ CPPFLAGS="$CPPFLAGS_SAVE -I`$GEOSCONFIG --includes`" + # Ensure we can link against libgeos_c + LIBS_SAVE="$LIBS" +- LIBS="$GEOS_LDFLAGS" ++ LIBS="$GEOS_LDFLAGS `$GEOSCONFIG --clibs`" + AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) + LIBS="$LIBS_SAVE" +- LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c" ++ LIBS="$LIBS $GEOS_LDFLAGS `$GEOSCONFIG --clibs`" + + #----------------------------------------------------------------------- + # --enable-controlpoints diff --git a/src/spatialite-test.c b/src/spatialite-test.c new file mode 100644 index 0000000..6a6e7f5 --- /dev/null +++ b/src/spatialite-test.c @@ -0,0 +1,362 @@ +/* + +demo4.c + +Author: Sandro Furieri a.furieri@lqt.it + +This software is provided 'as-is', without any express or implied +warranty. In no event will the author be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely + +*/ + +#include +#include +#include +#include + +/* +these headers are required in order to support +SQLite/SpatiaLite */ +#include +#include +#include + +int +main (int argc, char *argv[]) +{ + int ret; + sqlite3 *handle; + sqlite3_stmt *stmt; + char sql[256]; + char *err_msg = NULL; + double x; + double y; + int pk; + int ix; + int iy; + gaiaGeomCollPtr geo = NULL; + unsigned char *blob; + int blob_size; + int i; + char **results; + int n_rows; + int n_columns; + char *count; + clock_t t0; + clock_t t1; + void *cache; + + + if (argc != 2) + { + fprintf (stderr, "usage: %s test_db_path\n", argv[0]); + return -1; + } + + +/* +trying to connect the test DB: +- this demo is intended to create a new, empty database +*/ + ret = sqlite3_open_v2 (argv[1], &handle, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); + if (ret != SQLITE_OK) + { + printf ("cannot open '%s': %s\n", argv[1], sqlite3_errmsg (handle)); + sqlite3_close (handle); + return -1; + } + cache = spatialite_alloc_connection (); + spatialite_init_ex (handle, cache, 0); + + +/* showing the SQLite version */ + printf ("SQLite version: %s\n", sqlite3_libversion ()); +/* showing the SpatiaLite version */ + printf ("SpatiaLite version: %s\n", spatialite_version ()); + printf ("\n\n"); + + +/* +we are supposing this one is an empty database, +so we have to create the Spatial Metadata +*/ + strcpy (sql, "SELECT InitSpatialMetadata(1)"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* some error occurred */ + printf ("InitSpatialMetadata() error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + +/* +now we can create the test table +for simplicity we'll define only one column, the primary key +*/ + strcpy (sql, "CREATE TABLE test ("); + strcat (sql, "PK INTEGER NOT NULL PRIMARY KEY)"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("CREATE TABLE 'test' error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + +/* +... we'll add a Geometry column of POINT type to the test table +*/ + strcpy (sql, "SELECT AddGeometryColumn('test', 'geom', 3003, 'POINT', 2)"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("AddGeometryColumn() error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + +/* +and finally we'll enable this geo-column to have a Spatial Index based on MBR caching +*/ + strcpy (sql, "SELECT CreateMbrCache('test', 'geom')"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("CreateMbrCache() error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + printf + ("\nnow we are going to insert 1 million POINTs; wait, please ...\n\n"); + + t0 = clock (); +/* +beginning a transaction + +*** this step is absolutely critical *** + +the SQLite engine is a TRANSACTIONAL one +the whole batch of INSERTs has to be performed as an unique transaction, +otherwise performance will be surely very poor +*/ + strcpy (sql, "BEGIN"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("BEGIN error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + + +/* +preparing to populate the test table +we'll use a Prepared Statement we can reuse in order to insert each row +*/ + strcpy (sql, "INSERT INTO test (pk, geom) VALUES (?, ?)"); + ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("INSERT SQL error: %s\n", sqlite3_errmsg (handle)); + goto abort; + } + + pk = 0; + for (ix = 0; ix < 1000; ix++) + { + x = 1000000.0 + (ix * 10.0); + for (iy = 0; iy < 1000; iy++) + { +/* this double loop will insert 1 million rows into the the test table */ + + y = 4000000.0 + (iy * 10.0); + pk++; + if ((pk % 25000) == 0) + { + t1 = clock (); + printf ("insert row: %d\t\t[elapsed time: %1.3f]\n", + pk, (double) (t1 - t0) / CLOCKS_PER_SEC); + } + +/* preparing the geometry to insert */ + geo = gaiaAllocGeomColl (); + geo->Srid = 3003; + gaiaAddPointToGeomColl (geo, x, y); + +/* transforming this geometry into the SpatiaLite BLOB format */ + gaiaToSpatiaLiteBlobWkb (geo, &blob, &blob_size); + +/* we can now destroy the geometry object */ + gaiaFreeGeomColl (geo); + +/* resetting Prepared Statement and bindings */ + sqlite3_reset (stmt); + sqlite3_clear_bindings (stmt); + +/* binding parameters to Prepared Statement */ + sqlite3_bind_int64 (stmt, 1, pk); + sqlite3_bind_blob (stmt, 2, blob, blob_size, free); + +/* performing actual row insert */ + ret = sqlite3_step (stmt); + if (ret == SQLITE_DONE || ret == SQLITE_ROW) + ; + else + { +/* an unexpected error occurred */ + printf ("sqlite3_step() error: %s\n", + sqlite3_errmsg (handle)); + sqlite3_finalize (stmt); + goto abort; + } + + } + } +/* we have now to finalize the query [memory cleanup] */ + sqlite3_finalize (stmt); + + + +/* +committing the transaction + +*** this step is absolutely critical *** + +if we don't confirm the still pending transaction, +any update will be lost +*/ + strcpy (sql, "COMMIT"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("COMMIT error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + + +/* +now we'll optimize the table +*/ + strcpy (sql, "ANALYZE test"); + ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("ANALYZE error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + + + for (ix = 0; ix < 3; ix++) + { + printf ("\nperforming test#%d - not using Spatial Index\n", ix); +/* +now we'll perform the spatial query WITHOUT using the Spatial Index +we'll loop 3 times in order to avoid buffering-caching side effects +*/ + strcpy (sql, "SELECT Count(*) FROM test "); + strcat (sql, "WHERE MbrWithin(geom, BuildMbr("); + strcat (sql, "1000400.5, 4000400.5, "); + strcat (sql, "1000450.5, 4000450.5))"); + t0 = clock (); + ret = sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, + &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("NoSpatialIndex SQL error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + count = (char*) ""; + for (i = 1; i <= n_rows; i++) + { + count = results[(i * n_columns) + 0]; + } + t1 = clock (); + printf ("Count(*) = %d\t\t[elapsed time: %1.4f]\n", atoi (count), + (double) (t1 - t0) / CLOCKS_PER_SEC); +/* we can now free the table results */ + sqlite3_free_table (results); + } + + + for (ix = 0; ix < 3; ix++) + { + printf ("\nperforming test#%d - using the MBR cache Spatial Index\n", + ix); +/* +now we'll perform the spatial query USING the MBR cache Spatial Index +we'll loop 3 times in order to avoid buffering-caching side effects +*/ + strcpy (sql, "SELECT Count(*) FROM test "); + strcat (sql, "WHERE ROWID IN ("); + strcat (sql, "SELECT rowid FROM cache_test_geom WHERE "); + strcat (sql, + "mbr = FilterMbrWithin(1000400.5, 4000400.5, 1000450.5, 4000450.5))"); + +/* +YES, this query is a very unhappy one +the idea is simply to simulate exactly the same conditions as above +*/ + t0 = clock (); + ret = sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, + &err_msg); + if (ret != SQLITE_OK) + { +/* an error occurred */ + printf ("SpatialIndex SQL error: %s\n", err_msg); + sqlite3_free (err_msg); + goto abort; + } + count = (char*) ""; + for (i = 1; i <= n_rows; i++) + { + count = results[(i * n_columns) + 0]; + } + t1 = clock (); + printf ("Count(*) = %d\t\t[elapsed time: %1.4f]\n", atoi (count), + (double) (t1 - t0) / CLOCKS_PER_SEC); +/* we can now free the table results */ + sqlite3_free_table (results); + } + + +/* disconnecting the test DB */ + ret = sqlite3_close (handle); + if (ret != SQLITE_OK) + { + printf ("close() error: %s\n", sqlite3_errmsg (handle)); + return -1; + } + printf ("\n\nsample successfully terminated\n"); + spatialite_cleanup_ex (cache); + return 0; + + abort: + sqlite3_close (handle); + spatialite_cleanup_ex (cache); + spatialite_shutdown(); + return -1; +} diff --git a/src/spatialite.mk b/src/spatialite.mk new file mode 100644 index 0000000..c6765c8 --- /dev/null +++ b/src/spatialite.mk @@ -0,0 +1,44 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := spatialite +$(PKG)_WEBSITE := https://www.gaia-gis.it/fossil/libspatialite/index +$(PKG)_DESCR := SpatiaLite +$(PKG)_IGNORE := +$(PKG)_VERSION := 4.4.0-RC1 +$(PKG)_CHECKSUM := 80f7fff0a147044c5eb197e565f598ac1f137d86d0a548cbc8f52fb7ff7cac68 +$(PKG)_SUBDIR := libspatialite-$($(PKG)_VERSION) +$(PKG)_FILE := libspatialite-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://www.gaia-gis.it/gaia-sins/libspatialite-sources/$($(PKG)_FILE) +$(PKG)_DEPS := dlfcn-win32 freexl geos sqlite zlib proj libiconv libxml2 + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/' | \ + $(SED) -n 's,.*libspatialite-\([0-9][^>]*\)\.tar.*,\1,p' | \ + tail -1 +endef + +define $(PKG)_BUILD + # freeXL support is only necessary if you want to be able to parse .xls files. + # If you disable freexl support, remove -lfreexl from the test program below. + cd '$(1)' && autoreconf -fi -I ./m4 + cd '$(1)' && ./configure \ + $(MXE_CONFIGURE_OPTS) \ + --enable-freexl=yes \ + --with-geosconfig='$(PREFIX)/$(TARGET)/bin/geos-config' + $(MAKE) -C '$(1)' -j '$(JOBS)' $(if $(BUILD_SHARED), LDFLAGS='-no-undefined') + $(MAKE) -C '$(1)' -j 1 $(INSTALL_STRIP_LIB) + + # compile one of the demo programs (copied from the source package) + '$(TARGET)-g++' $(if $(BUILD_SHARED), -Wno-undefined) \ + -W -Wall -Werror -ansi -pedantic \ + '$(TOP_DIR)/src/spatialite-test.c' -o '$(PREFIX)/$(TARGET)/bin/test-spatialite.exe' \ + `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` \ + `'$(TARGET)-pkg-config' sqlite3 --cflags --libs` \ + $(if $(BUILD_STATIC), -lgeos_c -lgeos -lfreexl -lxml2 -liconv -llzma -lproj -lws2_32 -lz -lstdc++ -lm) + + # create a batch file to run the test program (as the program requires arguments) + (printf 'REM run against a database that should not exist, but remove afterward to save space.\r\n'; \ + printf 'test-spatialite.exe test-db.sqlite\r\n'; \ + printf 'del test-db.sqlite\r\n';) \ + > '$(PREFIX)/$(TARGET)/bin/test-spatialite.bat' +endef -- cgit v0.12 From 4f49515decda34f8803072f45ed70b60376855ad Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Sep 2017 11:58:26 +0200 Subject: Update gdal; adds spatialite support --- src/gdal-1-fixes.patch | 199 ++++++++++++++++++++++++++----------------------- src/gdal.mk | 13 ++-- 2 files changed, 110 insertions(+), 102 deletions(-) diff --git a/src/gdal-1-fixes.patch b/src/gdal-1-fixes.patch index 7afc76a..0555bb1 100644 --- a/src/gdal-1-fixes.patch +++ b/src/gdal-1-fixes.patch @@ -3,17 +3,117 @@ This file is part of MXE. See LICENSE.md for licensing information. Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Sat, 18 Oct 2014 18:25:34 -0400 -Subject: [PATCH 1/2] Fix geos detection +From: Luke Potgieter +Date: Tue, 29 Aug 2017 16:31:09 +0200 +Subject: [PATCH] Detect spatialite more effectively than just checking for + headers in the system paths. PostgreSQL detection requires -lpthread when + building statically. Added detection for openjpeg-2.2. +diff --git a/configure.ac b/configure.ac +index 1111111..2222222 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1124,7 +1124,7 @@ else + + AC_MSG_RESULT([yes]) + +- AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no,-L`$PG_CONFIG --libdir`) ++ AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no,-L`$PG_CONFIG --libdir` -lpthread) + + if test "${HAVE_PG}" = "yes" ; then + LIBS=-L`$PG_CONFIG --libdir`" -lpq $LIBS" +@@ -2545,14 +2545,23 @@ elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then + if test "$HAVE_OPENJPEG" = "yes"; then + LIBS="-lopenjp2 $LIBS" + fi +- else +- AC_CHECK_HEADERS([openjpeg-2.1/openjpeg.h]) +- if test "$ac_cv_header_openjpeg_2_1_openjpeg_h" = "yes"; then +- AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) +- if test "$HAVE_OPENJPEG" = "yes"; then +- OPENJPEG_VERSION=20100 +- LIBS="-lopenjp2 $LIBS" +- fi ++ fi ++ ++ AC_CHECK_HEADERS([openjpeg-2.1/openjpeg.h]) ++ if test "$ac_cv_header_openjpeg_2_1_openjpeg_h" = "yes"; then ++ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) ++ if test "$HAVE_OPENJPEG" = "yes"; then ++ OPENJPEG_VERSION=20100 ++ LIBS="-lopenjp2 $LIBS" ++ fi ++ fi ++ ++ AC_CHECK_HEADERS([openjpeg-2.2/openjpeg.h]) ++ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then ++ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) ++ if test "$HAVE_OPENJPEG" = "yes"; then ++ OPENJPEG_VERSION=20200 ++ LIBS="-lopenjp2 $LIBS" + fi + fi + else +@@ -2563,8 +2572,11 @@ else + elif test -r $with_openjpeg/include/openjpeg-2.1/openjpeg.h ; then + OPENJPEG_VERSION=20100 + EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES" ++ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then ++ OPENJPEG_VERSION=20200 ++ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES" + else +- AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1]) ++ AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0, $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2]) + fi + + AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,-L$with_openjpeg/lib) +@@ -3532,16 +3544,21 @@ AC_ARG_WITH(spatialite-soname, + + HAVE_SPATIALITE=no + SPATIALITE_AMALGAMATION=no ++HAVE_SPAT_PKG=no + + if test -z "$with_spatialite" -o "$with_spatialite" = "no"; then + AC_MSG_RESULT(disabled) + elif test "$with_spatialite" = "yes"; then + AC_CHECK_HEADERS(sqlite3.h) + if test "$ac_cv_header_sqlite3_h" = "yes"; then +- AC_MSG_CHECKING([for spatialite.h in /usr/include or /usr/local/include]) +- if test -f "/usr/include/spatialite.h" -o -f "/usr/local/include/spatialite.h"; then +- AC_MSG_RESULT(found) ++ #AC_MSG_CHECKING([for spatialite.h in /usr/include or /usr/local/include]) ++ #if test -f "/usr/include/spatialite.h" -o -f "/usr/local/include/spatialite.h"; then ++ PKG_CHECK_MODULES(SPATIALITE, spatialite, [HAVE_SPAT_PKG=yes], [HAVE_SPAT_PKG=no]) ++ if test "$HAVE_SPAT_PKG" = "yes"; then ++ OLD_LIBS="$LIBS" ++ LIBS="$LIBS -lsqlite3 -lspatialite -lgeos_c -lgeos -lxml2 -liconv -llzma -lproj -lstdc++ -lws2_32 -lm -lz" + AC_CHECK_LIB(spatialite,spatialite_init,SPATIALITE_INIT_FOUND=yes,SPATIALITE_INIT_FOUND=no,) ++ LIBS="$OLD_LIBS" + if test "$SPATIALITE_INIT_FOUND" = "yes"; then + HAVE_SPATIALITE=yes + SPATIALITE_LIBS="-lspatialite -lsqlite3" +diff --git a/frmts/openjpeg/openjpegdataset.cpp b/frmts/openjpeg/openjpegdataset.cpp +index 1111111..2222222 100644 +--- a/frmts/openjpeg/openjpegdataset.cpp ++++ b/frmts/openjpeg/openjpegdataset.cpp +@@ -34,7 +34,9 @@ + #pragma clang diagnostic ignored "-Wdocumentation" + #endif + +-#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100 ++#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20200 ++#include ++#elif defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100 + #include + #else + #include /* openjpeg.h needs FILE* */ diff --git a/m4/geos.m4 b/m4/geos.m4 index 1111111..2222222 100644 --- a/m4/geos.m4 +++ b/m4/geos.m4 @@ -121,14 +121,14 @@ AC_DEFUN([GEOS_INIT],[ - + HAVE_GEOS="no" - GEOS_LIBS="`${GEOS_CONFIG} --ldflags` -lgeos_c" @@ -30,94 +130,3 @@ index 1111111..2222222 100644 AC_CHECK_LIB([geos_c], [GEOSversion], - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Tue, 5 Jul 2016 22:23:16 +0300 -Subject: [PATCH 2/2] Use AC_PATH_TOOL for config scripts - - -diff --git a/configure.in b/configure.in -index 1111111..2222222 100644 ---- a/configure.in -+++ b/configure.in -@@ -866,7 +866,7 @@ AC_ARG_WITH(pg, - [Include PostgreSQL GDAL/OGR Support (ARG=path to pg_config)]),,) - - if test "x$with_pg" = "xyes" -o "x$with_pg" = "x" ; then -- AC_PATH_PROG(PG_CONFIG, pg_config, no) -+ AC_PATH_TOOL(PG_CONFIG, pg_config, no) - else - PG_CONFIG=$with_pg - fi -@@ -2016,7 +2016,7 @@ KEA_CONFIG=no - AC_ARG_WITH(kea,[ --with-kea[=ARG] Include kealib (ARG=path to kea-config) [[default=yes]]],,) - - if test "$with_kea" = "yes" -o "x$with_kea" = "x" ; then -- AC_PATH_PROG(KEA_CONFIG, kea-config, no) -+ AC_PATH_TOOL(KEA_CONFIG, kea-config, no) - else - KEA_CONFIG=$with_kea - fi -@@ -2079,10 +2079,10 @@ else - dnl find nc-config location - unset ac_cv_path_NETCDF_NCCONFIG - if test "$with_netcdf" = "yes" -o "$with_netcdf" = "" ; then -- AC_PATH_PROG(NETCDF_NCCONFIG, nc-config, no) -+ AC_PATH_TOOL(NETCDF_NCCONFIG, nc-config, no) - else - tmp_path="$with_netcdf/bin$PATH_SEPARATOR$with_netcdf" -- AC_PATH_PROG(NETCDF_NCCONFIG, nc-config, no, $tmp_path) -+ AC_PATH_TOOL(NETCDF_NCCONFIG, nc-config, no, $tmp_path) - fi - - dnl test nc-config -@@ -2832,7 +2832,7 @@ MYSQL_CONFIG=no - AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,) - - if test "$with_mysql" = "yes" ; then -- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no) -+ AC_PATH_TOOL(MYSQL_CONFIG, mysql_config, no) - else - if test "x$with_mysql" != "x" ; then - MYSQL_CONFIG=$with_mysql -@@ -3162,7 +3162,7 @@ if test "`basename xx/$with_curl`" = "curl-config" ; then - elif test "$with_curl" = "no" ; then - LIBCURL_CONFIG=no - else -- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no) -+ AC_PATH_TOOL(LIBCURL_CONFIG, curl-config, no) - fi - - if test "$LIBCURL_CONFIG" != "no" ; then -@@ -3204,7 +3204,7 @@ if test "`basename xx/$with_xml2`" = "xml2-config" ; then - elif test "$with_xml2" = "no" ; then - LIBXML2_CONFIG=no - else -- AC_PATH_PROG(LIBXML2_CONFIG, xml2-config, no) -+ AC_PATH_TOOL(LIBXML2_CONFIG, xml2-config, no) - fi - - if test "$LIBXML2_CONFIG" != "no" ; then -diff --git a/m4/geos.m4 b/m4/geos.m4 -index 1111111..2222222 100644 ---- a/m4/geos.m4 -+++ b/m4/geos.m4 -@@ -58,7 +58,7 @@ AC_DEFUN([GEOS_INIT],[ - - elif test x"$with_geos" = x"yes" -o x"$with_geos" = x"" ; then - -- AC_PATH_PROG(GEOS_CONFIG, geos-config, no) -+ AC_PATH_TOOL(GEOS_CONFIG, geos-config, no) - ac_geos_config_auto=yes - - else -@@ -133,7 +133,7 @@ AC_DEFUN([GEOS_INIT],[ - AC_CHECK_LIB([geos_c], - [GEOSversion], - [HAVE_GEOS="yes"], -- [HAVE_GEOS="no"], -+ [HAVE_GEOS="no" && echo "$GEOS_LIBS" && exit 1], - [] - ) - diff --git a/src/gdal.mk b/src/gdal.mk index f470900..3f242f9 100644 --- a/src/gdal.mk +++ b/src/gdal.mk @@ -4,15 +4,15 @@ PKG := gdal $(PKG)_WEBSITE := http://www.gdal.org/ $(PKG)_DESCR := GDAL $(PKG)_IGNORE := -$(PKG)_VERSION := 2.1.3 -$(PKG)_CHECKSUM := ae6a0a0dc6eb45a981a46db27e3dfe16c644fcf04732557e2cb315776974074a +$(PKG)_VERSION := 2.2.1 +$(PKG)_CHECKSUM := 61837706abfa3e493f3550236efc2c14bd6b24650232f9107db50a944abf8b2f $(PKG)_SUBDIR := gdal-$($(PKG)_VERSION) $(PKG)_FILE := gdal-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/gdal/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_URL_2 := ftp://ftp.remotesensing.org/gdal/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc armadillo curl expat geos giflib gta hdf4 hdf5 \ jpeg json-c libgeotiff libmysqlclient libpng libxml2 \ - netcdf openjpeg postgresql proj sqlite tiff zlib + netcdf openjpeg postgresql proj sqlite tiff zlib spatialite define $(PKG)_UPDATE $(WGET) -q -O- 'https://trac.osgeo.org/gdal/wiki/DownloadSource' | \ @@ -60,7 +60,6 @@ define $(PKG)_BUILD --with-oci=no \ --with-odbc=no \ --with-ogdi=no \ - --with-ogr \ --with-openjpeg='$(PREFIX)/$(TARGET)' \ --with-pam \ --with-pcidsk=no \ @@ -69,15 +68,15 @@ define $(PKG)_BUILD --with-php=no \ --with-png='$(PREFIX)/$(TARGET)' \ --with-python=no \ - --with-ruby=no \ --with-sde=no \ - --with-spatialite=no \ + --with-spatialite=yes \ --with-sqlite3='$(PREFIX)/$(TARGET)' \ --with-threads=no \ --with-xerces=no \ --with-xml2='$(PREFIX)/$(TARGET)/bin/xml2-config' \ + --with-pg='$(PREFIX)/$(TARGET)/bin/pg_config' \ CXXFLAGS='-D_WIN32_WINNT=0x0600' \ - LIBS="-ljpeg -lsecur32 -lportablexdr `'$(TARGET)-pkg-config' --libs openssl libtiff-4`" + LIBS="-ljpeg -lsecur32 -lportablexdr `'$(TARGET)-pkg-config' --libs openssl libtiff-4 spatialite freexl armadillo`" $(MAKE) -C '$(1)' -j '$(JOBS)' lib-target # gdal doesn't have an install-strip target -- cgit v0.12 From c335c5f97b13adc8121bf2b55782bedc1a0b08e4 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 2 Oct 2017 21:16:52 +0200 Subject: Update freexl for style. --- src/freexl-1-fixes.patch | 21 +++++++++++++++++++++ src/freexl.mk | 14 +++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/freexl-1-fixes.patch diff --git a/src/freexl-1-fixes.patch b/src/freexl-1-fixes.patch new file mode 100644 index 0000000..6987c58 --- /dev/null +++ b/src/freexl-1-fixes.patch @@ -0,0 +1,21 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Mon, 2 Oct 2017 15:32:20 +0200 +Subject: [PATCH] Add static dependency to .pc file + + +diff --git a/freexl.pc.in b/freexl.pc.in +index 1111111..2222222 100644 +--- a/freexl.pc.in ++++ b/freexl.pc.in +@@ -8,5 +8,5 @@ includedir=@includedir@ + Name: freexl + Description: a simple library extracting data from .xls (Excel BIFF) files + Version: @VERSION@ +-Libs: -L${libdir} -lfreexl -lm ++Libs: -L${libdir} -lfreexl -liconv -lm + Cflags: -I${includedir} diff --git a/src/freexl.mk b/src/freexl.mk index c3d00a9..736aa10 100644 --- a/src/freexl.mk +++ b/src/freexl.mk @@ -18,16 +18,16 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - cd '$(1)' && ./configure \ + cd '$(SOURCE_DIR)' && ./configure \ $(MXE_CONFIGURE_OPTS) - $(MAKE) -C '$(1)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) - $(MAKE) -C '$(1)' -j 1 $(INSTALL_STRIP_LIB) + $(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) + $(MAKE) -C '$(SOURCE_DIR)' -j 1 $(INSTALL_STRIP_LIB) # the test program comes from the freexl sources itself (test_xl.c) - '$(TARGET)-g++' \ + '$(TARGET)-gcc' \ -W -Wall -Werror -ansi -pedantic \ - '$(1)/examples/test_xl.c' -o '$(PREFIX)/$(TARGET)/bin/test-freexl.exe' \ - `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` -liconv + '$(SOURCE_DIR)/examples/test_xl.c' -o '$(PREFIX)/$(TARGET)/bin/test-freexl.exe' \ + `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` # create a batch file to run the test program (as the test program requires arguments) (printf 'REM Run the test program against the provided .xls file.\r\n'; \ @@ -35,5 +35,5 @@ define $(PKG)_BUILD > '$(PREFIX)/$(TARGET)/bin/test-freexl.bat' # copy a test xls file to the target bin directory - cp -f '$(1)/tests/testdata/testcase1.xls' '$(PREFIX)/$(TARGET)/bin/test-freexl.xls' + cp -f '$(SOURCE_DIR)/tests/testdata/testcase1.xls' '$(PREFIX)/$(TARGET)/bin/test-freexl.xls' endef -- cgit v0.12 From 9043fec8b68786c5c5ddf4173d0d51e1a85290f1 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 2 Oct 2017 21:23:19 +0200 Subject: Update spatialite for style and functionality. --- src/spatialite-1-fixes.patch | 18 +++ src/spatialite-test.c | 362 ------------------------------------------- src/spatialite.mk | 30 ++-- 3 files changed, 32 insertions(+), 378 deletions(-) delete mode 100644 src/spatialite-test.c diff --git a/src/spatialite-1-fixes.patch b/src/spatialite-1-fixes.patch index d1bd03d..4802895 100644 --- a/src/spatialite-1-fixes.patch +++ b/src/spatialite-1-fixes.patch @@ -36,3 +36,21 @@ index 1111111..2222222 100644 #----------------------------------------------------------------------- # --enable-controlpoints + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luke Potgieter +Date: Mon, 2 Oct 2017 11:27:24 +0200 +Subject: [PATCH] Add static dependency to .pc file + + +diff --git a/spatialite.pc.in b/spatialite.pc.in +index 1111111..2222222 100644 +--- a/spatialite.pc.in ++++ b/spatialite.pc.in +@@ -8,5 +8,5 @@ includedir=@includedir@ + Name: spatialite + Description: Spatial SQL database engine based on SQLite + Version: @VERSION@ +-Libs: -L${libdir} -lspatialite ++Libs: -L${libdir} -lspatialite -lgeos_c -lgeos -lxml2 -lws2_32 -lstdc++ -lm + Cflags: -I${includedir} diff --git a/src/spatialite-test.c b/src/spatialite-test.c deleted file mode 100644 index 6a6e7f5..0000000 --- a/src/spatialite-test.c +++ /dev/null @@ -1,362 +0,0 @@ -/* - -demo4.c - -Author: Sandro Furieri a.furieri@lqt.it - -This software is provided 'as-is', without any express or implied -warranty. In no event will the author be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely - -*/ - -#include -#include -#include -#include - -/* -these headers are required in order to support -SQLite/SpatiaLite */ -#include -#include -#include - -int -main (int argc, char *argv[]) -{ - int ret; - sqlite3 *handle; - sqlite3_stmt *stmt; - char sql[256]; - char *err_msg = NULL; - double x; - double y; - int pk; - int ix; - int iy; - gaiaGeomCollPtr geo = NULL; - unsigned char *blob; - int blob_size; - int i; - char **results; - int n_rows; - int n_columns; - char *count; - clock_t t0; - clock_t t1; - void *cache; - - - if (argc != 2) - { - fprintf (stderr, "usage: %s test_db_path\n", argv[0]); - return -1; - } - - -/* -trying to connect the test DB: -- this demo is intended to create a new, empty database -*/ - ret = sqlite3_open_v2 (argv[1], &handle, - SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); - if (ret != SQLITE_OK) - { - printf ("cannot open '%s': %s\n", argv[1], sqlite3_errmsg (handle)); - sqlite3_close (handle); - return -1; - } - cache = spatialite_alloc_connection (); - spatialite_init_ex (handle, cache, 0); - - -/* showing the SQLite version */ - printf ("SQLite version: %s\n", sqlite3_libversion ()); -/* showing the SpatiaLite version */ - printf ("SpatiaLite version: %s\n", spatialite_version ()); - printf ("\n\n"); - - -/* -we are supposing this one is an empty database, -so we have to create the Spatial Metadata -*/ - strcpy (sql, "SELECT InitSpatialMetadata(1)"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* some error occurred */ - printf ("InitSpatialMetadata() error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - -/* -now we can create the test table -for simplicity we'll define only one column, the primary key -*/ - strcpy (sql, "CREATE TABLE test ("); - strcat (sql, "PK INTEGER NOT NULL PRIMARY KEY)"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("CREATE TABLE 'test' error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - -/* -... we'll add a Geometry column of POINT type to the test table -*/ - strcpy (sql, "SELECT AddGeometryColumn('test', 'geom', 3003, 'POINT', 2)"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("AddGeometryColumn() error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - -/* -and finally we'll enable this geo-column to have a Spatial Index based on MBR caching -*/ - strcpy (sql, "SELECT CreateMbrCache('test', 'geom')"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("CreateMbrCache() error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - printf - ("\nnow we are going to insert 1 million POINTs; wait, please ...\n\n"); - - t0 = clock (); -/* -beginning a transaction - -*** this step is absolutely critical *** - -the SQLite engine is a TRANSACTIONAL one -the whole batch of INSERTs has to be performed as an unique transaction, -otherwise performance will be surely very poor -*/ - strcpy (sql, "BEGIN"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("BEGIN error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - - -/* -preparing to populate the test table -we'll use a Prepared Statement we can reuse in order to insert each row -*/ - strcpy (sql, "INSERT INTO test (pk, geom) VALUES (?, ?)"); - ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("INSERT SQL error: %s\n", sqlite3_errmsg (handle)); - goto abort; - } - - pk = 0; - for (ix = 0; ix < 1000; ix++) - { - x = 1000000.0 + (ix * 10.0); - for (iy = 0; iy < 1000; iy++) - { -/* this double loop will insert 1 million rows into the the test table */ - - y = 4000000.0 + (iy * 10.0); - pk++; - if ((pk % 25000) == 0) - { - t1 = clock (); - printf ("insert row: %d\t\t[elapsed time: %1.3f]\n", - pk, (double) (t1 - t0) / CLOCKS_PER_SEC); - } - -/* preparing the geometry to insert */ - geo = gaiaAllocGeomColl (); - geo->Srid = 3003; - gaiaAddPointToGeomColl (geo, x, y); - -/* transforming this geometry into the SpatiaLite BLOB format */ - gaiaToSpatiaLiteBlobWkb (geo, &blob, &blob_size); - -/* we can now destroy the geometry object */ - gaiaFreeGeomColl (geo); - -/* resetting Prepared Statement and bindings */ - sqlite3_reset (stmt); - sqlite3_clear_bindings (stmt); - -/* binding parameters to Prepared Statement */ - sqlite3_bind_int64 (stmt, 1, pk); - sqlite3_bind_blob (stmt, 2, blob, blob_size, free); - -/* performing actual row insert */ - ret = sqlite3_step (stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { -/* an unexpected error occurred */ - printf ("sqlite3_step() error: %s\n", - sqlite3_errmsg (handle)); - sqlite3_finalize (stmt); - goto abort; - } - - } - } -/* we have now to finalize the query [memory cleanup] */ - sqlite3_finalize (stmt); - - - -/* -committing the transaction - -*** this step is absolutely critical *** - -if we don't confirm the still pending transaction, -any update will be lost -*/ - strcpy (sql, "COMMIT"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("COMMIT error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - - -/* -now we'll optimize the table -*/ - strcpy (sql, "ANALYZE test"); - ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("ANALYZE error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - - - for (ix = 0; ix < 3; ix++) - { - printf ("\nperforming test#%d - not using Spatial Index\n", ix); -/* -now we'll perform the spatial query WITHOUT using the Spatial Index -we'll loop 3 times in order to avoid buffering-caching side effects -*/ - strcpy (sql, "SELECT Count(*) FROM test "); - strcat (sql, "WHERE MbrWithin(geom, BuildMbr("); - strcat (sql, "1000400.5, 4000400.5, "); - strcat (sql, "1000450.5, 4000450.5))"); - t0 = clock (); - ret = sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, - &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("NoSpatialIndex SQL error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - count = (char*) ""; - for (i = 1; i <= n_rows; i++) - { - count = results[(i * n_columns) + 0]; - } - t1 = clock (); - printf ("Count(*) = %d\t\t[elapsed time: %1.4f]\n", atoi (count), - (double) (t1 - t0) / CLOCKS_PER_SEC); -/* we can now free the table results */ - sqlite3_free_table (results); - } - - - for (ix = 0; ix < 3; ix++) - { - printf ("\nperforming test#%d - using the MBR cache Spatial Index\n", - ix); -/* -now we'll perform the spatial query USING the MBR cache Spatial Index -we'll loop 3 times in order to avoid buffering-caching side effects -*/ - strcpy (sql, "SELECT Count(*) FROM test "); - strcat (sql, "WHERE ROWID IN ("); - strcat (sql, "SELECT rowid FROM cache_test_geom WHERE "); - strcat (sql, - "mbr = FilterMbrWithin(1000400.5, 4000400.5, 1000450.5, 4000450.5))"); - -/* -YES, this query is a very unhappy one -the idea is simply to simulate exactly the same conditions as above -*/ - t0 = clock (); - ret = sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, - &err_msg); - if (ret != SQLITE_OK) - { -/* an error occurred */ - printf ("SpatialIndex SQL error: %s\n", err_msg); - sqlite3_free (err_msg); - goto abort; - } - count = (char*) ""; - for (i = 1; i <= n_rows; i++) - { - count = results[(i * n_columns) + 0]; - } - t1 = clock (); - printf ("Count(*) = %d\t\t[elapsed time: %1.4f]\n", atoi (count), - (double) (t1 - t0) / CLOCKS_PER_SEC); -/* we can now free the table results */ - sqlite3_free_table (results); - } - - -/* disconnecting the test DB */ - ret = sqlite3_close (handle); - if (ret != SQLITE_OK) - { - printf ("close() error: %s\n", sqlite3_errmsg (handle)); - return -1; - } - printf ("\n\nsample successfully terminated\n"); - spatialite_cleanup_ex (cache); - return 0; - - abort: - sqlite3_close (handle); - spatialite_cleanup_ex (cache); - spatialite_shutdown(); - return -1; -} diff --git a/src/spatialite.mk b/src/spatialite.mk index c6765c8..f381b9b 100644 --- a/src/spatialite.mk +++ b/src/spatialite.mk @@ -19,25 +19,23 @@ endef define $(PKG)_BUILD # freeXL support is only necessary if you want to be able to parse .xls files. - # If you disable freexl support, remove -lfreexl from the test program below. - cd '$(1)' && autoreconf -fi -I ./m4 - cd '$(1)' && ./configure \ - $(MXE_CONFIGURE_OPTS) \ - --enable-freexl=yes \ - --with-geosconfig='$(PREFIX)/$(TARGET)/bin/geos-config' - $(MAKE) -C '$(1)' -j '$(JOBS)' $(if $(BUILD_SHARED), LDFLAGS='-no-undefined') - $(MAKE) -C '$(1)' -j 1 $(INSTALL_STRIP_LIB) + # If you disable freexl support, remove freexl from the test program below. + cd '$(SOURCE_DIR)' && autoreconf -fi -I ./m4 + cd '$(SOURCE_DIR)' && ./configure \ + $(MXE_CONFIGURE_OPTS) \ + --enable-freexl=yes \ + --with-geosconfig='$(PREFIX)/$(TARGET)/bin/geos-config' + $(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' $(if $(BUILD_SHARED), LDFLAGS='-no-undefined') + $(MAKE) -C '$(SOURCE_DIR)' -j 1 $(INSTALL_STRIP_LIB) - # compile one of the demo programs (copied from the source package) - '$(TARGET)-g++' $(if $(BUILD_SHARED), -Wno-undefined) \ - -W -Wall -Werror -ansi -pedantic \ - '$(TOP_DIR)/src/spatialite-test.c' -o '$(PREFIX)/$(TARGET)/bin/test-spatialite.exe' \ - `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` \ - `'$(TARGET)-pkg-config' sqlite3 --cflags --libs` \ - $(if $(BUILD_STATIC), -lgeos_c -lgeos -lfreexl -lxml2 -liconv -llzma -lproj -lws2_32 -lz -lstdc++ -lm) + # compile one of the demo programs + '$(TARGET)-gcc' $(if $(BUILD_SHARED), -Wno-undefined) \ + -W -Wall -ansi -pedantic \ + '$(SOURCE_DIR)/examples/demo4.c' -o '$(PREFIX)/$(TARGET)/bin/test-spatialite.exe' \ + `'$(TARGET)-pkg-config' $(PKG) sqlite3 freexl proj zlib liblzma --cflags --libs` # create a batch file to run the test program (as the program requires arguments) - (printf 'REM run against a database that should not exist, but remove afterward to save space.\r\n'; \ + (printf 'REM run against a database that should not exist, but will be removed afterward to save space.\r\n'; \ printf 'test-spatialite.exe test-db.sqlite\r\n'; \ printf 'del test-db.sqlite\r\n';) \ > '$(PREFIX)/$(TARGET)/bin/test-spatialite.bat' -- cgit v0.12 From 2aae4632d53d9f8f7286ed30b1adfa430eb6990d Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 2 Oct 2017 21:29:56 +0200 Subject: Update gdal version. Removed patch for openjpeg-2.2 as gdal now supports it directly. --- src/gdal-1-fixes.patch | 85 ++++++++++++++------------------------------------ src/gdal.mk | 4 +-- 2 files changed, 25 insertions(+), 64 deletions(-) diff --git a/src/gdal-1-fixes.patch b/src/gdal-1-fixes.patch index 0555bb1..12bde09 100644 --- a/src/gdal-1-fixes.patch +++ b/src/gdal-1-fixes.patch @@ -6,8 +6,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Potgieter Date: Tue, 29 Aug 2017 16:31:09 +0200 Subject: [PATCH] Detect spatialite more effectively than just checking for - headers in the system paths. PostgreSQL detection requires -lpthread when - building statically. Added detection for openjpeg-2.2. + headers in the system paths. PostgreSQL detection requires -lpthread when + building statically. diff --git a/configure.ac b/configure.ac @@ -23,51 +23,6 @@ index 1111111..2222222 100644 if test "${HAVE_PG}" = "yes" ; then LIBS=-L`$PG_CONFIG --libdir`" -lpq $LIBS" -@@ -2545,14 +2545,23 @@ elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then - if test "$HAVE_OPENJPEG" = "yes"; then - LIBS="-lopenjp2 $LIBS" - fi -- else -- AC_CHECK_HEADERS([openjpeg-2.1/openjpeg.h]) -- if test "$ac_cv_header_openjpeg_2_1_openjpeg_h" = "yes"; then -- AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) -- if test "$HAVE_OPENJPEG" = "yes"; then -- OPENJPEG_VERSION=20100 -- LIBS="-lopenjp2 $LIBS" -- fi -+ fi -+ -+ AC_CHECK_HEADERS([openjpeg-2.1/openjpeg.h]) -+ if test "$ac_cv_header_openjpeg_2_1_openjpeg_h" = "yes"; then -+ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) -+ if test "$HAVE_OPENJPEG" = "yes"; then -+ OPENJPEG_VERSION=20100 -+ LIBS="-lopenjp2 $LIBS" -+ fi -+ fi -+ -+ AC_CHECK_HEADERS([openjpeg-2.2/openjpeg.h]) -+ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then -+ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,) -+ if test "$HAVE_OPENJPEG" = "yes"; then -+ OPENJPEG_VERSION=20200 -+ LIBS="-lopenjp2 $LIBS" - fi - fi - else -@@ -2563,8 +2572,11 @@ else - elif test -r $with_openjpeg/include/openjpeg-2.1/openjpeg.h ; then - OPENJPEG_VERSION=20100 - EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES" -+ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then -+ OPENJPEG_VERSION=20200 -+ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES" - else -- AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1]) -+ AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0, $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2]) - fi - - AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,-L$with_openjpeg/lib) @@ -3532,16 +3544,21 @@ AC_ARG_WITH(spatialite-soname, HAVE_SPATIALITE=no @@ -93,21 +48,6 @@ index 1111111..2222222 100644 if test "$SPATIALITE_INIT_FOUND" = "yes"; then HAVE_SPATIALITE=yes SPATIALITE_LIBS="-lspatialite -lsqlite3" -diff --git a/frmts/openjpeg/openjpegdataset.cpp b/frmts/openjpeg/openjpegdataset.cpp -index 1111111..2222222 100644 ---- a/frmts/openjpeg/openjpegdataset.cpp -+++ b/frmts/openjpeg/openjpegdataset.cpp -@@ -34,7 +34,9 @@ - #pragma clang diagnostic ignored "-Wdocumentation" - #endif - --#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100 -+#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20200 -+#include -+#elif defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100 - #include - #else - #include /* openjpeg.h needs FILE* */ diff --git a/m4/geos.m4 b/m4/geos.m4 index 1111111..2222222 100644 --- a/m4/geos.m4 @@ -130,3 +70,24 @@ index 1111111..2222222 100644 AC_CHECK_LIB([geos_c], [GEOSversion], + +From: Luke Potgieter +Date: Tue, 26 Sep 2017 14:56:19 +0200 +Subject: [PATCH] Use the new proj dll version number for the latest proj. + +diff --git a/ogr/ogrct.cpp b/ogr/ogrct.cpp +index 1111111..2222222 100644 +--- a/ogr/ogrct.cpp ++++ b/ogr/ogrct.cpp +@@ -96,9 +96,9 @@ static bool bProjLocaleSafe = false; + // build) it can be named either way, so use PROJSO environment variable to + // specify the right library name. By default assume that in Cygwin/MinGW all + // components were built in the same way. +-# define LIBNAME "libproj-9.dll" ++# define LIBNAME "libproj-12.dll" + #elif defined(__CYGWIN__) +-# define LIBNAME "cygproj-9.dll" ++# define LIBNAME "cygproj-12.dll" + #elif defined(__APPLE__) + # define LIBNAME "libproj.dylib" + #else diff --git a/src/gdal.mk b/src/gdal.mk index 3f242f9..fa968f4 100644 --- a/src/gdal.mk +++ b/src/gdal.mk @@ -4,8 +4,8 @@ PKG := gdal $(PKG)_WEBSITE := http://www.gdal.org/ $(PKG)_DESCR := GDAL $(PKG)_IGNORE := -$(PKG)_VERSION := 2.2.1 -$(PKG)_CHECKSUM := 61837706abfa3e493f3550236efc2c14bd6b24650232f9107db50a944abf8b2f +$(PKG)_VERSION := 2.2.2 +$(PKG)_CHECKSUM := 14c1f78a60f429ad51c08d75cbf49771f1e6b20e7385c6e8379b40e8dfa39544 $(PKG)_SUBDIR := gdal-$($(PKG)_VERSION) $(PKG)_FILE := gdal-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/gdal/$($(PKG)_VERSION)/$($(PKG)_FILE) -- cgit v0.12 From 78f9235232ab9b4dd3393a646497010beb6f449c Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 9 Oct 2017 20:30:59 +0200 Subject: Style updates --- src/freexl.mk | 6 +++--- src/gta.mk | 1 - src/spatialite.mk | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/freexl.mk b/src/freexl.mk index 736aa10..399c9da 100644 --- a/src/freexl.mk +++ b/src/freexl.mk @@ -18,10 +18,10 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - cd '$(SOURCE_DIR)' && ./configure \ + cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \ $(MXE_CONFIGURE_OPTS) - $(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) - $(MAKE) -C '$(SOURCE_DIR)' -j 1 $(INSTALL_STRIP_LIB) + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_PROGRAMS) + $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB) # the test program comes from the freexl sources itself (test_xl.c) '$(TARGET)-gcc' \ diff --git a/src/gta.mk b/src/gta.mk index bd6cba0..afcd353 100644 --- a/src/gta.mk +++ b/src/gta.mk @@ -30,4 +30,3 @@ define $(PKG)_BUILD '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-gta.exe' \ `'$(TARGET)-pkg-config' gta --cflags --libs` endef - diff --git a/src/spatialite.mk b/src/spatialite.mk index f381b9b..185dd75 100644 --- a/src/spatialite.mk +++ b/src/spatialite.mk @@ -9,7 +9,7 @@ $(PKG)_CHECKSUM := 80f7fff0a147044c5eb197e565f598ac1f137d86d0a548cbc8f52fb7ff7ca $(PKG)_SUBDIR := libspatialite-$($(PKG)_VERSION) $(PKG)_FILE := libspatialite-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.gaia-gis.it/gaia-sins/libspatialite-sources/$($(PKG)_FILE) -$(PKG)_DEPS := dlfcn-win32 freexl geos sqlite zlib proj libiconv libxml2 +$(PKG)_DEPS := gcc dlfcn-win32 freexl geos sqlite zlib proj libiconv libxml2 define $(PKG)_UPDATE $(WGET) -q -O- 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/' | \ -- cgit v0.12 From c4ea4be28b2096ca087641d5e5a07ea9030866a3 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Tue, 10 Oct 2017 14:38:27 +1100 Subject: ossim: update and switch to github The master branch appears to be a stable release branch so track that instead of tags which have unpredictable names --- src/ossim-1-fixes.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ src/ossim.mk | 30 +++++++++------------------ 2 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 src/ossim-1-fixes.patch diff --git a/src/ossim-1-fixes.patch b/src/ossim-1-fixes.patch new file mode 100644 index 0000000..f2c3df9 --- /dev/null +++ b/src/ossim-1-fixes.patch @@ -0,0 +1,54 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore +Date: Tue, 10 Oct 2017 13:15:27 +1100 +Subject: [PATCH] fix deprecated WIN32 definition + +taken from: +https://github.com/ossimlabs/ossim/issues/153 + +diff --git a/src/util/ossimBatchTest.cpp b/src/util/ossimBatchTest.cpp +index 1111111..2222222 100644 +--- a/src/util/ossimBatchTest.cpp ++++ b/src/util/ossimBatchTest.cpp +@@ -72,7 +72,7 @@ bool ossimBatchTest::initialize(ossimArgumentParser& ap) + } + + // Initialize environment: +-#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) ++#if defined(_WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) + _putenv("DEL_CMD=del /Q"); // For backwards compatiblity. + _putenv("DIFF_CMD=fc /W"); + _putenv("COPY_CMD=copy /Y"); + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore +Date: Tue, 10 Oct 2017 13:26:49 +1100 +Subject: [PATCH] set windows shared/static defs using cmake options + +taken from: +https://github.com/ossimlabs/ossim/issues/153 + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 1111111..2222222 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -34,7 +34,14 @@ ELSE (OSSIM_HAS_HDF5) + message( STATUS "HDF5 components are being excluded from the build." ) + ENDIF (OSSIM_HAS_HDF5) + +-ADD_DEFINITIONS("-DOSSIMMAKINGDLL") ++IF (WIN32) ++ IF (BUILD_SHARED) ++ ADD_DEFINITIONS("-DOSSIMMAKINGDLL") ++ ELSE (BUILD_SHARED) ++ ADD_DEFINITIONS("-DOSSIM_STATIC") ++ ENDIF (BUILD_SHARED) ++ENDIF (WIN32) ++ + ############################### GRAB HEADERS ##################################### + FILE(GLOB ossim_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/*.h") + FILE(GLOB ossim_base_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/base/*.h") diff --git a/src/ossim.mk b/src/ossim.mk index 48b2f42..199bf8e 100644 --- a/src/ossim.mk +++ b/src/ossim.mk @@ -4,31 +4,21 @@ PKG := ossim $(PKG)_WEBSITE := https://trac.osgeo.org/ossim $(PKG)_DESCR := OSSIM $(PKG)_IGNORE := -$(PKG)_VERSION := 1.8.20 -$(PKG)_CHECKSUM := d7981d0d7e84bdbc26d5bda9e5b80c583d806164e4d6e5fab276c9255a2b407c -$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)-3 -$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz -$(PKG)_URL := http://download.osgeo.org/ossim/source/$(PKG)-$($(PKG)_VERSION)/$($(PKG)_FILE) -$(PKG)_DEPS := gcc freetype geos jpeg libgeotiff libpng openthreads proj tiff zlib - -define $(PKG)_UPDATE - $(WGET) -q -O- 'http://download.osgeo.org/ossim/source/latest/' | \ - $(SED) -n 's,.*ossim-\([0-9][^>]*\)\.tar.*,\1,p' | \ - head -1 -endef +$(PKG)_VERSION := 43a071a +$(PKG)_CHECKSUM := 1796994c8586e62ef799724969e3bef57178194fafe056db3de41dd6ee0dc931 +# releases have unpredictable names and are based on master branch +$(PKG)_GH_CONF := ossimlabs/ossim/master +$(PKG)_DEPS := gcc freetype geos jpeg hdf5 libgeotiff libpng openthreads proj tiff zlib define $(PKG)_BUILD - mkdir '$(1).build' - cd '$(1).build' && '$(TARGET)-cmake' \ + cd '$(BUILD_DIR)' && '$(TARGET)-cmake' '$(SOURCE_DIR)' \ -DCMAKE_VERBOSE_MAKEFILE=TRUE \ - -DPKG_CONFIG_EXECUTABLE='$(PREFIX)/bin/$(TARGET)-pkg-config' \ - -DCMAKE_MODULE_PATH='$(1)/ossim_package_support/cmake/CMakeModules' \ -DBUILD_OSSIM_FREETYPE_SUPPORT=TRUE \ -DBUILD_OSSIM_CURL_APPS=FALSE \ - -DBUILD_OSSIM_TEST_APPS=FALSE \ + -DBUILD_OSSIM_TESTS=FALSE \ -DBUILD_OSSIM_APPS=FALSE \ - -DCMAKE_CXX_FLAGS='-DGEOS_INLINE=1' \ - '$(1)/ossim' + -DCMAKE_CXX_FLAGS='-DGEOS_INLINE=1' - $(MAKE) -C '$(1).build' -j '$(JOBS)' install VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1 endef -- cgit v0.12