aboutsummaryrefslogtreecommitdiff
path: root/ports/geos
diff options
context:
space:
mode:
Diffstat (limited to 'ports/geos')
-rw-r--r--ports/geos/CONTROL2
-rw-r--r--ports/geos/geos_c-static-support.patch110
-rw-r--r--ports/geos/portfile.cmake30
3 files changed, 129 insertions, 13 deletions
diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL
index c0ec7b134..3d2ed4565 100644
--- a/ports/geos/CONTROL
+++ b/ports/geos/CONTROL
@@ -1,3 +1,3 @@
Source: geos
-Version: 3.5.0
+Version: 3.6.2-1
Description: Geometry Engine Open Source
diff --git a/ports/geos/geos_c-static-support.patch b/ports/geos/geos_c-static-support.patch
new file mode 100644
index 000000000..148e63057
--- /dev/null
+++ b/ports/geos/geos_c-static-support.patch
@@ -0,0 +1,110 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 927a0fe..8e6c3ea 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,11 +66,7 @@ if(NOT MSVC)
+ "Set to ON|OFF (default) to build GEOS with assert() macro enabled" OFF)
+ endif()
+
+-option(GEOS_BUILD_STATIC
+- "Set to OFF|ON (default) to build GEOS static libraries" ON)
+-
+-option(GEOS_BUILD_SHARED
+- "Set to OFF|ON (default) to build GEOS shared libraries" ON)
++option(BUILD_SHARED_LIBS "Build GEOS as a shared library" ON)
+
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ option(GEOS_ENABLE_FLOATSTORE
+diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt
+index 859722b..b6e44b6 100644
+--- a/capi/CMakeLists.txt
++++ b/capi/CMakeLists.txt
+@@ -23,15 +23,23 @@ file(GLOB geos_capi_HEADERS ${CMAKE_BINARY_DIR}/capi/*.h) # fix source_group iss
+
+ if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK)
+ # if building OS X framework, CAPI built into C++ library
+- add_library(geos_c SHARED ${geos_c_SOURCES})
++ add_library(geos_c ${geos_c_SOURCES})
+
+ target_link_libraries(geos_c geos)
+
+ if (WIN32)
+- set_target_properties(geos_c
+- PROPERTIES
+- VERSION ${CAPI_VERSION}
+- CLEAN_DIRECT_OUTPUT 1)
++ if(BUILD_SHARED_LIBS)
++ set_target_properties(geos_c
++ PROPERTIES
++ VERSION ${CAPI_VERSION}
++ CLEAN_DIRECT_OUTPUT 1)
++ else()
++ set_target_properties(geos_c
++ PROPERTIES
++ OUTPUT_NAME "geos_c"
++ PREFIX "lib"
++ CLEAN_DIRECT_OUTPUT 1)
++ endif()
+ else()
+ set_target_properties(geos_c
+ PROPERTIES
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 4a1e688..a33b5f6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -23,7 +23,7 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK)
+ ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_c.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_ts_c.cpp)
+
+- add_library(GEOS SHARED ${geos_SOURCES} ${geos_c_SOURCES})
++ add_library(GEOS ${geos_SOURCES} ${geos_c_SOURCES})
+
+ math(EXPR CVERSION "${VERSION_MAJOR} + 1")
+ # VERSION = current version, SOVERSION = compatibility version
+@@ -61,37 +61,27 @@ if(GEOS_ENABLE_MACOSX_FRAMEWORK)
+
+ else()
+
+- if(GEOS_BUILD_SHARED)
+- add_library(geos SHARED ${geos_SOURCES} ${geos_ALL_HEADERS})
++ add_library(geos ${geos_SOURCES} ${geos_ALL_HEADERS})
+
++ if(BUILD_SHARED_LIBS)
+ set_target_properties(geos
+ PROPERTIES
+ DEFINE_SYMBOL GEOS_DLL_EXPORT
+ VERSION ${VERSION}
+ CLEAN_DIRECT_OUTPUT 1)
+-
+- install(TARGETS geos
+- RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib)
+- endif()
+-
+- if(GEOS_BUILD_STATIC)
+- add_library(geos-static STATIC ${geos_SOURCES} ${geos_ALL_HEADERS})
+-
+- set_target_properties(geos-static
++ else()
++ set_target_properties(geos
+ PROPERTIES
+ OUTPUT_NAME "geos"
+ PREFIX "lib"
+ CLEAN_DIRECT_OUTPUT 1)
+-
+- install(TARGETS geos-static
+- RUNTIME DESTINATION bin
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib)
+-
+ endif()
+
++ install(TARGETS geos
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
++
+ endif() # (GEOS_ENABLE_MACOSX_FRAMEWORK)
+
+ # if(APPLE)
diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake
index 7cd50db58..ec88a0f57 100644
--- a/ports/geos/portfile.cmake
+++ b/ports/geos/portfile.cmake
@@ -7,25 +7,31 @@
#
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/3.5)
-#downloading 3.5 from their SVN repo and not the release tarball
-#because the 3.5 release did not build on windows, and fixes were backported
-#without generating a new release tarball (I don't think very many GIS people use win)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/geos-3.6.2)
+
vcpkg_download_distfile(ARCHIVE
- URLS "https://trac.osgeo.org/geos/browser/branches/3.5?rev=4261&format=zip"
- FILENAME "geos-3.5.0.zip"
- SHA512 3b91e8992f60b99a3f01069d955b71bce425ae5e5c599252fa26a337494e1a5a8ea796be124766d054710d6c03806f56dc1c63539b4660e2bb894d7ef779d4b9
+ URLS "http://download.osgeo.org/geos/geos-3.6.2.tar.bz2"
+ FILENAME "geos-3.6.2.tar.bz2"
+ SHA512 515d8700b8a28282678e481faee355e3a43d7b70160472a63335b8d7225d9ba10437be782378f18f31a15288118126d411a2d862f01ce35d27c96f6bc0a73016
)
vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_apply_patches(
+
+SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/geos_c-static-support.patch
+)
+
+# NOTE: GEOS provides CMake as optional build configuration, it might not be actively
+# maintained, so CMake build issues may happen between releases.
+
+# Pull modules referred in the main CMakeLists.txt but missing from the released package.
+# TODO: GEOS 3.6.3 or later will include the missing script in release package.
+file(DOWNLOAD http://svn.osgeo.org/geos/branches/3.6/cmake/modules/GenerateSourceGroups.cmake
+ ${SOURCE_PATH}/cmake/modules/GenerateSourceGroups.cmake)
-#we need to do this because GEOS deploy process is totally broken for cmake
-#file(DOWNLOAD http://svn.osgeo.org/geos/tags/3.5.0/cmake/modules/GenerateSourceGroups.cmake
-# ${SOURCE_PATH}/cmake/modules/GenerateSourceGroups.cmake)
-file(WRITE ${SOURCE_PATH}/geos_svn_revision.h "#define GEOS_SVN_REVISION 4261")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DGEOS_ENABLE_TESTS=False
- -DBUILD_TESTING=False
)
vcpkg_build_cmake()