Skip to content

Commit

Permalink
(#12356) feat: update xapian-core dependency of doxygen to most recen…
Browse files Browse the repository at this point in the history
…t version

* feat: update xapian-core dependency of doxygen to most recent version

* fix: apply Conan 2 linter suggestions

* fix: use correct version check

* fix: use correct tools params

* fix: set empty include dirs

* set minimum conan version

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
  • Loading branch information
Pro and prince-chrismc authored Aug 22, 2022
1 parent cc6e84c commit 08ed2e5
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions recipes/doxygen/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.tools.scm import Version
from conan import tools
from conans import CMake
from conan.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.50.2"


class DoxygenConan(ConanFile):
Expand Down Expand Up @@ -41,7 +44,7 @@ def _settings_build(self):
return getattr(self, "settings_build", self.settings)

def _minimum_compiler_version(self):
if tools.Version(self.version) <= "1.9.1":
if Version(self.version) <= "1.9.1":
return {
"gcc": 5,
}.get(str(self.settings.compiler))
Expand All @@ -54,7 +57,7 @@ def configure(self):
del self.settings.compiler.cppstd
def requirements(self):
if self.options.enable_search:
self.requires("xapian-core/1.4.18")
self.requires("xapian-core/1.4.19")
self.requires("zlib/1.2.12")

def build_requirements(self):
Expand All @@ -67,13 +70,12 @@ def build_requirements(self):
def validate(self):
minimum_compiler_version = self._minimum_compiler_version()
if minimum_compiler_version is not None:
if tools.Version(self.settings.compiler.version) < minimum_compiler_version:
raise ConanInvalidConfiguration("Compiler version too old. At least {} is required.".format(minimum_compiler_version))
if Version(self.settings.compiler.version) < minimum_compiler_version:
raise ConanInvalidConfiguration(f"Compiler version too old. At least {minimum_compiler_version} is required.")
if (self.settings.compiler == "Visual Studio" and
tools.Version(self.settings.compiler.version.value) <= 14 and
tools.Version(self.version) == "1.8.18"):
raise ConanInvalidConfiguration("Doxygen version {} broken with VS {}.".format(self.version,
self.settings.compiler.version))
Version(self.settings.compiler.version) <= "14" and
Version(self.version) == "1.8.18"):
raise ConanInvalidConfiguration(f"Doxygen version {self.version} broken with VS {self.settings.compiler.version}.")

def package_id(self):
del self.info.settings.compiler
Expand All @@ -86,7 +88,7 @@ def package_id(self):
self.compatible_packages.append(compatible_pkg)

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

def _configure_cmake(self):
Expand All @@ -106,7 +108,7 @@ def build(self):
if os.path.isfile("Findbison.cmake"):
os.unlink("Findbison.cmake")
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
tools.files.patch(self, **patch)
cmake = self._configure_cmake()
cmake.build()

Expand All @@ -117,6 +119,7 @@ def package(self):

def package_info(self):
self.cpp_info.libdirs = []
self.cpp_info.includedirs = []
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.output.info(f"Appending PATH environment variable: {bin_path}")
self.env_info.PATH.append(bin_path)

0 comments on commit 08ed2e5

Please sign in to comment.