diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix index 42d2c777aea2..8020ecb12a55 100644 --- a/pkgs/applications/display-managers/slim/default.nix +++ b/pkgs/applications/display-managers/slim/default.nix @@ -18,13 +18,17 @@ stdenv.mkDerivation rec { # slim's broken PAM session handling (see # http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663). ./run-once.patch + + # Ensure that sessions appear in sort order, rather than in + # directory order. + ./sort-sessions.patch ]; preConfigure = "substituteInPlace CMakeLists.txt --replace /lib $out/lib"; cmakeFlags = [ "-DUSE_PAM=1" ]; - NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype"; + NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype -std=c++11"; enableParallelBuilding = true; diff --git a/pkgs/applications/display-managers/slim/sort-sessions.patch b/pkgs/applications/display-managers/slim/sort-sessions.patch new file mode 100644 index 000000000000..cab5610f44fb --- /dev/null +++ b/pkgs/applications/display-managers/slim/sort-sessions.patch @@ -0,0 +1,40 @@ +diff -ru -x '*~' slim-1.3.6-orig/cfg.cpp slim-1.3.6/cfg.cpp +--- slim-1.3.6-orig/cfg.cpp 2013-10-02 00:38:05.000000000 +0200 ++++ slim-1.3.6/cfg.cpp 2016-01-30 10:35:51.108766802 +0100 +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -293,6 +294,8 @@ + + sessions.clear(); + ++ typedef pair session_t; ++ + if( !strSessionDir.empty() ) { + DIR *pDir = opendir(strSessionDir.c_str()); + +@@ -325,7 +328,7 @@ + } + } + desktop_file.close(); +- pair session(session_name,session_exec); ++ session_t session(session_name,session_exec); + sessions.push_back(session); + cout << session_exec << " - " << session_name << endl; + } +@@ -341,6 +344,10 @@ + pair session("",""); + sessions.push_back(session); + } ++ ++ std::sort(sessions.begin(), sessions.end(), [](session_t& a, session_t& b) -> bool{ ++ return a.first < b.first; ++ }); + } + + pair Cfg::nextSession() {