]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3393] add fedora 40 to hammer
authorMarcin Godzina <mgodzina@isc.org>
Mon, 13 May 2024 14:41:05 +0000 (14:41 +0000)
committerMarcin Godzina <mgodzina@isc.org>
Mon, 13 May 2024 15:31:11 +0000 (15:31 +0000)
hammer.py

index 0aacf7d16e60f0d07df201fa840ba9140cf0b9c6..7f47e54b56da6c95882401d3500f7da7d31c67fa 100755 (executable)
--- a/hammer.py
+++ b/hammer.py
@@ -63,6 +63,7 @@ SYSTEMS = {
         '37': False,
         '38': True,
         '39': True,
+        '40': True,
     },
     'centos': {
         '7': False,
@@ -1199,6 +1200,10 @@ def _install_libyang_cpp_from_sources(ignore_errors = False):
     try:
         execute('git clone https://github.com/CESNET/libyang-cpp.git ~/.hammer-tmp/libyang-cpp')
         execute(f'git checkout {version}', cwd='~/.hammer-tmp/libyang-cpp')
+        # New cpp compiler is more picky about missing headers. (ex. Fedora 40)
+        return_code = execute('sudo grep "#include <algorithm>" ~/.hammer-tmp/libyang-cpp/src/Context.cpp', raise_error=False)
+        if return_code == 1:
+            execute('sed -i "/#include <libyang\/libyang.h>/a #include <algorithm>" ~/.hammer-tmp/libyang-cpp/src/Context.cpp')
         execute('mkdir ~/.hammer-tmp/libyang-cpp/build')
         execute('cmake -DBUILD_TESTING=OFF .. ', cwd='~/.hammer-tmp/libyang-cpp/build')
         execute('make -j $(nproc || gnproc || echo 1)', cwd='~/.hammer-tmp/libyang-cpp/build')