Skip to content

Commit

Permalink
geos: add v3.12.1, simplify patching
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 6, 2023
1 parent 7ca6977 commit 4b75727
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 44 deletions.
9 changes: 3 additions & 6 deletions recipes/geos/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.12.1":
url: "https://github.com/libgeos/geos/releases/download/3.12.1/geos-3.12.1.tar.bz2"
sha256: "d6ea7e492224b51193e8244fe3ec17c4d44d0777f3c32ca4fb171140549a0d03"
"3.12.0":
url: "https://github.com/libgeos/geos/releases/download/3.12.0/geos-3.12.0.tar.bz2"
sha256: "d96db96011259178a35555a0f6d6e75a739e52a495a6b2aa5efb3d75390fbc39"
Expand All @@ -17,9 +20,3 @@ sources:
"3.10.2":
url: "https://download.osgeo.org/geos/geos-3.10.2.tar.bz2"
sha256: "50bbc599ac386b4c2b3962dcc411f0040a61f204aaef4eba7225ecdd0cf45715"
patches:
"3.12.0":
- patch_file: "patches/3.12.0-0001-fix-cmake.patch"
patch_description: "Fix CMake on Windows with Visual Studio"
patch_type: "official"
patch_source: "https://github.com/libgeos/geos/pull/945"
17 changes: 10 additions & 7 deletions recipes/geos/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd, stdcpp_library
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches
from conan.tools.files import copy, get, rmdir, replace_in_file
from conan.tools.scm import Version
import os

Expand All @@ -11,10 +11,10 @@

class GeosConan(ConanFile):
name = "geos"
description = "C++11 library for performing operations on two-dimensional vector geometries"
description = "GEOS is a C++ library for performing operations on two-dimensional vector geometries."
license = "LGPL-2.1"
topics = ("osgeo", "geometry", "topology", "geospatial")
homepage = "https://trac.osgeo.org/geos"
homepage = "https://libgeos.org/"
url = "https://github.com/conan-io/conan-center-index"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
Expand Down Expand Up @@ -51,9 +51,6 @@ def _compilers_minimum_version(self):
def _has_inline_option(self):
return Version(self.version) < "3.11.0"

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand Down Expand Up @@ -96,8 +93,14 @@ def generate(self):
tc.variables["BUILD_GEOSOP"] = self.options.utils
tc.generate()

def _patch_sources(self):
# Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are used.
# https://github.com/libgeos/geos/pull/945
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
"set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})", "", strict=False)

def build(self):
apply_conandata_patches(self)
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
31 changes: 0 additions & 31 deletions recipes/geos/all/patches/3.12.0-0001-fix-cmake.patch

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/geos/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.12.1":
folder: all
"3.12.0":
folder: all
"3.11.2":
Expand Down

0 comments on commit 4b75727

Please sign in to comment.