Skip to content
Merged
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
26 changes: 26 additions & 0 deletions contrib/hooks/bumpOpenSSL.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS


def parse_hook(ec, *args, **kwargs):
"""
EasyBuild parse hook for EL9+ compatibility
"""
# looks like [('zlib', '1.2.13'), ('OpenSSL', '1.1', '', {'name': 'system', 'version': 'system'})]
raw_deps = ec['dependencies'] if 'dependencies' in ec else []

# Check if OpenSSL is in any dependency tuple's first element
openssl_found = any(dep[0] == 'OpenSSL' for dep in raw_deps)

# if found, replace its version - second element in the tuple with '3'.
if openssl_found:
print(f"[openssl1->3 hook] OpenSSL found in dependencies of {ec['name']}, replacing with OpenSSL 3")
for i, dep in enumerate(raw_deps):
if dep[0] == 'OpenSSL' and dep[1] == '1.1':
raw_deps[i] = ('OpenSSL', '3', '', EASYCONFIG_CONSTANTS['SYSTEM'][0])
break

else:
# no need to do anything
return

ec['dependencies'] = raw_deps