From 029cea5bef4817918008b35df499fdaba86e83ee Mon Sep 17 00:00:00 2001 From: Cullen Walsh Date: Thu, 26 Sep 2024 20:11:05 -0700 Subject: [PATCH] Build libaegis from scratch Summary: libaegis is not available through system packages, and the .pc file is only available in our github action. Instead, build it from scratch as a target. Reviewed By: bigfootjon Differential Revision: D63475002 fbshipit-source-id: cf030ee6de7e470d590f55db21cdb76c0a0c45df --- shim/third-party/libaegis/BUCK | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/shim/third-party/libaegis/BUCK b/shim/third-party/libaegis/BUCK index 8ac657a17..8fb5b00e9 100644 --- a/shim/third-party/libaegis/BUCK +++ b/shim/third-party/libaegis/BUCK @@ -5,11 +5,28 @@ # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. -load("@shim//third-party:third_party.bzl", "third_party_library") +load("@shim//build_defs:prebuilt_cpp_library.bzl", "prebuilt_cpp_library") oncall("open_source") -third_party_library( +git_fetch( + name = "libaegis.git", + repo = "https://github.com/jedisct1/libaegis.git", + rev = "9c7677d742aaae312e09b1574998acba620188d8", # tag 0.1.23 +) + +genrule( + name = "libaegis-cmake", + out = "out", + cmd = "cmake -DCMAKE_INSTALL_PREFIX=$OUT $(location :libaegis.git) && make install", +) + +prebuilt_cpp_library( name = "aegis", - pkgconfig_name = "libaegis", + exported_preprocessor_flags = ["-I$(location :libaegis-cmake)/include"], + linker_flags = [ + "-L$(location :libaegis-cmake)/lib64", + "-laegis", + ], + visibility = ["PUBLIC"], )