From ba9d0768eee327168b3f6c24a193b960e14c0fdd Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 26 Oct 2021 17:19:32 +0200 Subject: [PATCH] packages: Add swaync and gajim-mainwindow --- .../instant-messengers/gajim/default.nix | 80 +++++++++++++++++++ packages/default.nix | 14 ++++ packages/tools/desktop/swaync/default.nix | 31 +++++++ 3 files changed, 125 insertions(+) create mode 100644 packages/applications/networking/instant-messengers/gajim/default.nix create mode 100644 packages/tools/desktop/swaync/default.nix diff --git a/packages/applications/networking/instant-messengers/gajim/default.nix b/packages/applications/networking/instant-messengers/gajim/default.nix new file mode 100644 index 0000000..55852e6 --- /dev/null +++ b/packages/applications/networking/instant-messengers/gajim/default.nix @@ -0,0 +1,80 @@ +{ lib, fetchurl, gettext, wrapGAppsHook + +# Native dependencies +, python3, gtk3, gobject-introspection, gnome +, glib-networking, gsound, nbxmpp, gtksourceview4 + +# Test dependencies +, xvfb-run, dbus + +# Optional dependencies +, enableE2E ? true +, enableSecrets ? true, libsecret +, enableRST ? true, docutils +, enableSpelling ? true, gspell +, enableUPnP ? true, gupnp-igd +, enableOmemoPluginDependencies ? true +, enableAppIndicator ? true, libappindicator-gtk3 +, extraPythonPackages ? ps: [] +}: + +python3.pkgs.buildPythonApplication rec { + pname = "gajim"; + version = "1.4.0"; + + src = fetchurl { + url = "https://dev.gajim.org/gajim/gajim/-/archive/mainwindow/gajim-mainwindow.tar.gz"; + sha256 = "1bam5l8ax0bgkjg9f9grk9fiqqg0ak2kwzxm1hw9nmcr87ynshn0"; + }; + + buildInputs = [ + gobject-introspection gtk3 gnome.adwaita-icon-theme + glib-networking + ] ++ lib.optional enableSecrets libsecret + ++ lib.optional enableSpelling gspell + ++ lib.optional enableUPnP gupnp-igd + ++ lib.optional enableAppIndicator libappindicator-gtk3; + + nativeBuildInputs = [ + gettext wrapGAppsHook + ]; + + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + propagatedBuildInputs = with python3.pkgs; [ + nbxmpp pygobject3 dbus-python pillow css-parser precis-i18n keyring setuptools gsound + gst-python gtksourceview4 + ] ++ lib.optionals enableE2E [ pycrypto python-gnupg ] + ++ lib.optional enableRST docutils + ++ lib.optionals enableOmemoPluginDependencies [ python-axolotl qrcode ] + ++ extraPythonPackages python3.pkgs; + + checkInputs = [ xvfb-run dbus.daemon ]; + + checkPhase = '' + # https://dev.gajim.org/gajim/gajim/-/issues/10478 + rm test/lib/gajim_mocks.py test/unit/test_gui_interface.py + + xvfb-run dbus-run-session \ + --config-file=${dbus.daemon}/share/dbus-1/session.conf \ + ${python3.interpreter} setup.py test + ''; + doCheck = false; + + # necessary for wrapGAppsHook + strictDeps = false; + + meta = { + homepage = "http://gajim.org/"; + description = "Jabber client written in PyGTK"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ raskin abbradar ]; + downloadPage = "http://gajim.org/downloads.php"; + updateWalker = true; + platforms = lib.platforms.linux; + }; +} diff --git a/packages/default.nix b/packages/default.nix index eae73a4..367f9cb 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -89,4 +89,18 @@ in { copyIntoSandbox = [ "/share" ]; }; + + gajim-mainwindow = pkgs.callPackage ./applications/networking/instant-messengers/gajim { + nbxmpp = pkgs.python3Packages.nbxmpp.overrideAttrs (old: { + src = pkgs.fetchFromGitLab { + domain = "dev.gajim.org"; + owner = "gajim"; + repo = "python-nbxmpp"; + rev = "master"; + sha256 = "1vifb68d47ihzm86iv4aqjh84wcxp5xmggfxwajwmls5mqi420yn"; + }; + }); + }; + + swaync = pkgs.callPackage ./tools/desktop/swaync {}; } diff --git a/packages/tools/desktop/swaync/default.nix b/packages/tools/desktop/swaync/default.nix new file mode 100644 index 0000000..eb59c9f --- /dev/null +++ b/packages/tools/desktop/swaync/default.nix @@ -0,0 +1,31 @@ +{ + stdenv, lib +, fetchgit + +, meson, cmake, pkg-config, ninja +, gtk3, gobject-introspection, libgee, gtk-layer-shell, dbus, libhandy, json-glib, vala +, wrapGAppsHook +}: + +stdenv.mkDerivation { + pname = "swaync"; + version = "0.2"; + + src = fetchgit { + url = "https://github.com/ErikReider/SwayNotificationCenter.git"; + rev = "9aae9c92c8c4b0a0af64518fcee91ab300fc65ea"; + sha256 = "1yrhwafpj2gjyf8aiq8nwaxb66h54vliph1d4gpnlih6ca3627il"; + }; + + buildInputs = [ gtk3 gtk-layer-shell gobject-introspection libgee libhandy dbus json-glib vala ]; + nativeBuildInputs = [ wrapGAppsHook meson cmake pkg-config ninja ]; + + strictDeps = false; + + meta = with lib; { + description = "A simple notification daemon with a gui built for Sway"; + homepage = "https://github.com/ErikReider/SwayNotificationCenter"; + maintainers = []; + platforms = platforms.linux; + }; +}