Introduce library blacklist; enable GTK dialogs on all Linux distributions

This commit is contained in:
Pera Pisar 2019-04-22 01:58:57 +02:00
parent a59c174849
commit 9a1d321215
No known key found for this signature in database
GPG key ID: 6E1174E4DF875DCA
2 changed files with 20 additions and 16 deletions

View file

@ -2,11 +2,24 @@
#encoding: utf-8
require 'fileutils'
# These libraries MUST NOT be packaged with OneShot
# or otherwise they will cause cross-distro
# incompatibilities.
BLACKLIST = [
# These packaged on Manjaro cause issues on openSUSE.
'libc.so.6',
'libpthread.so.0',
'libdl.so.2',
'libm.so.6'
]
line = gets
files = []
while line
if line =~ / => (\/.*) \(/
files << $1
if not BLACKLIST.include? $1
files << $1
end
end
line = gets
end

View file

@ -282,6 +282,8 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
#ifdef OS_LINUX
char const* xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
gtk_init(0, 0);
if (xdg_current_desktop == NULL) {
desktopEnv = "nope";
} else {
@ -289,19 +291,15 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::tolower);
if (desktop.find("cinnamon") != std::string::npos) {
desktopEnv = "cinnamon";
gtk_init(0, 0);
} else if (
desktop.find("gnome") != std::string::npos ||
desktop.find("unity") != std::string::npos
) {
desktopEnv = "gnome";
gtk_init(0, 0);
} else if (desktop.find("mate") != std::string::npos) {
desktopEnv = "mate";
gtk_init(0, 0);
} else if (desktop.find("xfce") != std::string::npos) {
desktopEnv = "xfce";
gtk_init(0, 0);
} else if (desktop.find("kde") != std::string::npos) {
desktopEnv = "kde";
} else if (desktop.find("lxde") != std::string::npos) {
@ -488,17 +486,10 @@ bool Oneshot::msgbox(int type, const char *body, const char *title)
if (!title)
title = "";
#if defined OS_LINUX
if (
desktopEnv == "gnome" ||
desktopEnv == "mate" ||
desktopEnv == "cinnamon" ||
desktopEnv == "xfce"
) {
linux_DialogData data = {type, body, title, 0};
gdk_threads_add_idle(linux_dialog, &data);
gtk_main();
return data.result;
}
linux_DialogData data = {type, body, title, 0};
gdk_threads_add_idle(linux_dialog, &data);
gtk_main();
return data.result;
#endif
// SDL message box