Skip to content

Commit

Permalink
(#15268) qpdf: modernize
Browse files Browse the repository at this point in the history
* qpdf: modernize

* Keep cast to str
  • Loading branch information
Chris Mc authored Jan 27, 2023
1 parent 1ca7e2f commit cb472f3
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions recipes/qpdf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from conan.tools.scm import Version
from conan.tools.files import replace_in_file, apply_conandata_patches, export_conandata_patches, get, copy, rmdir
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.microsoft import is_msvc, check_min_vs
from conan.tools.microsoft import check_min_vs
from conan.tools.env import VirtualBuildEnv
import os

required_conan_version = ">=1.52.0"
required_conan_version = ">=1.53.0"

class PackageConan(ConanFile):
name = "qpdf"
Expand Down Expand Up @@ -52,10 +52,7 @@ def config_options(self):

def configure(self):
if self.options.shared:
try:
del self.options.fPIC
except Exception:
pass
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -64,7 +61,7 @@ def requirements(self):
# https://qpdf.readthedocs.io/en/stable/installation.html#basic-dependencies
self.requires("zlib/1.2.13")
if self.options.with_ssl == "openssl":
self.requires("openssl/1.1.1q")
self.requires("openssl/1.1.1s")
elif self.options.with_ssl == "gnutls":
raise ConanInvalidConfiguration("GnuTLS is not available in Conan Center yet.")
if self.options.with_jpeg == "libjpeg":
Expand All @@ -76,22 +73,19 @@ def requirements(self):


def validate(self):
if self.info.settings.compiler.cppstd:
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._minimum_cpp_standard)
if is_msvc(self):
check_min_vs(self, "150")
else:
minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False)
if minimum_version and Version(self.info.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.")
check_min_vs(self, "150")
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._minimum_cpp_standard}, which your compiler does not support.")

def build_requirements(self):
self.tool_requires("cmake/3.24.1")
self.tool_requires("pkgconf/1.9.3")

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

def generate(self):
tc = CMakeToolchain(self)
Expand Down

0 comments on commit cb472f3

Please sign in to comment.