From 892f642f58e6fcab7c69ecba79afb2d6ab461c89 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:47:50 +0100 Subject: plugins: incorporate hyprdep ABI into plugin info (#12001) --- src/plugins/PluginAPI.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/plugins/PluginAPI.cpp') diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp index 004788b9..66b0c74e 100644 --- a/src/plugins/PluginAPI.cpp +++ b/src/plugins/PluginAPI.cpp @@ -17,7 +17,18 @@ #include APICALL const char* __hyprland_api_get_hash() { - return GIT_COMMIT_HASH; + static auto stripPatch = [](const char* ver) -> std::string { + std::string_view v = ver; + if (!v.contains('.')) + return std::string{v}; + + return std::string{v.substr(0, v.find_last_of('.'))}; + }; + + static const std::string ver = (std::string{GIT_COMMIT_HASH} + "_aq_" + stripPatch(AQUAMARINE_VERSION) + "_hu_" + stripPatch(HYPRUTILS_VERSION) + "_hg_" + + stripPatch(HYPRGRAPHICS_VERSION) + "_hc_" + stripPatch(HYPRCURSOR_VERSION) + "_hlg_" + stripPatch(HYPRLANG_VERSION)); + + return ver.c_str(); } APICALL SP HyprlandAPI::registerCallbackDynamic(HANDLE handle, const std::string& event, HOOK_CALLBACK_FN fn) { -- cgit v1.2.3