aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-10 00:30:24 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-10 00:30:24 +0100
commitfcf18de4a44fcc496837fbb6eedcc01e5f6eb680 (patch)
tree8f65cdc607c7a41e5789eb3bd04c80ef732f6865
parentc92933bfa2d95533ea5c8650ff4d40b6621e600f (diff)
downloadNix-fcf18de4a44fcc496837fbb6eedcc01e5f6eb680.tar.gz
Nix-fcf18de4a44fcc496837fbb6eedcc01e5f6eb680.tar.zst
Nix-fcf18de4a44fcc496837fbb6eedcc01e5f6eb680.zip
Upgrade packages to 19.03
-rw-r--r--default.nix71
-rw-r--r--patches/terminal_velocity_fix_build.patch6
-rw-r--r--patches/terminal_velocity_python3_support.patch215
-rw-r--r--patches/terminal_velocity_sort_found_notes.patch16
4 files changed, 266 insertions, 42 deletions
diff --git a/default.nix b/default.nix
index c8d8c8b..ad9bca7 100644
--- a/default.nix
+++ b/default.nix
@@ -1,5 +1,5 @@
1with import ./libs.nix; 1with import ./libs.nix;
2with import <nixpkgs> {}; 2with import <immaeNixpkgsNext> {};
3let 3let
4 mypkgs = {}; 4 mypkgs = {};
5 5
@@ -26,11 +26,13 @@ let
26 } 26 }
27 ); 27 );
28 28
29 mypkgs.weboob = pythonPackages.weboob.overrideAttrs (old: rec { 29 mypkgs.weboob = (pythonPackages.weboob.overridePythonAttrs {
30 postInstall = ''${old.postInstall or ""} 30 setupPyBuildFlags = [ "--no-qt" "--xdg" ];
31 mkdir -p $out/share/bash-completion/completions/ 31 }).overrideAttrs (old: rec {
32 cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob 32 postInstall = ''${old.postInstall or ""}
33 ''; 33 mkdir -p $out/share/bash-completion/completions/
34 cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob
35 '';
34 }); 36 });
35 37
36 mypkgs.slrn = slrn.overrideAttrs (old: rec { 38 mypkgs.slrn = slrn.overrideAttrs (old: rec {
@@ -61,7 +63,17 @@ let
61 configureFlags = old.configureFlags ++ [ "--enable-plugins" ]; 63 configureFlags = old.configureFlags ++ [ "--enable-plugins" ];
62 }); 64 });
63 65
64 mypkgs.weechat = nixpkgs_unstable.weechat.override { 66 mypkgs.weechat = (wrapWeechat (
67 weechat-unwrapped.overrideAttrs (old: rec {
68 version = "2.3";
69 name = "weechat-${version}";
70 src = fetchurl {
71 url = "https://weechat.org/files/src/weechat-${version}.tar.bz2";
72 sha256 = "0mi4pfnyny0vqc35r0scn6yy21y790a5iwq8ms7kch7b7z11jn9w";
73 };
74 patches = [];
75 })
76 ) {}).override {
65 configure = { availablePlugins, ... }: { 77 configure = { availablePlugins, ... }: {
66 plugins = with availablePlugins; [ 78 plugins = with availablePlugins; [
67 (python.withPackages (ps: with ps; [websocket_client emoji])) 79 (python.withPackages (ps: with ps; [websocket_client emoji]))
@@ -89,18 +101,19 @@ let
89 }; 101 };
90 }; 102 };
91 103
92 mypkgs.terminal-velocity = with python2Packages; buildPythonApplication rec { 104 mypkgs.terminal-velocity = with python3Packages; buildPythonApplication rec {
93 pname = "terminal-velocity-git"; 105 pname = "terminal-velocity-git";
94 version = "0.2.0"; 106 version = "0.2.0";
95 107
96 patches = [ 108 patches = [
109 ./patches/terminal_velocity_sort_found_notes.patch
110 ./patches/terminal_velocity_python3_support.patch
97 # FIXME: update this patch when version changes 111 # FIXME: update this patch when version changes
98 ./patches/terminal_velocity_fix_build.patch 112 ./patches/terminal_velocity_fix_build.patch
99 ./patches/terminal_velocity_sort_found_notes.patch
100 ]; 113 ];
101 114
102 propagatedBuildInputs = [ chardet urwid nixpkgs_unstable.python2Packages.sh pyyaml ]; 115 propagatedBuildInputs = [ chardet urwid (sh.overridePythonAttrs { doCheck = false; }) pyyaml ];
103 buildInputs = [ m2r restructuredtext_lint pygments ]; 116 buildInputs = [ m2r (restructuredtext_lint.overridePythonAttrs { doCheck = false; }) pygments ];
104 117
105 postInstall = '' 118 postInstall = ''
106 rm $out/bin/terminal_velocity 119 rm $out/bin/terminal_velocity
@@ -456,9 +469,9 @@ let
456 469
457 mypkgs.notmuch-vim = stdenv.mkDerivation rec { 470 mypkgs.notmuch-vim = stdenv.mkDerivation rec {
458 name = "notmuch-vim-${version}"; 471 name = "notmuch-vim-${version}";
459 version = nixpkgs_unstable.notmuch.version; 472 version = notmuch.version;
460 outputs = [ "out" ]; 473 outputs = [ "out" ];
461 src = nixpkgs_unstable.notmuch.src; 474 src = notmuch.src;
462 phases = [ "unpackPhase" "installPhase" ]; 475 phases = [ "unpackPhase" "installPhase" ];
463 installPhase = '' 476 installPhase = ''
464 make -C vim DESTDIR=$out prefix="/share/vim/vimfiles" install 477 make -C vim DESTDIR=$out prefix="/share/vim/vimfiles" install
@@ -467,10 +480,10 @@ let
467 480
468 mypkgs.notmuch-python2 = stdenv.mkDerivation rec { 481 mypkgs.notmuch-python2 = stdenv.mkDerivation rec {
469 name = "notmuch-python2-${version}"; 482 name = "notmuch-python2-${version}";
470 version = nixpkgs_unstable.notmuch.version; 483 version = notmuch.version;
471 outputs = [ "out" ]; 484 outputs = [ "out" ];
472 buildInputs = [ python2Packages.sphinx python2Packages.python ]; 485 buildInputs = [ python2Packages.sphinx python2Packages.python ];
473 src = nixpkgs_unstable.notmuch.src; 486 src = notmuch.src;
474 phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ]; 487 phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ];
475 buildPhase = '' 488 buildPhase = ''
476 cd bindings/python 489 cd bindings/python
@@ -483,10 +496,10 @@ let
483 496
484 mypkgs.notmuch-python3 = stdenv.mkDerivation rec { 497 mypkgs.notmuch-python3 = stdenv.mkDerivation rec {
485 name = "notmuch-python3-${version}"; 498 name = "notmuch-python3-${version}";
486 version = nixpkgs_unstable.notmuch.version; 499 version = notmuch.version;
487 outputs = [ "out" ]; 500 outputs = [ "out" ];
488 buildInputs = [ nixpkgs_unstable.python3Packages.sphinx nixpkgs_unstable.python3Packages.python ]; 501 buildInputs = [ python3Packages.sphinx python3Packages.python ];
489 src = nixpkgs_unstable.notmuch.src; 502 src = notmuch.src;
490 phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ]; 503 phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ];
491 buildPhase = '' 504 buildPhase = ''
492 cd bindings/python 505 cd bindings/python
@@ -581,24 +594,8 @@ in
581 inherit feh imagemagick; 594 inherit feh imagemagick;
582 inherit lftp; 595 inherit lftp;
583 stgit = gitAndTools.stgit; 596 stgit = gitAndTools.stgit;
584 # todo: lx* ?, unrar, unzip, zeromq?
585 #inherit nextcloud-client;
586 #inherit nixos;
587 } // (with nixpkgs_unstable; {
588 inherit googler;
589 inherit khal;
590 inherit newsboat;
591 inherit xmr-stak;
592 inherit urlwatch;
593 inherit graphicsmagick;
594 inherit ncmpc;
595 inherit solc;
596 inherit w3m lynx links;
597 inherit valgrind;
598 inherit ranger;
599 inherit strace;
600 inherit notmuch notmuch-mutt;
601 stgit = gitAndTools.stgit;
602 inherit bundix; 597 inherit bundix;
603 bower2nix = nodePackages.bower2nix; 598 bower2nix = nodePackages.bower2nix;
604 }) 599 # todo: unrar, unzip
600 #inherit nixos;
601 }
diff --git a/patches/terminal_velocity_fix_build.patch b/patches/terminal_velocity_fix_build.patch
index 5c7f716..b08e0c4 100644
--- a/patches/terminal_velocity_fix_build.patch
+++ b/patches/terminal_velocity_fix_build.patch
@@ -1,3 +1,9 @@
1commit a64bf3d58f6ba7f5fa72fe5b89a3973cac0c1a99
2Author: Ismaël Bouya <ismael.bouya@normalesup.org>
3Date: Sat Mar 9 20:13:52 2019 +0100
4
5 Remove mister_bump dependency
6
1diff --git a/setup.py b/setup.py 7diff --git a/setup.py b/setup.py
2index 84a99e9..a783dff 100644 8index 84a99e9..a783dff 100644
3--- a/setup.py 9--- a/setup.py
diff --git a/patches/terminal_velocity_python3_support.patch b/patches/terminal_velocity_python3_support.patch
new file mode 100644
index 0000000..bd4aec7
--- /dev/null
+++ b/patches/terminal_velocity_python3_support.patch
@@ -0,0 +1,215 @@
1commit 6ca19964b9e8a7866fd7e21a3dac9ccd35f0d434
2Author: Ismaël Bouya <ismael.bouya@normalesup.org>
3Date: Sat Mar 9 20:13:18 2019 +0100
4
5 Add python3 support
6
7diff --git a/terminal_velocity/notebook.py b/terminal_velocity/notebook.py
8index b6226dc..11f76de 100644
9--- a/terminal_velocity/notebook.py
10+++ b/terminal_velocity/notebook.py
11@@ -60,51 +60,6 @@ import sys
12 import chardet
13
14
15-def unicode_or_bust(raw_text):
16- """Return the given raw text data decoded to unicode.
17-
18- If the text cannot be decoded, return None.
19-
20- """
21- encodings = ["utf-8"]
22- for encoding in (sys.getfilesystemencoding(), sys.getdefaultencoding()):
23- # I would use a set for this, but they don't maintain order.
24- if encoding not in encodings:
25- encodings.append(encoding)
26-
27- for encoding in encodings:
28- if encoding: # getfilesystemencoding() may return None
29- try:
30- decoded = unicode(raw_text, encoding=encoding)
31- return decoded
32- except UnicodeDecodeError:
33- pass
34-
35- # If none of those guesses worked, let chardet have a go.
36- encoding = chardet.detect(raw_text)["encoding"]
37- if encoding and encoding not in encodings:
38- try:
39- decoded = unicode(raw_text, encoding=encoding)
40- logger.debug("File decoded with chardet, encoding was {0}".format(
41- encoding))
42- return decoded
43- except UnicodeDecodeError:
44- pass
45- except LookupError:
46- pass
47-
48- # I've heard that decoding with cp1252 never fails, so try that last.
49- try:
50- decoded = unicode(raw_text, encoding="cp1252")
51- logger.debug("File decoded with encoding cp1252")
52- return decoded
53- except UnicodeDecodeError:
54- pass
55-
56- # If nothing worked then give up.
57- return None
58-
59-
60 class Error(Exception):
61 """Base class for exceptions in this module."""
62 pass
63@@ -192,12 +147,12 @@ class PlainTextNote(object):
64 # subdirs) if they don't exist.
65 directory = os.path.split(self.abspath)[0]
66 if not os.path.isdir(directory):
67- logger.debug(u"'{0} doesn't exist, creating it".format(directory))
68+ logger.debug("'{0} doesn't exist, creating it".format(directory))
69 try:
70 os.makedirs(directory)
71 except os.error as e:
72 raise NewNoteError(
73- u"{0} could not be created: {1}".format(directory, e))
74+ "{0} could not be created: {1}".format(directory, e))
75
76 # Create an empty file if the file doesn't exist.
77 open(self.abspath, 'a')
78@@ -217,11 +172,11 @@ class PlainTextNote(object):
79
80 @property
81 def contents(self):
82- contents = unicode_or_bust(open(self.abspath, "r").read())
83+ contents = open(self.abspath, "rb").read().decode(errors='ignore')
84 if contents is None:
85 logger.error(
86- u"Could not decode file contents: {0}".format(self.abspath))
87- return u""
88+ "Could not decode file contents: {0}".format(self.abspath))
89+ return ""
90 else:
91 return contents
92
93@@ -322,12 +277,12 @@ class PlainTextNoteBook(object):
94
95 # Create notebook_dir if it doesn't exist.
96 if not os.path.isdir(self.path):
97- logger.debug(u"'{0} doesn't exist, creating it".format(self.path))
98+ logger.debug("'{0} doesn't exist, creating it".format(self.path))
99 try:
100 os.makedirs(self.path)
101 except os.error as e:
102 raise NewNoteBookError(
103- u"{0} could not be created: {1}".format(self.path, e))
104+ "{0} could not be created: {1}".format(self.path, e))
105 else:
106 # TODO: Check that self.path is a directory, if not raise.
107 pass
108@@ -358,13 +313,12 @@ class PlainTextNoteBook(object):
109 abspath = os.path.join(root, filename)
110 relpath = os.path.relpath(abspath, self.path)
111 relpath, ext = os.path.splitext(relpath)
112- unicode_relpath = unicode_or_bust(relpath)
113 if relpath is None:
114 # The filename could not be decoded.
115 logger.error(
116 "Could not decode filename: {0}".format(relpath))
117 else:
118- self.add_new(title=unicode_relpath, extension=ext)
119+ self.add_new(title=relpath, extension=ext)
120
121 @property
122 def path(self):
123@@ -418,7 +372,7 @@ class PlainTextNoteBook(object):
124 for note in self._notes:
125 if note.title == title and note.extension == extension:
126 raise NoteAlreadyExistsError(
127- u"Note already in NoteBook: {0}".format(note.title))
128+ "Note already in NoteBook: {0}".format(note.title))
129
130 # Ok, add the note.
131 note = PlainTextNote(title, self, extension)
132diff --git a/terminal_velocity/terminal_velocity.py b/terminal_velocity/terminal_velocity.py
133index 5f0e213..9234bea 100755
134--- a/terminal_velocity/terminal_velocity.py
135+++ b/terminal_velocity/terminal_velocity.py
136@@ -1,7 +1,7 @@
137-#!/usr/bin/env python2
138+#!/usr/bin/env python3
139 """A fast note-taking app for the UNIX terminal"""
140 from __future__ import print_function
141-import ConfigParser
142+import configparser
143 import argparse
144 import os
145 import logging
146@@ -9,9 +9,9 @@ import logging.handlers
147 import sys
148
149 #import terminal_velocity.urwid_ui as urwid_ui
150-import urwid_ui
151+from . import urwid_ui
152
153-from git import get_git_project_config, git_project_is_configured, fetch_changes, push_changes
154+from .git import get_git_project_config, git_project_is_configured, fetch_changes, push_changes
155
156
157 def startup():
158@@ -37,7 +37,7 @@ def main():
159
160 # Parse the config file.
161 config_file = os.path.abspath(os.path.expanduser(args.config))
162- config = ConfigParser.SafeConfigParser()
163+ config = configparser.ConfigParser()
164 config.read(config_file)
165 defaults = dict(config.items('DEFAULT'))
166
167diff --git a/terminal_velocity/urwid_ui.py b/terminal_velocity/urwid_ui.py
168index caebcb9..89bab35 100644
169--- a/terminal_velocity/urwid_ui.py
170+++ b/terminal_velocity/urwid_ui.py
171@@ -10,7 +10,7 @@ import logging
172 logger = logging.getLogger(__name__)
173
174 import urwid
175-import notebook
176+from . import notebook
177
178
179 palette = [
180@@ -27,8 +27,6 @@ def system(cmd, loop):
181
182 loop.screen.stop()
183
184- cmd = u"{0}".format(cmd)
185- cmd = cmd.encode("utf-8") # FIXME: Correct encoding?
186 safe_cmd = shlex.split(cmd)
187
188 logger.debug("System command: {0}".format(safe_cmd))
189@@ -114,7 +112,7 @@ class AutocompleteWidget(urwid.Edit):
190
191 # When search bar is empty show placeholder text.
192 if not self.edit_text and not self.autocomplete_text:
193- placeholder_text = u"Find or Create"
194+ placeholder_text = "Find or Create"
195 return (placeholder_text,
196 [("placeholder", len(placeholder_text))])
197
198@@ -186,7 +184,7 @@ class NoteFilterListBox(urwid.ListBox):
199
200 def render(self, size, focus=False):
201 if len(self.list_walker) == 0:
202- placeholder = placeholder_text(u"No matching notes, press Enter "
203+ placeholder = placeholder_text("No matching notes, press Enter "
204 "to create a new note")
205 return placeholder.render(size)
206 return super(NoteFilterListBox, self).render(size, self.fake_focus)
207@@ -399,7 +397,7 @@ class MainFrame(urwid.Frame):
208 # If the user has no notes yet show some placeholder text, otherwise
209 # show the note list.
210 if len(self.notebook) == 0:
211- self.body = placeholder_text(u"You have no notes yet, to create "
212+ self.body = placeholder_text("You have no notes yet, to create "
213 "a note type a note title then press Enter")
214 else:
215 self.body = urwid.Padding(self.list_box, left=1, right=1)
diff --git a/patches/terminal_velocity_sort_found_notes.patch b/patches/terminal_velocity_sort_found_notes.patch
index 8296d54..2bc563c 100644
--- a/patches/terminal_velocity_sort_found_notes.patch
+++ b/patches/terminal_velocity_sort_found_notes.patch
@@ -1,8 +1,14 @@
1commit 0f9df37046e58c8963aff93c649e5d3dbf2202bd
2Author: Ismaël Bouya <ismael.bouya@normalesup.org>
3Date: Sat Mar 9 20:11:46 2019 +0100
4
5 Add sorting option
6
1diff --git a/terminal_velocity/terminal_velocity.py b/terminal_velocity/terminal_velocity.py 7diff --git a/terminal_velocity/terminal_velocity.py b/terminal_velocity/terminal_velocity.py
2index db2eb05..bb77dc6 100755 8index a53eda3..5f0e213 100755
3--- a/terminal_velocity/terminal_velocity.py 9--- a/terminal_velocity/terminal_velocity.py
4+++ b/terminal_velocity/terminal_velocity.py 10+++ b/terminal_velocity/terminal_velocity.py
5@@ -75,6 +75,10 @@ the default default will be used""" 11@@ -90,6 +90,10 @@ the default default will be used"""
6 default=defaults.get("log_file", "~/.tvlog"), 12 default=defaults.get("log_file", "~/.tvlog"),
7 help="the file to log to (default: %(default)s)") 13 help="the file to log to (default: %(default)s)")
8 14
@@ -13,15 +19,15 @@ index db2eb05..bb77dc6 100755
13 parser.add_argument("-p", "--print-config", dest="print_config", 19 parser.add_argument("-p", "--print-config", dest="print_config",
14 action="store_true", default=False, 20 action="store_true", default=False,
15 help="print your configuration settings then exit") 21 help="print your configuration settings then exit")
16@@ -120,7 +124,7 @@ the default default will be used""" 22@@ -138,7 +142,7 @@ the default default will be used"""
17 try: 23 try:
18 urwid_ui.launch(notes_dir=args.notes_dir, editor=args.editor, 24 urwid_ui.launch(notes_dir=args.notes_dir, editor=args.editor,
19 extension=args.extension, extensions=args.extensions, 25 extension=args.extension, extensions=args.extensions,
20- exclude=args.exclude) 26- exclude=args.exclude)
21+ exclude=args.exclude, sort=args.sort) 27+ exclude=args.exclude, sort=args.sort)
22 except KeyboardInterrupt: 28 except KeyboardInterrupt:
23 # Silence KeyboardInterrupt tracebacks on ctrl-c. 29 # Run the shutdown hook
24 sys.exit() 30 shutdown()
25diff --git a/terminal_velocity/urwid_ui.py b/terminal_velocity/urwid_ui.py 31diff --git a/terminal_velocity/urwid_ui.py b/terminal_velocity/urwid_ui.py
26index 34cf4f6..caebcb9 100644 32index 34cf4f6..caebcb9 100644
27--- a/terminal_velocity/urwid_ui.py 33--- a/terminal_velocity/urwid_ui.py