nixpkgs/pkgs/applications/display-managers/slim/runtime-paths.patch

71 lines
2.6 KiB
Diff
Raw Normal View History

diff -ru slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
2013-10-15 12:51:41 +02:00
--- slim-1.3.6-orig/app.cpp 2013-10-02 00:38:05.000000000 +0200
+++ slim-1.3.6/app.cpp 2014-03-30 19:01:04.115414201 +0200
2013-10-15 12:51:41 +02:00
@@ -200,7 +200,9 @@
/* Read configuration and theme */
cfg = new Cfg;
- cfg->readConf(CFGFILE);
+ char *cfgfile = getenv("SLIM_CFGFILE");
+ if (!cfgfile) cfgfile = CFGFILE;
+ cfg->readConf(cfgfile);
string themebase = "";
string themefile = "";
string themedir = "";
@@ -208,7 +210,9 @@
if (testing) {
themeName = testtheme;
} else {
- themebase = string(THEMESDIR) + "/";
+ char *themesdir = getenv("SLIM_THEMESDIR");
+ if (!themesdir) themesdir = THEMESDIR;
+ themebase = string(themesdir) + "/";
themeName = cfg->getOption("current_theme");
string::size_type pos;
if ((pos = themeName.find(",")) != string::npos) {
diff -ru slim-1.3.6-orig/CMakeLists.txt slim-1.3.6/CMakeLists.txt
--- slim-1.3.6-orig/CMakeLists.txt 2013-10-02 00:38:05.000000000 +0200
+++ slim-1.3.6/CMakeLists.txt 2014-03-30 19:16:48.445069729 +0200
@@ -23,7 +23,7 @@
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/slim")
-set(SYSCONFDIR "/etc")
+set(SYSCONFDIR "$ENV{out}/etc")
set(LIBDIR "/lib")
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
@@ -40,7 +40,7 @@
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPACKAGE=\"slim\"")
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DVERSION=\"${SLIM_VERSION}\"")
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPKGDATADIR=\"${PKGDATADIR}\"")
-set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"${SYSCONFDIR}\"")
+set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"/etc\"")
# Flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2")
Only in slim-1.3.6: CMakeLists.txt~
diff -ru slim-1.3.6-orig/slimlock.cpp slim-1.3.6/slimlock.cpp
--- slim-1.3.6-orig/slimlock.cpp 2013-10-02 00:38:05.000000000 +0200
+++ slim-1.3.6/slimlock.cpp 2014-03-30 19:01:04.115414201 +0200
@@ -106,13 +106,17 @@
unsigned int cfg_passwd_timeout;
// Read user's current theme
cfg = new Cfg;
- cfg->readConf(CFGFILE);
+ char *cfgfile = getenv("SLIM_CFGFILE");
+ if (!cfgfile) cfgfile = CFGFILE;
+ cfg->readConf(cfgfile);
cfg->readConf(SLIMLOCKCFG);
string themebase = "";
string themefile = "";
string themedir = "";
themeName = "";
- themebase = string(THEMESDIR) + "/";
+ char *themesdir = getenv("SLIM_THEMESDIR");
+ if (!themesdir) themesdir = THEMESDIR;
+ themebase = string(themesdir) + "/";
themeName = cfg->getOption("current_theme");
string::size_type pos;
if ((pos = themeName.find(",")) != string::npos) {