From 8a6574eb69f93e82f4c887af76ad3b2abada2448 Mon Sep 17 00:00:00 2001 From: "Paul C. Martin" Date: Thu, 19 Dec 2024 21:05:33 -0500 Subject: [PATCH] Add libyaml --- CHANGELOG.md | 9 +++++++++ relenv/build/linux.py | 43 +++++++++++++++++++++++++++++++++++++++++++ relenv/common.py | 2 +- relenv/runtime.py | 2 +- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6323b41..76ecfb38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +0.19.4 +====== + +* Add libyaml 0.2.5 to address error during build + "yaml/_yaml.h:2:10: fatal error: yaml.h: No such file or directory" +* Update _CONFIG_VARS_DEFAULTS to point to python 3.9, because 3.8 + is unsupported. + + 0.19.3 ====== diff --git a/relenv/build/linux.py b/relenv/build/linux.py index 3f3878e2..59404cc6 100644 --- a/relenv/build/linux.py +++ b/relenv/build/linux.py @@ -340,6 +340,36 @@ def build_sasl(env, dirs, logfp): runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp) +def build_libyaml(env, dirs, logfp): + """ + Build libyaml. + + :param env: The environment dictionary + :type env: dict + :param dirs: The working directories + :type dirs: ``relenv.build.common.Dirs`` + :param logfp: A handle for the log file + :type logfp: file + """ + # Ensure position-independent code for shared libraries + env["CFLAGS"] = "-fPIC {}".format(env.get("CFLAGS", "")) + + runcmd( + [ + "./configure", + "--prefix={}".format(dirs.prefix), + "--libdir={}/lib".format(dirs.prefix), # Specify library directory + "--build={}".format(env["RELENV_BUILD"]), + "--host={}".format(env["RELENV_HOST"]), + ], + env=env, + stderr=logfp, + stdout=logfp, + ) + runcmd(["make", "-j8"], env=env, stderr=logfp, stdout=logfp) + runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp) + + def build_openldap(env, dirs, logfp): """ Build openldap. @@ -720,10 +750,23 @@ def build_python(env, dirs, logfp): }, ) +build.add( + "libyaml", + build_func=build_libyaml, + download={ + "url": "https://github.com/yaml/libyaml/releases/download/{version}/yaml-{version}.tar.gz", + "fallback_url": "https://nexus.oit.gatech.edu/relenv/dependencies/yaml-{version}.tar.gz", + "version": "0.2.5", + "checksum": "f49b39644caccabef049e3ec8859e8fdf94b686e", + "checkfunc": tarball_version, + }, +) + build.add( "python", build_func=build_python, wait_on=[ + "libyaml", "openssl", "libxcrypt", "XZ", diff --git a/relenv/common.py b/relenv/common.py index f7e9c805..50d8aabd 100644 --- a/relenv/common.py +++ b/relenv/common.py @@ -18,7 +18,7 @@ import time # relenv package version -__version__ = "0.19.3" +__version__ = "0.19.4" MODULE_DIR = pathlib.Path(__file__).resolve().parent diff --git a/relenv/runtime.py b/relenv/runtime.py index 6b963c43..0b81cc13 100644 --- a/relenv/runtime.py +++ b/relenv/runtime.py @@ -172,7 +172,7 @@ def wrapped(name): "CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall", "CPPFLAGS": "-I. -I./Include", "CXX": "g++", - "LIBDEST": "/usr/local/lib/python3.8", + "LIBDEST": "/usr/local/lib/python3.9", "SCRIPTDIR": "/usr/local/lib", "BLDSHARED": "gcc -shared", "LDFLAGS": "",