switch geos build system to cmake, add patch
autotools version was creating incorrect c++ dlls
This commit is contained in:
49
mingw-w64-geos/01-fix-buildsystem.patch
Normal file
49
mingw-w64-geos/01-fix-buildsystem.patch
Normal file
@@ -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 <cmath>
|
||||
+ 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 <cmath>
|
||||
+ 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)
|
||||
@@ -1,34 +1,44 @@
|
||||
# Maintainer: Alexey Kasatkin <alexeikasatkin@gmail.com>
|
||||
# Maintainer in ArchLinux: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
|
||||
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
|
||||
# Contributor: William Rea <sillywilly@gmail.com>
|
||||
# Contributor: Alexander Rødseth <rodseth@gmail.com>
|
||||
|
||||
_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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user