kde5.kio: fix Samba detection

This commit is contained in:
Thomas Tuegel 2016-01-08 09:03:50 -06:00
parent 53588bac96
commit ba443da270
4 changed files with 33 additions and 2 deletions

View File

@ -74,7 +74,7 @@ let
kidletime = callPackage ./kidletime.nix {};
kimageformats = callPackage ./kimageformats.nix {};
kinit = callPackage ./kinit {};
kio = callPackage ./kio.nix {};
kio = callPackage ./kio {};
kitemmodels = callPackage ./kitemmodels.nix {};
kitemviews = callPackage ./kitemviews.nix {};
kjobwidgets = callPackage ./kjobwidgets.nix {};

View File

@ -1,4 +1,5 @@
{ kdeFramework, lib, extra-cmake-modules, acl, karchive
{ kdeFramework, lib, copyPathsToStore
, extra-cmake-modules, acl, karchive
, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons
, kdbusaddons, kdoctools, ki18n, kiconthemes, kitemviews
, kjobwidgets, knotifications, kservice, ktextwidgets, kwallet
@ -8,6 +9,7 @@
kdeFramework {
name = "kio";
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ];
buildInputs = [
acl karchive kconfig kcoreaddons kdbusaddons kiconthemes

View File

@ -0,0 +1,28 @@
Index: kio-5.17.0/src/core/ksambashare.cpp
===================================================================
--- kio-5.17.0.orig/src/core/ksambashare.cpp
+++ kio-5.17.0/src/core/ksambashare.cpp
@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate(
bool KSambaSharePrivate::isSambaInstalled()
{
- if (QFile::exists(QStringLiteral("/usr/sbin/smbd"))
- || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) {
- return true;
+ const QByteArray pathEnv = qgetenv("PATH");
+ if (!pathEnv.isEmpty()) {
+ QLatin1Char pathSep(':');
+ QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts);
+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
+ it->append("/smbd");
+ if (QFile::exists(*it)) {
+ return true;
+ }
+ }
}
- //qDebug() << "Samba is not installed!";
-
return false;
}

View File

@ -0,0 +1 @@
samba-search-path.patch