container: root: refactor using common utility

This commit is contained in:
2025-12-02 17:14:10 -08:00
parent d156f62fa7
commit 7ca01776fc
2 changed files with 19 additions and 13 deletions

View File

@@ -59,7 +59,7 @@ void example1()
//! \ingroup cpp_plugin_impl //! \ingroup cpp_plugin_impl
void example2() void example2()
{ {
namespace common = ::dfi::macro::common; namespace common = ::dfi::common;
auto print_env = [](const std::string& env) { auto print_env = [](const std::string& env) {
std::cout << env << "=" << common::get_env(env) << "\n"; std::cout << env << "=" << common::get_env(env) << "\n";

View File

@@ -26,6 +26,8 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "./common/utility.hh" // The one-and-only `dfi` header required by rootlogon
//! \namespace dfi //! \namespace dfi
//! \since docker-finance 1.0.0 //! \since docker-finance 1.0.0
namespace dfi namespace dfi
@@ -192,24 +194,28 @@ void help()
//! \since docker-finance 1.0.0 //! \since docker-finance 1.0.0
void rootlogon() void rootlogon()
{ {
namespace common = dfi::common;
// Add nested directory headers // Add nested directory headers
gInterpreter->AddIncludePath("/usr/include/botan-3"); common::add_include_dir("/usr/include/botan-3");
// Link default packaged libraries // Link default packaged libraries
gSystem->AddLinkedLibs("-lgtest"); // gtest/gmock // TODO(afiore): linking here appears to no longer be needed?
gSystem->AddLinkedLibs("-lbenchmark"); // gbenchmark // Is ROOT loading all libraries on-the-fly (in default paths)?
gSystem->AddLinkedLibs("-pthread"); // gtest/gmock/gbenchmark common::add_linked_lib("/usr/lib/libgtest.so"); // gtest/gmock
common::add_linked_lib("/usr/lib/libbenchmark.so"); // gbenchmark
common::add_linked_lib("/usr/lib/libpthread.so.0"); // gtest/gmock/gbenchmark
gSystem->AddLinkedLibs("-lbotan-3"); // Botan common::add_linked_lib("/usr/lib/libbotan-3.so"); // Botan
gSystem->AddLinkedLibs("-lcryptopp"); // Crypto++ common::add_linked_lib("/usr/lib/libcryptopp.so"); // Crypto++
gSystem->AddLinkedLibs("-lsodium"); // libsodium common::add_linked_lib("/usr/lib/libsodium.so"); // libsodium
// Load default `dfi` public consumables // Load default `dfi` public consumables
gInterpreter->ProcessLine(".L plugin/common/utility.hh"); common::load("plugin/common/utility.hh");
gInterpreter->ProcessLine(".L macro/common/utility.hh"); common::load("macro/common/utility.hh");
gInterpreter->ProcessLine(".L src/hash.hh"); common::load("src/hash.hh");
gInterpreter->ProcessLine(".L src/random.hh"); common::load("src/random.hh");
gInterpreter->ProcessLine(".L src/utility.hh"); common::load("src/utility.hh");
} }
#endif // CONTAINER_SRC_ROOT_MACRO_ROOTLOGON_C_ #endif // CONTAINER_SRC_ROOT_MACRO_ROOTLOGON_C_