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

openssl: make things a bit more generic #23304

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
26 changes: 13 additions & 13 deletions recipes/openssl/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun
from conan.tools.build import build_jobs
from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save

Check warning on line 5 in recipes/openssl/3.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused rename imported from conan.tools.files
from conan.tools.gnu import AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path
from conan.tools.scm import Version

Check warning on line 9 in recipes/openssl/3.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused Version imported from conan.tools.scm

import fnmatch
import os
Expand Down Expand Up @@ -464,7 +464,7 @@
shared_target = ""
if self.settings.os == "Neutrino":
if self.options.shared:
shared_extension = 'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",'

Check warning on line 467 in recipes/openssl/3.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
shared_target = 'shared_target => "gnu-shared",'
if self.options.get_safe("fPIC", True):
shared_cflag = 'shared_cflag => "-fPIC",'
Expand Down Expand Up @@ -590,33 +590,33 @@
${OpenSSL_Crypto_DEPENDENCIES}
${OpenSSL_Crypto_FRAMEWORKS}
${OpenSSL_Crypto_SYSTEM_LIBS})
elseif(DEFINED openssl_OpenSSL_Crypto_LIBS_%(config)s)
set(OPENSSL_CRYPTO_LIBRARY ${openssl_OpenSSL_Crypto_LIBS_%(config)s})
set(OPENSSL_CRYPTO_LIBRARIES ${openssl_OpenSSL_Crypto_LIBS_%(config)s}
${openssl_OpenSSL_Crypto_DEPENDENCIES_%(config)s}
${openssl_OpenSSL_Crypto_FRAMEWORKS_%(config)s}
${openssl_OpenSSL_Crypto_SYSTEM_LIBS_%(config)s})
elseif(DEFINED %(package_name)s_OpenSSL_Crypto_LIBS_%(config)s)
set(OPENSSL_CRYPTO_LIBRARY ${%(package_name)s_OpenSSL_Crypto_LIBS_%(config)s})
set(OPENSSL_CRYPTO_LIBRARIES ${%(package_name)s_OpenSSL_Crypto_LIBS_%(config)s}
${%(package_name)s_OpenSSL_Crypto_DEPENDENCIES_%(config)s}
${%(package_name)s_OpenSSL_Crypto_FRAMEWORKS_%(config)s}
${%(package_name)s_OpenSSL_Crypto_SYSTEM_LIBS_%(config)s})
endif()
if(DEFINED OpenSSL_SSL_LIBS)
set(OPENSSL_SSL_LIBRARY ${OpenSSL_SSL_LIBS})
set(OPENSSL_SSL_LIBRARIES ${OpenSSL_SSL_LIBS}
${OpenSSL_SSL_DEPENDENCIES}
${OpenSSL_SSL_FRAMEWORKS}
${OpenSSL_SSL_SYSTEM_LIBS})
elseif(DEFINED openssl_OpenSSL_SSL_LIBS_%(config)s)
set(OPENSSL_SSL_LIBRARY ${openssl_OpenSSL_SSL_LIBS_%(config)s})
set(OPENSSL_SSL_LIBRARIES ${openssl_OpenSSL_SSL_LIBS_%(config)s}
${openssl_OpenSSL_SSL_DEPENDENCIES_%(config)s}
${openssl_OpenSSL_SSL_FRAMEWORKS_%(config)s}
${openssl_OpenSSL_SSL_SYSTEM_LIBS_%(config)s})
elseif(DEFINED %(package_name)s_OpenSSL_SSL_LIBS_%(config)s)
set(OPENSSL_SSL_LIBRARY ${%(package_name)s_OpenSSL_SSL_LIBS_%(config)s})
set(OPENSSL_SSL_LIBRARIES ${%(package_name)s_OpenSSL_SSL_LIBS_%(config)s}
${%(package_name)s_OpenSSL_SSL_DEPENDENCIES_%(config)s}
${%(package_name)s_OpenSSL_SSL_FRAMEWORKS_%(config)s}
${%(package_name)s_OpenSSL_SSL_SYSTEM_LIBS_%(config)s})
endif()
if(DEFINED OpenSSL_LIBRARIES)
set(OPENSSL_LIBRARIES ${OpenSSL_LIBRARIES})
endif()
if(DEFINED OpenSSL_VERSION)
set(OPENSSL_VERSION ${OpenSSL_VERSION})
endif()
"""% {"config":str(self.settings.build_type).upper()})
"""% {"config":str(self.settings.build_type).upper(), "package_name":self.name})
save(self, module_file, content)

@property
Expand Down
10 changes: 5 additions & 5 deletions recipes/openssl/3.x.x/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def requirements(self):
self.requires(self.tested_reference_str)

def _with_legacy(self):
return (not self.dependencies["openssl"].options.no_legacy and
((not self.dependencies["openssl"].options.no_md4) or
(not self.dependencies["openssl"].options.no_rmd160)))
return (not self.dependencies[self.tested_reference_str].options.no_legacy and
((not self.dependencies[self.tested_reference_str].options.no_md4) or
(not self.dependencies[self.tested_reference_str].options.no_rmd160)))

def generate(self):
tc = CMakeToolchain(self)
tc.cache_variables["OPENSSL_WITH_LEGACY"] = self._with_legacy()
tc.cache_variables["OPENSSL_WITH_MD4"] = not self.dependencies["openssl"].options.no_md4
tc.cache_variables["OPENSSL_WITH_RIPEMD160"] = not self.dependencies["openssl"].options.no_rmd160
tc.cache_variables["OPENSSL_WITH_MD4"] = not self.dependencies[self.tested_reference_str].options.no_md4
tc.cache_variables["OPENSSL_WITH_RIPEMD160"] = not self.dependencies[self.tested_reference_str].options.no_rmd160
tc.generate()

def build(self):
Expand Down
Loading