Skip to content

Commit

Permalink
(conan-io#24462) polylabel: add version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
toge authored Jun 28, 2024
1 parent c7af337 commit 635672d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 36 deletions.
3 changes: 3 additions & 0 deletions recipes/polylabel/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.0.0":
url: "https://github.com/mapbox/polylabel/archive/refs/tags/v2.0.0.tar.gz"
sha256: "9aba4320c6cb5a8e9a8d44feb0d68b79b3127bdcb759a26aca92ac637668d7b9"
"1.1.0":
url: "https://github.com/mapbox/polylabel/archive/refs/tags/v1.1.0.tar.gz"
sha256: "3694a3127954fab760686c825e2e585684934c768b5f9d542b8701e54147f1a8"
34 changes: 26 additions & 8 deletions recipes/polylabel/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os

required_conan_version = ">=1.52.0"
Expand All @@ -10,13 +12,28 @@
class PolylabelConan(ConanFile):
name = "polylabel"
description = "A fast algorithm for finding the pole of inaccessibility of a polygon."
topics = ("polygon", "pole-of-inaccessibility")
license = "ISC"
homepage = "https://github.com/mapbox/polylabel"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/mapbox/polylabel"
topics = ("polygon", "pole-of-inaccessibility", "header-only")
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

@property
def _min_cppstd(self):
return 14

@property
def _compilers_minimum_version(self):
return {
"gcc": "6",
"clang": "5",
"apple-clang": "10",
"Visual Studio": "15",
"msvc": "191",
}

def layout(self):
basic_layout(self, src_folder="src")

Expand All @@ -28,14 +45,15 @@ def package_id(self):

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 14)
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)

def build(self):
pass
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def package(self):
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
Expand Down
11 changes: 0 additions & 11 deletions recipes/polylabel/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/polylabel/all/test_v1_package/conanfile.py

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/polylabel/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"2.0.0":
folder: all
"1.1.0":
folder: all

0 comments on commit 635672d

Please sign in to comment.