From 4e8f87195adda3d07ebc0dfcff5527b9f52f0dcd Mon Sep 17 00:00:00 2001 From: alex85k Date: Tue, 11 Nov 2014 21:52:01 +0500 Subject: [PATCH] switch geos build system to cmake, add patch autotools version was creating incorrect c++ dlls --- mingw-w64-geos/01-fix-buildsystem.patch | 49 +++++++++++++++++++++++++ mingw-w64-geos/PKGBUILD | 36 +++++++++++------- 2 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 mingw-w64-geos/01-fix-buildsystem.patch diff --git a/mingw-w64-geos/01-fix-buildsystem.patch b/mingw-w64-geos/01-fix-buildsystem.patch new file mode 100644 index 0000000000..59b6454348 --- /dev/null +++ b/mingw-w64-geos/01-fix-buildsystem.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52b4463..8051ecb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,7 +111,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long") + + # Turn on Position Independent Code generation for GEOS C shared library +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + + # Enable glibc ISO C99 features (macros isfinite, isnan) + set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_ISOC99_SOURCE=1") +@@ -183,7 +182,10 @@ endif() + include(CheckPrototypeExists) + include(CheckSymbolExists) + +-check_prototype_exists(isnan cmath HAVE_STD_ISNAN) ++check_cxx_source_compiles( ++ "#include ++ int main() { double x=0.1; return std::isnan(x)?1:0; }" ++ HAVE_STD_ISNAN) + if(NOT HAVE_STD_ISNAN) + if(MSVC) + check_prototype_exists(_isnan float.h HAVE_ISNAN) +@@ -197,7 +199,10 @@ if(NOT HAVE_STD_ISNAN) + endif() + endif() + +-check_prototype_exists(isfinite cmath HAVE_STD_ISFINITE) ++check_cxx_source_compiles( ++ "#include ++ int main() { double x=0.1; return std::isfinite(x)?1:0; }" ++ HAVE_STD_ISFINITE) + + if(NOT HAVE_STD_ISFINITE) + if(MSVC) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index ee5b2d4..32fea3d 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -11,7 +11,7 @@ + # + ################################################################################# + +-if(UNIX) ++if(UNIX OR MINGW) + + if(APPLE AND GEOS_ENABLE_MACOSX_FRAMEWORK AND GEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT) + set(installdest GEOS.framework/Versions/${VERSION_MAJOR}/unix/bin) diff --git a/mingw-w64-geos/PKGBUILD b/mingw-w64-geos/PKGBUILD index 66698eda84..10443e88b1 100644 --- a/mingw-w64-geos/PKGBUILD +++ b/mingw-w64-geos/PKGBUILD @@ -1,34 +1,44 @@ # Maintainer: Alexey Kasatkin -# Maintainer in ArchLinux: Jaroslav Lichtblau -# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org -# Contributor: William Rea -# Contributor: Alexander Rødseth _realname=geos pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=3.4.2 -pkgrel=2 +pkgrel=3 pkgdesc="C++ port of the Java Topology Suite (mingw-w64)" arch=('any') url="http://trac.osgeo.org/geos/" license=('LGPL') makedepends=("${MINGW_PACKAGE_PREFIX}-gcc") options=('strip' '!emptydirs') -source=(http://download.osgeo.org/geos/geos-$pkgver.tar.bz2) -sha256sums=('15e8bfdf7e29087a957b56ac543ea9a80321481cef4d4f63a7b268953ad26c53') +source=(http://download.osgeo.org/geos/geos-$pkgver.tar.bz2 + 01-fix-buildsystem.patch) +sha256sums=('15e8bfdf7e29087a957b56ac543ea9a80321481cef4d4f63a7b268953ad26c53' + '89cd30338e6d29bfb0b1f50565b6ac32f85a4e327fbcfa025f20e51af4abae27') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + patch -p1 -i ${srcdir}/01-fix-buildsystem.patch +} build() { mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" - ../${_realname}-${pkgver}/configure \ - --prefix=${MINGW_PREFIX} \ - --build=${MINGW_CHOST} \ - --host=${MINGW_CHOST} - + ${MINGW_PREFIX}/bin/cmake \ + -G"MSYS Makefiles" \ + -DCMAKE_INSTALL_PREFIX=${pkgdir}${MINGW_PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTS=ON \ + -DGEOS_ENABLE_INLINE=OFF \ + ../${_realname}-${pkgver} make } package() { cd "${srcdir}/build-${MINGW_CHOST}" - make DESTDIR=${pkgdir} install + make install +} + +check() { + cd "${srcdir}/build-${MINGW_CHOST}" + ctest }