Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix openssl old version access to shared option of zlib #12302

Merged
merged 6 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from conan.tools.files import rename
from conan.tools.files import rename, get, rmdir
from conan.tools.microsoft import is_msvc, msvc_runtime_flag
from conans.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.errors import ConanInvalidConfiguration
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from contextlib import contextmanager
from functools import total_ordering
Expand Down Expand Up @@ -171,7 +172,7 @@ def _full_version(self):
def _win_bash(self):
return self._settings_build.os == "Windows" and \
not self._use_nmake and \
(self._is_mingw or tools.cross_building(self, skip_x64_x86=True))
(self._is_mingw or cross_building(self, skip_x64_x86=True))

def export_sources(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
Expand Down Expand Up @@ -244,8 +245,8 @@ def build_requirements(self):
self.build_requires("msys2/cci.latest")

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

@property
def _target_prefix(self):
Expand Down Expand Up @@ -540,7 +541,7 @@ def _configure_args(self):
include_path = self._adjust_path(include_path)
lib_path = self._adjust_path(lib_path)

if zlib_info.shared:
if self.options["zlib"].shared:
args.append("zlib-dynamic")
else:
args.append("zlib")
Expand Down Expand Up @@ -813,7 +814,7 @@ def package(self):
if file.endswith(".a"):
os.unlink(os.path.join(libdir, file))

tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))

self._create_cmake_module_variables(
os.path.join(self.package_folder, self._module_file_rel_path)
Expand Down
8 changes: 5 additions & 3 deletions recipes/openssl/1.x.x/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from conans import CMake, tools, ConanFile
from conans import CMake, ConanFile
from conan.tools.scm import Version
from conan.tools.build import cross_building
import os


Expand All @@ -23,7 +25,7 @@ def build(self):
cmake = CMake(self)
if self.settings.os == "Android":
cmake.definitions["CONAN_LIBCXX"] = ""
openssl_version = tools.Version(self.deps_cpp_info["openssl"].version)
openssl_version = Version(self.deps_cpp_info["openssl"].version)
if openssl_version.major == "1" and openssl_version.minor == "1":
cmake.definitions["OPENSSL_WITH_ZLIB"] = False
else:
Expand All @@ -32,7 +34,7 @@ def build(self):
cmake.build()

def test(self):
if not self._skip_test and not tools.cross_building(self):
if not self._skip_test and not cross_building(self):
bin_path = os.path.join("bin", "digest")
self.run(bin_path, run_environment=True)
assert os.path.exists(os.path.join(self.deps_cpp_info["openssl"].rootpath, "licenses", "LICENSE"))