Introduce library blacklist; enable GTK dialogs on all Linux distributions
This commit is contained in:
parent
a59c174849
commit
9a1d321215
13
libraries.rb
13
libraries.rb
|
|
@ -2,12 +2,25 @@
|
||||||
#encoding: utf-8
|
#encoding: utf-8
|
||||||
require 'fileutils'
|
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
|
line = gets
|
||||||
files = []
|
files = []
|
||||||
while line
|
while line
|
||||||
if line =~ / => (\/.*) \(/
|
if line =~ / => (\/.*) \(/
|
||||||
|
if not BLACKLIST.include? $1
|
||||||
files << $1
|
files << $1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
line = gets
|
line = gets
|
||||||
end
|
end
|
||||||
FileUtils.cp(files, 'libs')
|
FileUtils.cp(files, 'libs')
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,8 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
|
||||||
|
|
||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
char const* xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
|
char const* xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
|
||||||
|
gtk_init(0, 0);
|
||||||
|
|
||||||
if (xdg_current_desktop == NULL) {
|
if (xdg_current_desktop == NULL) {
|
||||||
desktopEnv = "nope";
|
desktopEnv = "nope";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -289,19 +291,15 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
|
||||||
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::tolower);
|
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::tolower);
|
||||||
if (desktop.find("cinnamon") != std::string::npos) {
|
if (desktop.find("cinnamon") != std::string::npos) {
|
||||||
desktopEnv = "cinnamon";
|
desktopEnv = "cinnamon";
|
||||||
gtk_init(0, 0);
|
|
||||||
} else if (
|
} else if (
|
||||||
desktop.find("gnome") != std::string::npos ||
|
desktop.find("gnome") != std::string::npos ||
|
||||||
desktop.find("unity") != std::string::npos
|
desktop.find("unity") != std::string::npos
|
||||||
) {
|
) {
|
||||||
desktopEnv = "gnome";
|
desktopEnv = "gnome";
|
||||||
gtk_init(0, 0);
|
|
||||||
} else if (desktop.find("mate") != std::string::npos) {
|
} else if (desktop.find("mate") != std::string::npos) {
|
||||||
desktopEnv = "mate";
|
desktopEnv = "mate";
|
||||||
gtk_init(0, 0);
|
|
||||||
} else if (desktop.find("xfce") != std::string::npos) {
|
} else if (desktop.find("xfce") != std::string::npos) {
|
||||||
desktopEnv = "xfce";
|
desktopEnv = "xfce";
|
||||||
gtk_init(0, 0);
|
|
||||||
} else if (desktop.find("kde") != std::string::npos) {
|
} else if (desktop.find("kde") != std::string::npos) {
|
||||||
desktopEnv = "kde";
|
desktopEnv = "kde";
|
||||||
} else if (desktop.find("lxde") != std::string::npos) {
|
} 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)
|
if (!title)
|
||||||
title = "";
|
title = "";
|
||||||
#if defined OS_LINUX
|
#if defined OS_LINUX
|
||||||
if (
|
|
||||||
desktopEnv == "gnome" ||
|
|
||||||
desktopEnv == "mate" ||
|
|
||||||
desktopEnv == "cinnamon" ||
|
|
||||||
desktopEnv == "xfce"
|
|
||||||
) {
|
|
||||||
linux_DialogData data = {type, body, title, 0};
|
linux_DialogData data = {type, body, title, 0};
|
||||||
gdk_threads_add_idle(linux_dialog, &data);
|
gdk_threads_add_idle(linux_dialog, &data);
|
||||||
gtk_main();
|
gtk_main();
|
||||||
return data.result;
|
return data.result;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SDL message box
|
// SDL message box
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue