diff --git a/pkgs/applications/graphics/vimiv/default.nix b/pkgs/applications/graphics/vimiv/default.nix index bb8437153cad..39db1dd1f6d8 100644 --- a/pkgs/applications/graphics/vimiv/default.nix +++ b/pkgs/applications/graphics/vimiv/default.nix @@ -7,13 +7,13 @@ python3Packages.buildPythonApplication rec { name = "vimiv"; - version = "0.7.2"; + version = "0.7.3"; src = fetchFromGitHub { owner = "karlch"; repo = "vimiv"; rev = "v${version}"; - sha256 = "1g97ms84xk4ci4crq9wdc3744jnrqkq2qz9sg69lhm9sr5f68bw4"; + sha256 = "18dn81n8hcrqhrqfida34qz7a0ar9rz2rrmzsvyp54zc6nyvv1cn"; }; testimages = fetchFromGitHub { @@ -23,8 +23,6 @@ python3Packages.buildPythonApplication rec { sha256 = "0a3aybzpms0381dz9japhm4c7j5klhmw91prcac6zaww6x34nmxb"; }; - patches = [ ./fixes.patch ]; - postPatch = '' patchShebangs scripts/install_icons.sh sed -i -e 's,/usr,,g' -e '/setup\.py/d' Makefile scripts/install_icons.sh diff --git a/pkgs/applications/graphics/vimiv/fixes.patch b/pkgs/applications/graphics/vimiv/fixes.patch deleted file mode 100644 index 09c06e43058a..000000000000 --- a/pkgs/applications/graphics/vimiv/fixes.patch +++ /dev/null @@ -1,128 +0,0 @@ -Patch submitted upstream at https://github.com/karlch/vimiv/pull/32 - -diff --git a/tests/main_test.py b/tests/main_test.py -index a1870e7..2edc86d 100644 ---- a/tests/main_test.py -+++ b/tests/main_test.py -@@ -15,7 +15,7 @@ class MainTest(TestCase): - - def test_main_until_quit(self): - """Run through vimiv main once.""" -- v_main.main(True) -+ v_main.main([], True) - - - if __name__ == '__main__': -diff --git a/vimiv/helpers.py b/vimiv/helpers.py -index 22f0115..bfaf016 100644 ---- a/vimiv/helpers.py -+++ b/vimiv/helpers.py -@@ -3,7 +3,6 @@ - """Wrappers around standard library functions used in vimiv.""" - - import os --from subprocess import Popen, PIPE - from gi import require_version - require_version('Gtk', '3.0') - from gi.repository import Gtk -@@ -20,17 +19,17 @@ scrolltypes["K"] = (Gtk.ScrollType.START, False) - scrolltypes["L"] = (Gtk.ScrollType.END, True) - - # A list of all external commands --external_commands = [] --try: -- p = Popen('echo $PATH | tr \':\' \'\n\' | xargs -n 1 ls -1', -- stdout=PIPE, stderr=PIPE, shell=True) -- out, err = p.communicate() -- out = out.decode('utf-8').split() -- for cmd in sorted(list(set(out))): -- external_commands.append("!" + cmd) --except: -- external_commands = [] --external_commands = tuple(external_commands) -+pathenv = os.environ.get('PATH') -+if pathenv is not None: -+ executables = set() -+ for path in pathenv.split(':'): -+ try: -+ executables |= set(["!" + e for e in os.listdir(path)]) -+ except OSError: -+ continue -+ external_commands = tuple(sorted(list(executables))) -+else: -+ external_commands = () - - - def listdir_wrapper(path, show_hidden=False): -diff --git a/vimiv/imageactions.py b/vimiv/imageactions.py -index d92eb73..b9bc986 100644 ---- a/vimiv/imageactions.py -+++ b/vimiv/imageactions.py -@@ -157,8 +157,8 @@ class Thumbnails: - # Correct name - thumb_ext = ".thumbnail_%dx%d" % (self.thumbsize[0], - self.thumbsize[1]) -- outfile_ext = infile.split(".")[0] + thumb_ext + ".png" -- outfile_base = os.path.basename(outfile_ext) -+ infile_base = os.path.basename(infile) -+ outfile_base = infile_base.split(".")[0] + thumb_ext + ".png" - outfile = os.path.join(self.directory, outfile_base) - # Only if they aren't cached already - if outfile_base not in self.thumbnails: -diff --git a/vimiv/main.py b/vimiv/main.py -index a0e38cf..39f7407 100644 ---- a/vimiv/main.py -+++ b/vimiv/main.py -@@ -27,7 +27,7 @@ from vimiv.mark import Mark - from vimiv.information import Information - - --def main(running_tests=False): -+def main(arguments, running_tests=False): - """Starting point for vimiv. - - Args: -@@ -36,7 +36,7 @@ def main(running_tests=False): - parser = get_args() - parse_dirs() - settings = parse_config() -- settings = parse_args(parser, settings) -+ settings = parse_args(parser, settings, arguments) - - args = settings["GENERAL"]["paths"] - -diff --git a/vimiv/parser.py b/vimiv/parser.py -index 874a538..9d5afce 100644 ---- a/vimiv/parser.py -+++ b/vimiv/parser.py -@@ -56,7 +56,7 @@ def get_args(): - return parser - - --def parse_args(parser, settings, arguments=None): -+def parse_args(parser, settings, arguments): - """Parse the arguments and return the modified settings. - - Args: -@@ -66,10 +66,7 @@ def parse_args(parser, settings, arguments=None): - - Return: Modified settings after parsing the arguments. - """ -- if arguments: -- args = parser.parse_args(arguments) -- else: -- args = parser.parse_args() -+ args = parser.parse_args(arguments) - if args.show_version: - information = Information() - print(information.get_version()) -diff --git a/vimiv/vimiv b/vimiv/vimiv -index 5497e08..57f34f1 100755 ---- a/vimiv/vimiv -+++ b/vimiv/vimiv -@@ -5,4 +5,4 @@ import sys - import vimiv - - if __name__ == '__main__': -- sys.exit(vimiv.main.main()) -+ sys.exit(vimiv.main.main(sys.argv))