remove plan9port runtime dependency
This commit is contained in:
parent
223a8f1235
commit
5adc3b37d8
|
|
@ -120,6 +120,14 @@ to KF5; use `make kde-kf5` to force the KF5/Qt5 build.
|
||||||
<img src="./doc/img/ollie.svg" alt="Ollie" width="200" height="200">
|
<img src="./doc/img/ollie.svg" alt="Ollie" width="200" height="200">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
Ollie does **not** require [plan9port](https://9fans.github.io/plan9port/), either explicitly or implicitly. This was previously required by the runtime and is no longer true. Ollie includes its own Go 9P protocol implementation, clients, and namespace management. `olliesrv` creates its namespace directory and removes it only when empty.
|
||||||
|
|
||||||
|
plan9port provides valuable additional tools and integrations, including Acme and general-purpose 9P utilities, but those are optional. The core Ollie runtime, `ollie-9p`, `toolsrv`, and native clients do not depend on plan9port or `$PLAN9`.
|
||||||
|
|
||||||
|
The standard build requires Go 1.25+ and GNU Make. The optional KDE integration additionally requires CMake, Qt, and KDE Frameworks.
|
||||||
|
|
||||||
## Future work
|
## Future work
|
||||||
|
|
||||||
### Portable toolsrv hosts
|
### Portable toolsrv hosts
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,13 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(OllieRunner, "metadata.json")
|
K_PLUGIN_CLASS_WITH_JSON(OllieRunner, "metadata.json")
|
||||||
|
|
||||||
static QString ninepBin()
|
static QString ollie9pBin()
|
||||||
{
|
{
|
||||||
QString bin = QStandardPaths::findExecutable("9p");
|
return QStandardPaths::findExecutable("ollie-9p");
|
||||||
if (!bin.isEmpty()) return bin;
|
|
||||||
QString plan9 = qEnvironmentVariable("PLAN9");
|
|
||||||
if (!plan9.isEmpty() && QFileInfo::exists(plan9 + "/bin/9p"))
|
|
||||||
return plan9 + "/bin/9p";
|
|
||||||
return "9p";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION_MAJOR >= 6
|
#if QT_VERSION_MAJOR >= 6
|
||||||
|
|
@ -49,7 +43,7 @@ QByteArray OllieRunner::run9p(const QStringList &args)
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
QStringList fullArgs = {"-a", serverAddr()};
|
QStringList fullArgs = {"-a", serverAddr()};
|
||||||
fullArgs.append(args);
|
fullArgs.append(args);
|
||||||
proc.start(ninepBin(), fullArgs);
|
proc.start(ollie9pBin(), fullArgs);
|
||||||
if (!proc.waitForFinished(5000)) return {};
|
if (!proc.waitForFinished(5000)) return {};
|
||||||
return proc.readAllStandardOutput();
|
return proc.readAllStandardOutput();
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +51,7 @@ QByteArray OllieRunner::run9p(const QStringList &args)
|
||||||
void OllieRunner::write9p(const QString &path, const QByteArray &data)
|
void OllieRunner::write9p(const QString &path, const QByteArray &data)
|
||||||
{
|
{
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
proc.start(ninepBin(), {"-a", serverAddr(), "write", path});
|
proc.start(ollie9pBin(), {"-a", serverAddr(), "write", path});
|
||||||
proc.waitForStarted(3000);
|
proc.waitForStarted(3000);
|
||||||
proc.write(data);
|
proc.write(data);
|
||||||
proc.closeWriteChannel();
|
proc.closeWriteChannel();
|
||||||
|
|
@ -160,7 +154,7 @@ void OllieRunner::run(const RunnerNS::RunnerContext &context, const RunnerNS::Qu
|
||||||
QString prompt = data.mid(7);
|
QString prompt = data.mid(7);
|
||||||
// Use the generate rdwr file for one-shot
|
// Use the generate rdwr file for one-shot
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
proc.start(ninepBin(), {"-a", serverAddr(), "rdwr", "generate"});
|
proc.start(ollie9pBin(), {"-a", serverAddr(), "rdwr", "generate"});
|
||||||
proc.waitForStarted(3000);
|
proc.waitForStarted(3000);
|
||||||
proc.write(prompt.toUtf8());
|
proc.write(prompt.toUtf8());
|
||||||
proc.closeWriteChannel();
|
proc.closeWriteChannel();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue