diff --git a/pkgs/applications/networking/mailreaders/mailnag/default.nix b/pkgs/applications/networking/mailreaders/mailnag/default.nix index 8341cc63092c..5747da36b34b 100644 --- a/pkgs/applications/networking/mailreaders/mailnag/default.nix +++ b/pkgs/applications/networking/mailreaders/mailnag/default.nix @@ -1,28 +1,49 @@ -{ stdenv, fetchurl, gettext, gtk3, pythonPackages -, gdk-pixbuf, libnotify, gst_all_1 -, libgnome-keyring3 -, wrapGAppsHook, gnome3 -# otherwise passwords are stored unencrypted -, withGnomeKeyring ? true +{ stdenv +, fetchFromGitHub +, gettext +, gtk3 +, pythonPackages +, gdk-pixbuf +, libnotify +, gst_all_1 +, libsecret +, wrapGAppsHook +, gsettings-desktop-schemas +, glib +, gobject-introspection }: -let - inherit (pythonPackages) python; -in pythonPackages.buildPythonApplication rec { +pythonPackages.buildPythonApplication rec { pname = "mailnag"; - version = "1.3.0"; + version = "2.0.0"; - src = fetchurl { - url = "https://github.com/pulb/mailnag/archive/v${version}.tar.gz"; - sha256 = "0cp5pad6jzd5c14pddbi9ap5bi78wjhk1x2p0gbblmvmcasw309s"; + src = fetchFromGitHub { + owner = "pulb"; + repo = "mailnag"; + rev = "v${version}"; + sha256 = "0q97v9i96br22z3h6r2mz79i68ib8m8x42yxky78szfrf8j60i30"; }; + preFixup = '' + substituteInPlace $out/${pythonPackages.python.sitePackages}/Mailnag/common/dist_cfg.py \ + --replace "/usr/" $out/ + for desktop_file in $out/share/applications/*.desktop; do + substituteInPlace "$desktop_file" \ + --replace "/usr/bin" $out/bin + done + ''; buildInputs = [ - gtk3 gdk-pixbuf libnotify gst_all_1.gstreamer - gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good + gtk3 + gdk-pixbuf + glib + libnotify + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad - gnome3.adwaita-icon-theme - ] ++ stdenv.lib.optional withGnomeKeyring libgnome-keyring3; + gobject-introspection + libsecret + ]; nativeBuildInputs = [ gettext @@ -30,20 +51,17 @@ in pythonPackages.buildPythonApplication rec { ]; propagatedBuildInputs = with pythonPackages; [ - pygobject3 dbus-python pyxdg + gsettings-desktop-schemas + pygobject3 + dbus-python + pyxdg ]; - buildPhase = ""; - - installPhase = "${python}/bin/python setup.py install --prefix=$out"; - - doCheck = false; - meta = with stdenv.lib; { description = "An extensible mail notification daemon"; homepage = "https://github.com/pulb/mailnag"; license = licenses.gpl2; platforms = platforms.linux; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ doronbehar ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f182b6d250cf..3f94fe1d390b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5047,7 +5047,7 @@ in mailhog = callPackage ../servers/mail/mailhog {}; mailnag = callPackage ../applications/networking/mailreaders/mailnag { - pythonPackages = python2Packages; + pythonPackages = python3Packages; }; mailsend = callPackage ../tools/networking/mailsend { };