From f33d5617c08f8378433d00f18e9f0bb7136ca5ad Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 21 Jun 2019 04:28:50 +0200 Subject: pkgs/aszlig: Add custom Psi XMPP client This is from the current 2.0 development version and has most of my own configuration preferences built-in. Right now, the theming is pretty much a work in progress and the chat input currently shows black text on dark grey background, which is quite a nuisance to use. Another thing that's currently not working (or just for a very short amount of time) are window manager urgency hints. Nevertheless however, I'm already using it as my main XMPP client despite these issues. Signed-off-by: aszlig --- pkgs/aszlig/psi/config.patch | 292 +++++++++++++++++++++++++++++++++ pkgs/aszlig/psi/darkstyle.patch | 32 ++++ pkgs/aszlig/psi/default.nix | 80 +++++++++ pkgs/aszlig/psi/disable-xep-0232.patch | 50 ++++++ 4 files changed, 454 insertions(+) create mode 100644 pkgs/aszlig/psi/config.patch create mode 100644 pkgs/aszlig/psi/darkstyle.patch create mode 100644 pkgs/aszlig/psi/default.nix create mode 100644 pkgs/aszlig/psi/disable-xep-0232.patch (limited to 'pkgs/aszlig/psi') diff --git a/pkgs/aszlig/psi/config.patch b/pkgs/aszlig/psi/config.patch new file mode 100644 index 00000000..957b221b --- /dev/null +++ b/pkgs/aszlig/psi/config.patch @@ -0,0 +1,292 @@ +diff --git a/options/default.xml b/options/default.xml +index bedbe91e..d69e521f 100644 +--- a/options/default.xml ++++ b/options/default.xml +@@ -19,7 +19,7 @@ + + + +- true ++ false + + false + +@@ -86,7 +86,7 @@ + + true + +- false ++ true + + + true +@@ -113,7 +113,7 @@ + false + false + false +- hour ++ day + false + false + false +@@ -130,7 +130,7 @@ + auto + + +- 5 ++ 10 + + + +@@ -148,8 +148,8 @@ + false + 100 + +- true +- false ++ false ++ true + + + +@@ -210,7 +210,7 @@ QLineEdit#le_status_text { + false + false + true +- true ++ false + status + false + true +@@ -225,7 +225,7 @@ QLineEdit#le_status_text { + true + true + true +- true ++ false + true + + true +@@ -250,7 +250,7 @@ QLineEdit#le_status_text { + false + false + true +- false ++ true + true + + 64 +@@ -287,7 +287,7 @@ QLineEdit#le_status_text { + true + +
+- true ++ false +
+ + true +@@ -337,11 +337,11 @@ QLineEdit#le_status_text { + true + + false +- true ++ false + false + + +- true ++ false + 0 + + true +@@ -359,8 +359,8 @@ QLineEdit#le_status_text { + + + +- #f0f0f0 +- #5a5a5a ++ #00007f ++ #969696 + + + #969696 +@@ -370,16 +370,16 @@ QLineEdit#le_status_text { + #004bb4 + #7e0000 + #646464 +- ++ #ffffff + +- #000000 ++ #6f0000 + #969696 + #808080 + + + true + #e9ecc7 +- #000000 ++ #ffffff + + + +@@ -390,21 +390,21 @@ QLineEdit#le_status_text { + Red + + #910000 +- #00008a ++ #00aaff + #336600 +- black ++ #cccccc + + +- #0000ff ++ #0055ff + #ff0000 + #008000 + #606060 + #FF0000 +- #000080 ++ #55ffff + #400080 + + +- darkGreen ++ #cccccc + red + grey + +@@ -417,10 +417,10 @@ QLineEdit#le_status_text { + false + + +- Sans Serif,11,-1,5,50,0,0,0,0,0 +- Sans Serif,11,-1,5,50,0,0,0,0,0 +- Sans Serif,11,-1,5,50,0,0,0,0,0 +- Sans Serif,9,-1,5,50,0,0,0,0,0 ++ Monospace,12,-1,5,50,0,0,0,0,0 ++ Monospace,12,-1,5,50,0,0,0,0,0 ++ Monospace,12,-1,5,50,0,0,0,0,0 ++ Monospace,12,-1,5,50,0,0,0,0,0 + + + +@@ -468,20 +468,20 @@ QLineEdit#le_status_text { + false + + +- sound/chat2.wav +- sound/chat2.wav +- sound/ft_complete.wav +- sound/offline.wav +- sound/online.wav +- true +- sound/ft_incoming.wav +- sound/chat2.wav +- sound/chat2.wav +- sound/chat1.wav ++ ++ ++ ++ ++ ++ false ++ ++ ++ ++ + false +- sound/send.wav +- false +- sound/chat2.wav ++ ++ true ++ + + + false +@@ -500,7 +500,7 @@ QLineEdit#le_status_text { + close + detach + +- CM ++ ACM + + + true +@@ -630,7 +630,7 @@ QLineEdit#le_status_text { + true + + +- false ++ true + false + true + true +@@ -653,7 +653,20 @@ QLineEdit#le_status_text { + true + false + +- ++ ++ ++ zone ++ false ++ dnd ++ In The Zone[TM] ++ ++ ++ sleep ++ false ++ offline ++ Sleeping the hell out of here. ++ ++ + submenu + false + true +@@ -693,5 +706,9 @@ QLineEdit#le_status_text { + + + +- ++ ++ ++ true ++ ++ + +diff --git a/src/psi_profiles.cpp b/src/psi_profiles.cpp +index fb2e1b9c..d4f67be2 100644 +--- a/src/psi_profiles.cpp ++++ b/src/psi_profiles.cpp +@@ -79,8 +79,8 @@ void UserAccount::reset() + req_mutual_auth = false; + legacy_ssl_probe = false; + security_level = QCA::SL_None; +- ssl = SSL_Auto; +- jid = ""; ++ ssl = SSL_Yes; ++ jid = "@jid@"; + pass = ""; + scramSaltedHashPassword = ""; + opt_pass = false; +@@ -90,7 +90,7 @@ void UserAccount::reset() + opt_automatic_resource = true; + priority_dep_on_status = true; + ignore_global_actions = false; +- resource = ApplicationInfo::name(); ++ resource = "@resource@"; + priority = 55; + ibbOnly = false; + opt_keepAlive = true; +@@ -133,7 +133,7 @@ void UserAccount::reset() + << "stun.voipbuster.com" + << "stun.voxgratia.org"; + +- stunHost = stunHosts[0]; ++ stunHost = ""; + + keybind.clear(); + diff --git a/pkgs/aszlig/psi/darkstyle.patch b/pkgs/aszlig/psi/darkstyle.patch new file mode 100644 index 00000000..45c5067f --- /dev/null +++ b/pkgs/aszlig/psi/darkstyle.patch @@ -0,0 +1,32 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7118ea75..c6f58e35 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -237,6 +237,7 @@ endif() + set(RESOURCES + ${PROJECT_SOURCE_DIR}/psi.qrc + ${PROJECT_SOURCE_DIR}/iconsets.qrc ++ ${QDARKSTYLE_PATH}/qdarkstyle/style.qrc + ) + qt5_add_resources(QRC_SOURCES ${RESOURCES}) + +diff --git a/src/main.cpp b/src/main.cpp +index b45fbab0..1cbead4a 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -532,6 +532,15 @@ PSI_EXPORT_FUNC int main(int argc, char *argv[]) + QCoreApplication::addLibraryPath(appPath); + # endif + PsiApplication app(argc, argv); ++ ++ QFile darkstyle(":qdarkstyle/style.qss"); ++ if (!darkstyle.exists()) { ++ qWarning() << "Unable to set dark style"; ++ } else { ++ darkstyle.open(QFile::ReadOnly | QFile::Text); ++ QTextStream ts(&darkstyle); ++ app.setStyleSheet(ts.readAll()); ++ } + QApplication::setApplicationName(ApplicationInfo::name()); + QApplication::addLibraryPath(ApplicationInfo::resourcesDir()); + QApplication::addLibraryPath(ApplicationInfo::homeDir(ApplicationInfo::DataLocation)); diff --git a/pkgs/aszlig/psi/default.nix b/pkgs/aszlig/psi/default.nix new file mode 100644 index 00000000..35e51b32 --- /dev/null +++ b/pkgs/aszlig/psi/default.nix @@ -0,0 +1,80 @@ +{ stdenv, lib, fetchFromGitHub, cmake, makeWrapper +, hunspell, libgcrypt, libgpgerror, libidn, libotr, libsForQt5 +, libsignal-protocol-c, libtidy, qt5 + +, substituteAll + +, jid ? "something@example.org" +, resource ? "psi-aszlig" +}: + +let + qdarkstyle = fetchFromGitHub { + owner = "ColinDuquesnoy"; + repo = "QDarkStyleSheet"; + rev = "c92d0c4c996e3e859134492e0f9f7f74bd0e12cd"; + sha256 = "1qrmp3ibvgzwh2v1qfrfh8xiwvj0kbhj1bm17bjx7zpmnb8byz3m"; + }; + +in stdenv.mkDerivation rec { + name = "psi-${version}"; + version = "2.0git20190613aszlig"; + + src = fetchFromGitHub { + owner = "psi-im"; + repo = "psi"; + rev = "b61c0c21d7a370b63e091c1205aab0c504106634"; + sha256 = "00bnxhv8pgyhq0b7rsq59a6agb5lv8ali3wcna6hgfbajs3jjzbx"; + fetchSubmodules = true; + }; + + plugins = fetchFromGitHub { + owner = "psi-im"; + repo = "plugins"; + rev = "e29fbe14558342060e5addd311e143e65dbfd722"; + sha256 = "09bii2zv9vgfyiqqajc5ziq8yhybyhiiwywl18vfj7inz82p40d2"; + }; + + patches = [ + ./disable-xep-0232.patch + ./darkstyle.patch + (substituteAll { + src = ./config.patch; + inherit jid resource; + }) + ]; + + preConfigure = '' + cp --no-preserve=all -rt src/plugins "$plugins"/* + ''; + + cmakeFlags = [ + "-DENABLE_PLUGINS=ON" "-DUSE_KEYCHAIN=OFF" "-DPSI_VERSION=${version}" + "-DQDARKSTYLE_PATH=${qdarkstyle}" + ]; + + enableParallelBuilding = true; + nativeBuildInputs = [ cmake makeWrapper ]; + buildInputs = [ + hunspell + libgcrypt + libgpgerror + libidn + libotr + libsForQt5.qca-qt5 + libsignal-protocol-c + libtidy + qt5.qtbase + qt5.qtmultimedia + qt5.qtwebengine + qt5.qtx11extras + ]; + + postInstall = let + inherit (qt5.qtbase) qtPluginPrefix; + qtPlugins = "${qt5.qtbase}/${qtPluginPrefix}"; + in '' + wrapProgram "$out/bin/psi" \ + --suffix QT_PLUGIN_PATH : ${lib.escapeShellArg qtPlugins} + ''; +} diff --git a/pkgs/aszlig/psi/disable-xep-0232.patch b/pkgs/aszlig/psi/disable-xep-0232.patch new file mode 100644 index 00000000..4788d262 --- /dev/null +++ b/pkgs/aszlig/psi/disable-xep-0232.patch @@ -0,0 +1,50 @@ +diff --git a/iris/src/xmpp/xmpp-im/client.cpp b/iris/src/xmpp/xmpp-im/client.cpp +index d8573bf..31af799 100644 +--- a/iris/src/xmpp/xmpp-im/client.cpp ++++ b/iris/src/xmpp/xmpp-im/client.cpp +@@ -1257,45 +1257,6 @@ DiscoItem Client::makeDiscoResult(const QString &node) const + + item.setFeatures(features); + +- // xep-0232 Software Information +- XData si; +- XData::FieldList si_fields; +- +- XData::Field si_type_field; +- si_type_field.setType(XData::Field::Field_Hidden); +- si_type_field.setVar("FORM_TYPE"); +- si_type_field.setValue(QStringList(QLatin1String("urn:xmpp:dataforms:softwareinfo"))); +- si_fields.append(si_type_field); +- +- XData::Field software_field; +- software_field.setType(XData::Field::Field_TextSingle); +- software_field.setVar("software"); +- software_field.setValue(QStringList(d->clientName)); +- si_fields.append(software_field); +- +- XData::Field software_v_field; +- software_v_field.setType(XData::Field::Field_TextSingle); +- software_v_field.setVar("software_version"); +- software_v_field.setValue(QStringList(d->clientVersion)); +- si_fields.append(software_v_field); +- +- XData::Field os_field; +- os_field.setType(XData::Field::Field_TextSingle); +- os_field.setVar("os"); +- os_field.setValue(QStringList(d->osName)); +- si_fields.append(os_field); +- +- XData::Field os_v_field; +- os_v_field.setType(XData::Field::Field_TextSingle); +- os_v_field.setVar("os_version"); +- os_v_field.setValue(QStringList(d->osVersion)); +- si_fields.append(os_v_field); +- +- si.setType(XData::Data_Result); +- si.setFields(si_fields); +- +- item.setExtensions(QList() << si); +- + return item; + } + -- cgit 1.4.1