From: Andrei Pavel Date: Fri, 9 May 2025 11:27:26 +0000 (+0300) Subject: [#3393] Hammer: Fix yang compilation X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4f8d1a9d04370f507a5bfc5a791727643c205e0;p=thirdparty%2Fkea.git [#3393] Hammer: Fix yang compilation --- diff --git a/hammer.py b/hammer.py index 5058608090..46ceec8037 100755 --- a/hammer.py +++ b/hammer.py @@ -1178,6 +1178,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 " ~/.hammer-tmp/libyang-cpp/src/Context.cpp', raise_error=False) + if return_code == 1: + execute('sed -i "/#include /a #include " ~/.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')