From 24a97b8d6eb4a82715b7fdbed1bdcf7376f8b55c Mon Sep 17 00:00:00 2001 From: Blady Date: Tue, 5 Aug 2025 21:06:06 +0200 Subject: [PATCH] GNATDoc3 and GNATStudio_CLI: use GPS_ROOT to locate share folder in case of app bundle. --- cli/src/gps-cli_kernels.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/gps-cli_kernels.adb b/cli/src/gps-cli_kernels.adb index 23d4fc2f1c..b6f45d2c9d 100644 --- a/cli/src/gps-cli_kernels.adb +++ b/cli/src/gps-cli_kernels.adb @@ -18,6 +18,8 @@ with GNATCOLL.Projects; with GNATCOLL.Utils; +with Ada.Environment_Variables; + package body GPS.CLI_Kernels is --------------------- @@ -59,11 +61,14 @@ package body GPS.CLI_Kernels is return GNATCOLL.VFS.Virtual_File is pragma Unreferenced (Self); + use Ada.Environment_Variables; Dir : GNATCOLL.VFS.Virtual_File := Create (+GNATCOLL.Utils.Executable_Location); begin - if Dir.Base_Dir_Name = "obj" then + if Exists ("GPS_ROOT") then + Dir := Create (+(Value ("GPS_ROOT")) & "/share/gnatstudio/"); + elsif Dir.Base_Dir_Name = "obj" then Dir := Create_From_Dir (Dir.Get_Parent.Get_Parent, "share/"); else Dir := Create_From_Dir (Dir, "share/gnatstudio/");