From a45315500e7a1897d24767581184d448d54d1f83 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 16 Nov 2016 14:56:09 +0100 Subject: [PATCH 1/2] pythonPackages.slixmpp: 1.1 -> 1.2.1 --- pkgs/top-level/python-packages.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9f28194d95ed..c86e554b3597 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15197,15 +15197,20 @@ in { slixmpp = buildPythonPackage rec { name = "slixmpp-${version}"; - version = "1.1"; + version = "1.2.1"; disabled = pythonOlder "3.4"; src = pkgs.fetchurl { url = "mirror://pypi/s/slixmpp/${name}.tar.gz"; - sha256 = "030ca7e71cbb7e17fb48f83db97779fdbac0b4424cef01245f3276a110b30a6c"; + sha256 = "0fwngxf2pnmpk8vhv4pfxvl1ya3nxr4kc2z6jrh2imynbry3xfj9"; }; + patchPhase = '' + substituteInPlace slixmpp/thirdparty/gnupg.py \ + --replace "gpgbinary='gpg'" "gpgbinary='${pkgs.gnupg1}/bin/gpg'" + ''; + propagatedBuildInputs = with self ; [ aiodns pyasn1 pkgs.gnupg1 pyasn1-modules]; meta = { From f7558d07dfaf1fe9f89126902a1fcbba27383b58 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 16 Nov 2016 14:57:15 +0100 Subject: [PATCH 2/2] poezio: 0.9 -> 0.10 --- .../poezio/fix_gnupg_import.patch | 12 +++ .../poezio/fix_plugins_imports.patch | 80 +++++++++++++++++++ .../poezio/make_default_config_writable.patch | 25 ------ pkgs/top-level/python-packages.nix | 28 +++---- 4 files changed, 106 insertions(+), 39 deletions(-) create mode 100644 pkgs/development/python-modules/poezio/fix_gnupg_import.patch create mode 100644 pkgs/development/python-modules/poezio/fix_plugins_imports.patch delete mode 100644 pkgs/development/python-modules/poezio/make_default_config_writable.patch diff --git a/pkgs/development/python-modules/poezio/fix_gnupg_import.patch b/pkgs/development/python-modules/poezio/fix_gnupg_import.patch new file mode 100644 index 000000000000..d75e09b722bf --- /dev/null +++ b/pkgs/development/python-modules/poezio/fix_gnupg_import.patch @@ -0,0 +1,12 @@ +diff -Nur poezio-0.10.orig/plugins/gpg/__init__.py poezio-0.10/plugins/gpg/__init__.py +--- poezio-0.10.orig/plugins/gpg/__init__.py 2016-07-27 19:02:41.000000000 +0200 ++++ poezio-0.10/plugins/gpg/__init__.py 2016-11-16 14:17:06.011128631 +0100 +@@ -105,7 +105,7 @@ + .. _XEP-0027: http://xmpp.org/extensions/xep-0027.html + + """ +-from gpg import gnupg ++import slixmpp.thirdparty.gnupg as gnupg + from slixmpp.xmlstream.stanzabase import JID + + from xml.etree import cElementTree as ET diff --git a/pkgs/development/python-modules/poezio/fix_plugins_imports.patch b/pkgs/development/python-modules/poezio/fix_plugins_imports.patch new file mode 100644 index 000000000000..821b9c41588a --- /dev/null +++ b/pkgs/development/python-modules/poezio/fix_plugins_imports.patch @@ -0,0 +1,80 @@ +diff -Nur poezio-0.10.orig/plugins/canat.py poezio-0.10/plugins/canat.py +--- poezio-0.10.orig/plugins/canat.py 2016-08-21 14:56:35.000000000 +0200 ++++ poezio-0.10/plugins/canat.py 2016-11-16 14:32:21.565445266 +0100 +@@ -34,9 +34,9 @@ + + + """ +-from plugin import BasePlugin +-import tabs +-from decorators import command_args_parser ++from poezio.plugin import BasePlugin ++import poezio.tabs ++from poezio.decorators import command_args_parser + + def move(text, step, spacing): + new_text = text + (" " * spacing) +diff -Nur poezio-0.10.orig/plugins/corrections_diff.py poezio-0.10/plugins/corrections_diff.py +--- poezio-0.10.orig/plugins/corrections_diff.py 2016-08-21 14:56:35.000000000 +0200 ++++ poezio-0.10/plugins/corrections_diff.py 2016-11-16 14:30:53.992684959 +0100 +@@ -22,11 +22,11 @@ + + + """ +-from plugin import BasePlugin ++from poezio.plugin import BasePlugin + import difflib ++import collections + from functools import wraps +-import tabs +-from config import config ++from poezio.config import config + + shim_message_fields = ('txt nick_color time str_time nickname user identifier' + ' highlight me old_message revisions jid ack') +@@ -61,10 +61,6 @@ + rev -= 1 + return ''.join(acc) + +-Message.__repr__ = repr_message +-Message.__str__ = repr_message +- +- + + def corrections_enabled(func): + @wraps(func) +diff -Nur poezio-0.10.orig/plugins/coucou.py poezio-0.10/plugins/coucou.py +--- poezio-0.10.orig/plugins/coucou.py 2016-08-21 14:56:35.000000000 +0200 ++++ poezio-0.10/plugins/coucou.py 2016-11-16 14:25:37.101337668 +0100 +@@ -1,4 +1,4 @@ +-from plugin import BasePlugin ++from poezio.plugin import BasePlugin + import tracemalloc + import cProfile, pstats, io + +diff -Nur poezio-0.10.orig/plugins/flood.py poezio-0.10/plugins/flood.py +--- poezio-0.10.orig/plugins/flood.py 2016-08-21 14:56:35.000000000 +0200 ++++ poezio-0.10/plugins/flood.py 2016-11-16 14:32:56.452155220 +0100 +@@ -1,6 +1,6 @@ +-from plugin import BasePlugin +-import tabs +-import multiuserchat as muc ++from poezio.plugin import BasePlugin ++import poezio.tabs ++import poezio.multiuserchat as muc + + class Plugin(BasePlugin): + def init(self): +diff -Nur poezio-0.10.orig/plugins/invisible.py poezio-0.10/plugins/invisible.py +--- poezio-0.10.orig/plugins/invisible.py 2016-08-21 14:56:35.000000000 +0200 ++++ poezio-0.10/plugins/invisible.py 2016-11-16 14:31:31.743288152 +0100 +@@ -20,8 +20,7 @@ + .. _XEP-0186: https://xmpp.org/extensions/xep-0186.html + """ + +-from plugin import BasePlugin +-import tabs ++from poezio.plugin import BasePlugin + + class Plugin(BasePlugin): + def init(self): diff --git a/pkgs/development/python-modules/poezio/make_default_config_writable.patch b/pkgs/development/python-modules/poezio/make_default_config_writable.patch deleted file mode 100644 index 03d732e256c4..000000000000 --- a/pkgs/development/python-modules/poezio/make_default_config_writable.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -ruN a/src/config.py b/src/config.py ---- a/src/config.py 2015-07-31 19:35:37.000000000 +0000 -+++ b/src/config.py 2015-08-03 09:23:34.322098081 +0000 -@@ -14,6 +14,7 @@ - - import logging.config - import os -+import stat - import sys - import pkg_resources - -@@ -563,6 +564,13 @@ - copy2(default, options.filename) - elif path.isfile(other): - copy2(other, options.filename) -+ -+ # Inside the nixstore, the reference file is readonly, so is the copy. -+ # Make it writable by the user who just created it. -+ if os.path.exists(options.filename): -+ os.chmod(options.filename, -+ os.stat(options.filename).st_mode | stat.S_IWUSR) -+ - global firstrun - firstrun = True - diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c86e554b3597..bb2188508645 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -29371,29 +29371,29 @@ in { }; }; - poezio = buildPythonPackage rec { + poezio = buildPythonApplication rec { name = "poezio-${version}"; - version = "0.9"; + version = "0.10"; - namePrefix = ""; disabled = pythonOlder "3.4"; buildInputs = with self; [ pytest ]; - propagatedBuildInputs = with self ; [ aiodns slixmpp pyinotify potr ]; - - checkPhase = '' - PYTHONPATH="$PYTHONPATH:$out/${python.sitePackages}/poezio" make test - ''; - - patches = - let patch_base = ../development/python-modules/poezio; - in [ "${patch_base}/make_default_config_writable.patch" ]; + propagatedBuildInputs = with self ; [ aiodns slixmpp pyinotify potr mpd2 ]; src = pkgs.fetchurl { - url = "http://dev.louiz.org/attachments/download/91/${name}.tar.xz"; - sha256 = "1vc7zn4rp0ds0cdh1xcmbwx6w2qh4pnpzi5mdnj3rpl7xdr6jqzi"; + url = "http://dev.louiz.org/attachments/download/102/${name}.tar.gz"; + sha256 = "1mm0c3250p0kh7lmmjlp05hbc7byn9lknafgb906xmp4vx1p4kjn"; }; + patches = [ + ../development/python-modules/poezio/fix_gnupg_import.patch + ../development/python-modules/poezio/fix_plugins_imports.patch + ]; + + checkPhase = '' + py.test + ''; + meta = { description = "Free console XMPP client"; homepage = http://poez.io;