Add rpath to binary executable on macOS (#258)
* removing superfluous slash from paths * Add a necessary rpath to the imhex binary * add a little error handling to dlopen * fall back on en-US if no language specified in prefs * PR changes as per @WerWolv
This commit is contained in:
parent
b4b2c41b34
commit
ac53b4bcab
@ -57,3 +57,7 @@ if (CODE_SIGN_CERTIFICATE_ID)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${BUNDLE_PATH}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${BUNDLE_PATH}.temp" "${BUNDLE_PATH}")
|
||||
endif()
|
||||
|
||||
# Add a necessary rpath to the imhex binary
|
||||
get_bundle_main_executable("${BUNDLE_PATH}" IMHEX_EXECUTABLE)
|
||||
execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/../Frameworks/ "${IMHEX_EXECUTABLE}")
|
||||
|
@ -19,29 +19,29 @@
|
||||
NSURL * result = nil;
|
||||
switch (path) {
|
||||
case ImHexPath::Patterns:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/patterns"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/patterns"];
|
||||
break;
|
||||
|
||||
case ImHexPath::PatternsInclude:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/patterns"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/patterns"];
|
||||
break;
|
||||
case ImHexPath::Magic:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/magic"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/magic"];
|
||||
break;
|
||||
case ImHexPath::Python:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex"];
|
||||
break;
|
||||
case ImHexPath::Plugins:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/plugins"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/plugins"];
|
||||
break;
|
||||
case ImHexPath::Yara:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/yara"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/yara"];
|
||||
break;
|
||||
case ImHexPath::Config:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/config"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/config"];
|
||||
break;
|
||||
case ImHexPath::Resources:
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"/imhex/resources"];
|
||||
result = [appSupportDir URLByAppendingPathComponent:@"imhex/resources"];
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,10 @@ namespace hex {
|
||||
Plugin::Plugin(std::string_view path) {
|
||||
this->m_handle = dlopen(path.data(), RTLD_LAZY);
|
||||
|
||||
if (this->m_handle == nullptr)
|
||||
if (this->m_handle == nullptr) {
|
||||
hex::log::error("dlopen failed: {}", dlerror());
|
||||
return;
|
||||
}
|
||||
|
||||
auto pluginName = fs::path(path).stem().string();
|
||||
|
||||
|
@ -100,8 +100,12 @@ namespace hex {
|
||||
{
|
||||
auto language = ContentRegistry::Settings::getSetting("hex.builtin.setting.interface", "hex.builtin.setting.interface.language");
|
||||
|
||||
if (language.is_string())
|
||||
if (language.is_string()) {
|
||||
LangEntry::loadLanguage(static_cast<std::string>(language));
|
||||
} else {
|
||||
// If no language is specified, fall back to English.
|
||||
LangEntry::loadLanguage("en-US");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -787,4 +791,4 @@ namespace hex {
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user