diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/0001-bindings_path.patch | 17 | ||||
-rw-r--r-- | debian/patches/0002-config_files_paths.patch | 19 | ||||
-rw-r--r-- | debian/patches/0003-add_powerline_compile_flags.patch | 20 | ||||
-rw-r--r-- | debian/patches/0004-set_default_shell_theme.patch | 17 | ||||
-rw-r--r-- | debian/patches/0005-use_python3_by_default.patch | 95 | ||||
-rw-r--r-- | debian/patches/0006-privacy-breach-fixes.patch | 17 | ||||
-rw-r--r-- | debian/patches/0007-python-311-support.patch | 96 | ||||
-rw-r--r-- | debian/patches/series | 7 |
8 files changed, 288 insertions, 0 deletions
diff --git a/debian/patches/0001-bindings_path.patch b/debian/patches/0001-bindings_path.patch new file mode 100644 index 0000000..4955245 --- /dev/null +++ b/debian/patches/0001-bindings_path.patch @@ -0,0 +1,17 @@ +Author: Jerome Charaoui <jerome@riseup.net> +Description: Adjusts bindings path for Debian +Bug-Debian: https://bugs.debian.org/766637 +Forwarded: not-needed + +diff -Naurp powerline.orig/powerline/config.py powerline/powerline/config.py +--- powerline.orig/powerline/config.py ++++ powerline/powerline/config.py +@@ -5,6 +5,6 @@ import os + + + POWERLINE_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +-BINDINGS_DIRECTORY = os.path.join(POWERLINE_ROOT, 'powerline', 'bindings') ++BINDINGS_DIRECTORY = '/usr/share/powerline/bindings' + TMUX_CONFIG_DIRECTORY = os.path.join(BINDINGS_DIRECTORY, 'tmux') + DEFAULT_SYSTEM_CONFIG_DIR = None + diff --git a/debian/patches/0002-config_files_paths.patch b/debian/patches/0002-config_files_paths.patch new file mode 100644 index 0000000..9399db2 --- /dev/null +++ b/debian/patches/0002-config_files_paths.patch @@ -0,0 +1,19 @@ +Author: Jerome Charaoui <jerome@riseup.net> +Description: Adds Debian configuration paths +Bug-Debian: https://bugs.debian.org/758551, https://bugs.debian.org/899178 +Forwarded: not-needed + +diff -Naurp powerline.orig/powerline/__init__.py powerline/powerline/__init__.py +--- powerline.orig/powerline/__init__.py ++++ powerline/powerline/__init__.py +@@ -148,8 +148,8 @@ def get_config_paths(): + config_dirs = os.environ.get('XDG_CONFIG_DIRS', DEFAULT_SYSTEM_CONFIG_DIR) + if config_dirs is not None: + config_paths[:0] = reversed([join(d, 'powerline') for d in config_dirs.split(':')]) +- plugin_path = join(os.path.realpath(os.path.dirname(__file__)), 'config_files') +- config_paths.insert(0, plugin_path) ++ config_paths.insert(0, '/etc/powerline') ++ config_paths.insert(0, '/usr/share/powerline/config_files') + return config_paths + + diff --git a/debian/patches/0003-add_powerline_compile_flags.patch b/debian/patches/0003-add_powerline_compile_flags.patch new file mode 100644 index 0000000..955824e --- /dev/null +++ b/debian/patches/0003-add_powerline_compile_flags.patch @@ -0,0 +1,20 @@ +Author: Jerome Charaoui <jerome@riseup.net> +Description: Adds CPPFLAGS and LDFLAGS to scripts/powerline compiler +Forwarded: not-needed + +diff -Naurp powerline.orig/setup.py powerline/setup.py +--- powerline.orig/setup.py ++++ powerline/setup.py +@@ -30,9 +30,11 @@ def compile_client(): + from distutils.ccompiler import new_compiler + compiler = new_compiler().compiler + cflags = os.environ.get('CFLAGS', str('-O3')) ++ ldflags = os.environ.get('LDFLAGS', '') ++ cppflags = os.environ.get('CPPFLAGS', '') + # A normal split would do a split on each space which might be incorrect. The + # shlex will not split if a space occurs in an arguments value. +- subprocess.check_call(compiler + shlex.split(cflags) + ['client/powerline.c', '-o', 'scripts/powerline']) ++ subprocess.check_call(compiler + shlex.split(cflags) + shlex.split(ldflags) + shlex.split(cppflags) + ['client/powerline.c', '-o', 'scripts/powerline']) + + try: + compile_client() diff --git a/debian/patches/0004-set_default_shell_theme.patch b/debian/patches/0004-set_default_shell_theme.patch new file mode 100644 index 0000000..c1ca003 --- /dev/null +++ b/debian/patches/0004-set_default_shell_theme.patch @@ -0,0 +1,17 @@ +Author: Daniel Baumann <daniel.baumann@progress-linux.org> +Description: Setting default shell theme to default_leftonly +Bug-Debian: https://bugs.debian.org/899153 +Forwarded: not-needed + +diff -Naurp powerline.orig/powerline/config_files/config.json powerline/powerline/config_files/config.json +--- powerline.orig/powerline/config_files/config.json ++++ powerline/powerline/config_files/config.json +@@ -18,7 +18,7 @@ + }, + "shell": { + "colorscheme": "default", +- "theme": "default", ++ "theme": "default_leftonly", + "local_themes": { + "continuation": "continuation", + "select": "select" diff --git a/debian/patches/0005-use_python3_by_default.patch b/debian/patches/0005-use_python3_by_default.patch new file mode 100644 index 0000000..7dc4886 --- /dev/null +++ b/debian/patches/0005-use_python3_by_default.patch @@ -0,0 +1,95 @@ +Author: Daniel Baumann <daniel.baumann@progress-linux.org> +Description: Switching to use python3 by default +Bug-Debian: https://bugs.debian.org/899165 +Forwarded: not-needed + +diff -Naurp powerline.orig/client/powerline.py powerline/client/powerline.py +--- powerline.orig/client/powerline.py ++++ powerline/client/powerline.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/powerline/bindings/awesome/powerline-awesome.py powerline/powerline/bindings/awesome/powerline-awesome.py +--- powerline.orig/powerline/bindings/awesome/powerline-awesome.py ++++ powerline/powerline/bindings/awesome/powerline-awesome.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/powerline/bindings/bar/powerline-bar.py powerline/powerline/bindings/bar/powerline-bar.py +--- powerline.orig/powerline/bindings/bar/powerline-bar.py ++++ powerline/powerline/bindings/bar/powerline-bar.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/powerline/bindings/i3/powerline-i3.py powerline/powerline/bindings/i3/powerline-i3.py +--- powerline.orig/powerline/bindings/i3/powerline-i3.py ++++ powerline/powerline/bindings/i3/powerline-i3.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/powerline/bindings/lemonbar/powerline-lemonbar.py powerline/powerline/bindings/lemonbar/powerline-lemonbar.py +--- powerline.orig/powerline/bindings/lemonbar/powerline-lemonbar.py ++++ powerline/powerline/bindings/lemonbar/powerline-lemonbar.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/powerline/bindings/pdb/__main__.py powerline/powerline/bindings/pdb/__main__.py +--- powerline.orig/powerline/bindings/pdb/__main__.py ++++ powerline/powerline/bindings/pdb/__main__.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/scripts/powerline-config powerline/scripts/powerline-config +--- powerline.orig/scripts/powerline-config ++++ powerline/scripts/powerline-config +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/scripts/powerline-daemon powerline/scripts/powerline-daemon +--- powerline.orig/scripts/powerline-daemon ++++ powerline/scripts/powerline-daemon +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/scripts/powerline-lint powerline/scripts/powerline-lint +--- powerline.orig/scripts/powerline-lint ++++ powerline/scripts/powerline-lint +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +diff -Naurp powerline.orig/scripts/powerline-render powerline/scripts/powerline-render +--- powerline.orig/scripts/powerline-render ++++ powerline/scripts/powerline-render +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # vim:fileencoding=utf-8:noet + + from __future__ import (unicode_literals, division, absolute_import, print_function) diff --git a/debian/patches/0006-privacy-breach-fixes.patch b/debian/patches/0006-privacy-breach-fixes.patch new file mode 100644 index 0000000..1c74764 --- /dev/null +++ b/debian/patches/0006-privacy-breach-fixes.patch @@ -0,0 +1,17 @@ +Description: fix documentation privacy breaches +Author: Jerome Charaoui <jerome@riseup.net> +Last-Update: 2018-05-23 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep +--- a/docs/source/conf.py ++++ b/docs/source/conf.py +@@ -63,8 +63,7 @@ if not on_rtd: # only import and set the theme if we’re building docs locally + if on_rtd or html_theme == 'sphinx_rtd_theme': + html_context = { + 'css_files': [ +- 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', +- 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', ++ '_static/css/css/sphinx_rtd_theme.css', + '_static/css/theme_overrides.css', + ], + } diff --git a/debian/patches/0007-python-311-support.patch b/debian/patches/0007-python-311-support.patch new file mode 100644 index 0000000..be8c9f0 --- /dev/null +++ b/debian/patches/0007-python-311-support.patch @@ -0,0 +1,96 @@ +From 6238d9e8b78f5327f60bd1d2606a37f951a3cd9c Mon Sep 17 00:00:00 2001 +From: Christoph Erhardt <github@sicherha.de> +Date: Wed, 22 Jun 2022 21:42:53 +0200 +Subject: [PATCH] Ensure compatibility with Python 3.11 + +* Replace deprecated `getargspec()` with `getfullargspec()` +* Replace deprecated `formatargspec()` with custom implementation + +Fixes #2209. +--- + docs/source/powerline_autodoc.py | 6 ++---- + powerline/lint/inspect.py | 34 +++++++++++++++++++++++++++++--- + 2 files changed, 33 insertions(+), 7 deletions(-) + +diff --git a/docs/source/powerline_autodoc.py b/docs/source/powerline_autodoc.py +index eba42edb7..83996aeaf 100644 +--- a/docs/source/powerline_autodoc.py ++++ b/docs/source/powerline_autodoc.py +@@ -3,11 +3,9 @@ + + import os + +-from inspect import formatargspec +- + from sphinx.ext import autodoc + +-from powerline.lint.inspect import getconfigargspec ++from powerline.lint.inspect import formatconfigargspec, getconfigargspec + from powerline.segments import Segment + from powerline.lib.unicode import unicode + +@@ -28,7 +26,7 @@ def can_document_member(cls, member, membername, isattr, parent): + + def format_args(self): + argspec = getconfigargspec(self.object) +- return formatargspec(*argspec, formatvalue=formatvalue).replace('\\', '\\\\') ++ return formatconfigargspec(*argspec, formatvalue=formatvalue).replace('\\', '\\\\') + + + class Repr(object): +diff --git a/powerline/lint/inspect.py b/powerline/lint/inspect.py +index 15bb6103b..7ab720f84 100644 +--- a/powerline/lint/inspect.py ++++ b/powerline/lint/inspect.py +@@ -1,7 +1,8 @@ + # vim:fileencoding=utf-8:noet + from __future__ import (unicode_literals, division, absolute_import, print_function) + +-from inspect import ArgSpec, getargspec ++from inspect import FullArgSpec, getfullargspec ++from itertools import zip_longest + + from powerline.segments import Segment + +@@ -33,7 +34,7 @@ def getconfigargspec(obj): + requires_filesystem_watcher = hasattr(obj, 'powerline_requires_filesystem_watcher') + + for name, method in argspecobjs: +- argspec = getargspec(method) ++ argspec = getfullargspec(method) + omitted_args = get_omitted_args(name, method) + largs = len(argspec.args) + for i, arg in enumerate(reversed(argspec.args)): +@@ -60,4 +61,31 @@ def getconfigargspec(obj): + if arg not in args: + args.insert(0, arg) + +- return ArgSpec(args=args, varargs=None, keywords=None, defaults=tuple(defaults)) ++ return FullArgSpec(args=args, varargs=None, varkw=None, defaults=tuple(defaults), kwonlyargs=(), kwonlydefaults={}, annotations={}) ++ ++ ++def formatconfigargspec(args, varargs=None, varkw=None, defaults=None, ++ kwonlyargs=(), kwonlydefaults={}, annotations={}, ++ formatvalue=lambda value: '=' + repr(value)): ++ '''Format an argument spec from the values returned by getconfigargspec. ++ ++ This is a specialized replacement for inspect.formatargspec, which has been ++ deprecated since Python 3.5 and was removed in Python 3.11. It supports ++ valid values for args, defaults and formatvalue; all other parameters are ++ expected to be either empty or None. ++ ''' ++ assert varargs is None ++ assert varkw is None ++ assert not kwonlyargs ++ assert not kwonlydefaults ++ assert not annotations ++ ++ specs = [] ++ if defaults: ++ firstdefault = len(args) - len(defaults) ++ for i, arg in enumerate(args): ++ spec = arg ++ if defaults and i >= firstdefault: ++ spec += formatvalue(defaults[i - firstdefault]) ++ specs.append(spec) ++ return '(' + ', '.join(specs) + ')' diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..1535b42 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,7 @@ +0001-bindings_path.patch +0002-config_files_paths.patch +0003-add_powerline_compile_flags.patch +0004-set_default_shell_theme.patch +0005-use_python3_by_default.patch +0006-privacy-breach-fixes.patch +0007-python-311-support.patch |